Minor local update...
This commit is contained in:
parent
7f84129e9a
commit
328f866381
0
.gitignore
vendored
Normal file → Executable file
0
.gitignore
vendored
Normal file → Executable file
0
compile.sh
Normal file → Executable file
0
compile.sh
Normal file → Executable file
8
install.sh
Normal file → Executable file
8
install.sh
Normal file → Executable file
@ -2,10 +2,10 @@
|
||||
|
||||
set -xe
|
||||
|
||||
mkdir -p /usr/include/xolatile
|
||||
mkdir -p /usr/local/include/xolatile
|
||||
|
||||
cp xyntax.h /usr/include/xolatile/xyntax.h
|
||||
cp xyntax.c /usr/include/xolatile/xyntax.c
|
||||
cp xyntax.o /usr/include/xolatile/xyntax.o
|
||||
cp xyntax.h /usr/local/include/xolatile/xyntax.h
|
||||
cp xyntax.c /usr/local/include/xolatile/xyntax.c
|
||||
cp xyntax.o /usr/local/include/xolatile/xyntax.o
|
||||
|
||||
exit
|
||||
|
26
xyntax.c
Normal file → Executable file
26
xyntax.c
Normal file → Executable file
@ -17,7 +17,7 @@ static int * syntax_effect = null;
|
||||
static void syntax_delete (void) {
|
||||
int offset;
|
||||
|
||||
if (syntax_active == false) {
|
||||
if (! syntax_active) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -39,7 +39,7 @@ static void syntax_delete (void) {
|
||||
}
|
||||
|
||||
int syntax_define (int enrange, int derange, char * begin, char * end, char escape, int colour, int effect) {
|
||||
if (syntax_active == false) {
|
||||
if (! syntax_active) {
|
||||
syntax_active = true;
|
||||
|
||||
atexit (syntax_delete);
|
||||
@ -76,19 +76,19 @@ int syntax_define (int enrange, int derange, char * begin, char * end, char esca
|
||||
int syntax_select (char * string, int * length) {
|
||||
int offset, subset, select;
|
||||
|
||||
fatal_failure (syntax_active == false, "syntax_select: Syntax is not active.");
|
||||
fatal_failure (string == null, "syntax_select: String is null.");
|
||||
fatal_failure (length == null, "syntax_select: Length is null.");
|
||||
fatal_failure (! syntax_active, "syntax_select: Syntax is not active.");
|
||||
fatal_failure (! string, "syntax_select: String is null.");
|
||||
fatal_failure (! length, "syntax_select: Length is null.");
|
||||
|
||||
for (select = offset = 0; select != syntax_count; ++select) {
|
||||
if (syntax_enrange [select] == false) {
|
||||
if (syntax_derange [select] == false) {
|
||||
if (string_compare_limit (string, syntax_begin [select], string_length (syntax_begin [select])) == true) {
|
||||
if (! syntax_enrange [select]) {
|
||||
if (! syntax_derange [select]) {
|
||||
if (string_compare_limit (string, syntax_begin [select], string_length (syntax_begin [select]))) {
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
if ((string_compare_limit (string, syntax_begin [select], string_length (syntax_begin [select])) == true)
|
||||
&& (character_compare_array (string [offset + string_length (syntax_begin [select])], syntax_end [select]) == true)) {
|
||||
if ((string_compare_limit (string, syntax_begin [select], string_length (syntax_begin [select])))
|
||||
&& (character_compare_array (string [offset + string_length (syntax_begin [select])], syntax_end [select]))) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -115,14 +115,14 @@ int syntax_select (char * string, int * length) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (syntax_derange [select] == false) {
|
||||
if (string_compare_limit (& string [offset], syntax_end [select], string_length (syntax_end [select])) == true) {
|
||||
if (syntax_derange [select]) {
|
||||
if (string_compare_limit (& string [offset], syntax_end [select], string_length (syntax_end [select]))) {
|
||||
* length = offset + string_length (syntax_end [select]);
|
||||
return (select);
|
||||
}
|
||||
} else {
|
||||
subset = 0;
|
||||
if (string_compare (syntax_end [select], "") == false) {
|
||||
if (string_compare (syntax_end [select], "")) {
|
||||
break;
|
||||
} do {
|
||||
if (string [offset] == syntax_end [select] [subset]) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user