Skip to content

Commit

Permalink
Update liblouis from v3.26.0 to v3.31.0
Browse files Browse the repository at this point in the history
Signed-off-by: Patryk Miś <foss@patrykmis.com>
  • Loading branch information
PatrykMis committed Sep 27, 2024
1 parent decca44 commit 6e803fa
Show file tree
Hide file tree
Showing 87 changed files with 9,256 additions and 13,174 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,6 @@ am__aclocal_m4_deps = $(top_srcdir)/tools/gnulib/m4/close.m4 \
$(top_srcdir)/gnulib/m4/limits-h.m4 \
$(top_srcdir)/gnulib/m4/malloc.m4 \
$(top_srcdir)/gnulib/m4/malloca.m4 \
$(top_srcdir)/gnulib/m4/manywarnings.m4 \
$(top_srcdir)/gnulib/m4/multiarch.m4 \
$(top_srcdir)/gnulib/m4/off_t.m4 \
$(top_srcdir)/gnulib/m4/realloc.m4 \
Expand All @@ -161,7 +160,6 @@ am__aclocal_m4_deps = $(top_srcdir)/tools/gnulib/m4/close.m4 \
$(top_srcdir)/gnulib/m4/sys_types_h.m4 \
$(top_srcdir)/gnulib/m4/unistd_h.m4 \
$(top_srcdir)/gnulib/m4/warn-on-use.m4 \
$(top_srcdir)/gnulib/m4/warnings.m4 \
$(top_srcdir)/gnulib/m4/wchar_h.m4 \
$(top_srcdir)/gnulib/m4/wchar_t.m4 \
$(top_srcdir)/gnulib/m4/wint_t.m4 \
Expand Down Expand Up @@ -339,7 +337,6 @@ ERRNO_H = @ERRNO_H@
ETAGS = @ETAGS@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
FILECMD = @FILECMD@
GETOPT_CDEFS_H = @GETOPT_CDEFS_H@
GETOPT_H = @GETOPT_H@
GL_CFLAG_ALLOW_WARNINGS = @GL_CFLAG_ALLOW_WARNINGS@
Expand Down Expand Up @@ -1407,7 +1404,6 @@ UNISTD_H_HAVE_SYS_RANDOM_H = @UNISTD_H_HAVE_SYS_RANDOM_H@
UNISTD_H_HAVE_WINSOCK2_H = @UNISTD_H_HAVE_WINSOCK2_H@
UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS = @UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@
VERSION = @VERSION@
WARN_CFLAGS = @WARN_CFLAGS@
WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@
WIDECHAR_TYPE = @WIDECHAR_TYPE@
WINDOWS_64_BIT_OFF_T = @WINDOWS_64_BIT_OFF_T@
Expand Down

This file was deleted.

Binary file not shown.

Large diffs are not rendered by default.

This file was deleted.

Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@
#define HAVE_INTTYPES_H 1

/* Define to 1 if you have the `yaml' library (-lyaml). */
/* #undef HAVE_LIBYAML */
#define HAVE_LIBYAML 1

/* Define to 1 if you have the <limits.h> header file. */
#define HAVE_LIMITS_H 1
Expand Down Expand Up @@ -474,7 +474,7 @@
/* #undef PACKAGE_PACKAGER_VERSION */

/* Define to the full name and version of this package. */
#define PACKAGE_STRING "Liblouis 3.26.0"
#define PACKAGE_STRING "Liblouis 3.31.0"

/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "liblouis"
Expand All @@ -483,7 +483,7 @@
#define PACKAGE_URL "http://www.liblouis.io"

/* Define to the version of this package. */
#define PACKAGE_VERSION "3.26.0"
#define PACKAGE_VERSION "3.31.0"

/* Define to the type that is the result of default argument promotions of
type mode_t. */
Expand Down Expand Up @@ -620,7 +620,7 @@


/* Version number of package */
#define VERSION "3.26.0"
#define VERSION "3.31.0"

/* Define to l, ll, u, ul, ull, etc., as suitable for constants of type
'wchar_t'. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,8 @@ typedef struct {
widechar value;
TranslationTableOffset basechar;
TranslationTableOffset linked;
int ruleIndex; /** sequence number of rule within table */
int finalized;
} TranslationTableCharacter;

