mirror of https://github.com/flysand7/ciabatta.git
move wchar_t out of unicode data folder
This commit is contained in:
parent
5cf93a6532
commit
7165ac1c41
|
@ -6,7 +6,7 @@ abspath = os.path.abspath(sys.argv[0])
|
||||||
dname = os.path.dirname(abspath)
|
dname = os.path.dirname(abspath)
|
||||||
os.chdir(dname)
|
os.chdir(dname)
|
||||||
|
|
||||||
with open('unicode_data.h', 'w') as header:
|
with open('data.h', 'w') as header:
|
||||||
header.write('\n');
|
header.write('\n');
|
||||||
header.write('#pragma once\n\n');
|
header.write('#pragma once\n\n');
|
||||||
header.write('#define Cc 0\n');
|
header.write('#define Cc 0\n');
|
||||||
|
@ -48,7 +48,7 @@ struct _uni_elm {
|
||||||
} uni_codepoints[] = {
|
} uni_codepoints[] = {
|
||||||
''');
|
''');
|
||||||
|
|
||||||
with open('unicode_data.txt') as file:
|
with open('data.txt') as file:
|
||||||
for line in file:
|
for line in file:
|
||||||
row = line.split(';')
|
row = line.split(';')
|
||||||
code = row[0].strip()
|
code = row[0].strip()
|
|
@ -4,8 +4,8 @@ the file with Unicode data at:
|
||||||
|
|
||||||
https://unicode.org/Public/UNIDATA/UnicodeData.txt
|
https://unicode.org/Public/UNIDATA/UnicodeData.txt
|
||||||
|
|
||||||
This file is placed into this directory by the name unicode_data.txt. To update
|
This file is placed into this directory by the name data.txt. To update the
|
||||||
the unicode standard a new file is put under that name, then unicode_compile.py
|
unicode standard a new file is put under that name, then unicode_compile.py is
|
||||||
is ran with python interpreter. It will generate a new unicode.h header file.
|
ran with python interpreter. It will generate a new unicode.h header file.
|
||||||
|
|
||||||
DO NOT MODIFY unicode.h DIRECTLY BRUH.
|
DO NOT MODIFY data.h DIRECTLY BRUH.
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#include <wctype.h>
|
#include <wctype.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include "unicode_data.h"
|
#include "unicode/data.h"
|
||||||
|
|
||||||
static inline int char_cat(wint_t wc) {
|
static inline int char_cat(wint_t wc) {
|
||||||
return uni_codepoints[wc].cat;
|
return uni_codepoints[wc].cat;
|
Loading…
Reference in New Issue