typedef enum { /* Op codes */
Expand Down Expand Up @@ -359,9 +361,10 @@ typedef enum { /* Op codes */
typedef struct {
const char *sourceFile;
int sourceLine;
TranslationTableOffset charsnext; /** next chars entry */
TranslationTableOffset dotsnext; /** next dots entry */
TranslationTableCharacterAttributes after; /** character types which must follow */
int index; /** sequence number of rule within table */
TranslationTableOffset charsnext; /** next chars entry */
TranslationTableOffset dotsnext; /** next dots entry */
TranslationTableCharacterAttributes after; /** character types which must follow */
TranslationTableCharacterAttributes before; /** character types which must precede */
TranslationTableOffset patterns; /** before and after patterns */
TranslationTableOpcode opcode; /** rule for testing validity of replacement */
Expand Down Expand Up @@ -439,6 +442,7 @@ typedef struct { /* translation table */
faster) */
int usesAttributeOrClass; /* 1 = attribute, 2 = class */
char *sourceFiles[MAX_SOURCE_FILES + 1];
int ruleCounter;

/* needed for translation or other api functions */
int finalized;
Expand Down

This file was deleted.

This file was deleted.

Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,6 @@ _lou_backTranslate(const char *tableList, const char *displayTableList,
int maxAppliedRules;
int appliedRulesCount;
int k;
int goodTrans = 1;
int idx;
if (tableList == NULL || inbuf == NULL || inlen == NULL || outbuf == NULL ||
outlen == NULL)
Expand Down Expand Up @@ -251,21 +250,26 @@ _lou_backTranslate(const char *tableList, const char *displayTableList,
int realInlen;
switch (currentPass) {
case 1:
goodTrans = backTranslateString(table, mode, currentPass, &input, &output,
spacebuf, passPosMapping, &realInlen, &cursorPosition, &cursorStatus,
appliedRules, &appliedRulesCount, maxAppliedRules);
if (!backTranslateString(table, mode, currentPass, &input, &output, spacebuf,
passPosMapping, &realInlen, &cursorPosition, &cursorStatus,
appliedRules, &appliedRulesCount, maxAppliedRules))
return 0;
break;
case 0:
goodTrans = makeCorrections(table, mode, currentPass, &input, &output,
passPosMapping, &realInlen, &cursorPosition, &cursorStatus,
appliedRules, &appliedRulesCount, maxAppliedRules);
if (!makeCorrections(table, mode, currentPass, &input, &output,
passPosMapping, &realInlen, &cursorPosition, &cursorStatus,
appliedRules, &appliedRulesCount, maxAppliedRules))
return 0;
break;
default:
goodTrans = translatePass(table, mode, currentPass, &input, &output,
passPosMapping, &realInlen, &cursorPosition, &cursorStatus,
appliedRules, &appliedRulesCount, maxAppliedRules);
if (!translatePass(table, mode, currentPass, &input, &output, passPosMapping,
&realInlen, &cursorPosition, &cursorStatus, appliedRules,
&appliedRulesCount, maxAppliedRules))
return 0;
break;
}

currentPass--;
passPosMapping[realInlen] = output.length;
if (passPosMapping == posMapping) {
passPosMapping = posMapping2;
Expand Down Expand Up @@ -299,8 +303,7 @@ _lou_backTranslate(const char *tableList, const char *displayTableList,
}
}
}
currentPass--;
if (currentPass >= lastPass && goodTrans) {
if (currentPass >= lastPass) {
releaseStringBuffer(input.bufferIndex);
input = (InString){ .chars = output.chars,
.length = output.length,
Expand All @@ -314,33 +317,31 @@ _lou_backTranslate(const char *tableList, const char *displayTableList,
}
break;
}
if (goodTrans) {
for (k = 0; k < output.length; k++) outbuf[k] = output.chars[k];
*outlen = output.length;
if (inputPos != NULL) {
int inpos = -1;
int outpos = -1;
for (k = 0; k < *inlen; k++)
if (posMapping[k] > outpos) {
while (outpos < posMapping[k]) {
if (outpos >= 0 && outpos < *outlen)
inputPos[outpos] = inpos < 0 ? 0 : inpos;
outpos++;
}
inpos = k;
for (k = 0; k < output.length; k++) outbuf[k] = output.chars[k];
*outlen = output.length;
if (inputPos != NULL) {
int inpos = -1;
int outpos = -1;
for (k = 0; k < *inlen; k++)
if (posMapping[k] > outpos) {
while (outpos < posMapping[k]) {
if (outpos >= 0 && outpos < *outlen)
inputPos[outpos] = inpos < 0 ? 0 : inpos;
outpos++;
}
if (outpos < 0) outpos = 0;
while (outpos < *outlen) inputPos[outpos++] = inpos;
}
if (outputPos != NULL) {
for (k = 0; k < *inlen; k++)
if (posMapping[k] < 0)
outputPos[k] = 0;
else if (posMapping[k] > *outlen - 1)
outputPos[k] = *outlen - 1;
else
outputPos[k] = posMapping[k];
}
inpos = k;
}
if (outpos < 0) outpos = 0;
while (outpos < *outlen) inputPos[outpos++] = inpos;
}
if (outputPos != NULL) {
for (k = 0; k < *inlen; k++)
if (posMapping[k] < 0)
outputPos[k] = 0;
else if (posMapping[k] > *outlen - 1)
outputPos[k] = *outlen - 1;
else
outputPos[k] = posMapping[k];
}
if (cursorPos != NULL && *cursorPos != -1) {
if (outputPos != NULL)
Expand All @@ -349,7 +350,7 @@ _lou_backTranslate(const char *tableList, const char *displayTableList,
*cursorPos = cursorPosition;
}
if (rulesLen != NULL) *rulesLen = appliedRulesCount;
return goodTrans;
return 1;
}

static TranslationTableCharacter *
Expand Down Expand Up @@ -1321,11 +1322,10 @@ back_swapTest(const TranslationTableHeader *table, const InString *input, int *p
for (curTest = 0; curTest < swapRule->charslen; curTest++) {
if (input->chars[curSrc] != swapRule->charsdots[curTest]) break;
}
if (curTest < swapRule->charslen)
if (curTest < swapRule->charslen) {
*pos = curSrc;
return 1;
}
if (curTest < swapRule->charslen) {
*pos = curSrc;
return 1;
}
curSrc++;
curLen++;
}
Expand Down

This file was deleted.

Binary file not shown.
Loading

0 comments on commit 6e803fa

Please sign in to comment.