Eric House
9568e4ab03
move extra counts into header so new dicts backward compatible
2022-04-01 07:51:13 +02:00
Eric House
f0d8a71deb
split dict faces using js so utf8 chars are ok
...
As with java, the platform knows utf-8 better than vanilla C, so use a
JS inlined function to split a binary stream into its "face" components.
2021-03-19 14:29:20 -07:00
Eric House
d620461574
fix so all compile
2021-03-19 14:26:18 -07:00
Eric House
0f7d924a8e
accept dicts with full paths (linux)
2020-09-28 16:12:24 -07:00
Eric House
07f4774a7c
refactor so common dictnry does more work
...
Linux and Android duplicated all the code to parse a wordlist file --
and shared a bug that needed fixing. So now most of that is in a common/
function both call, and the bug -- failing to mask out flag bits I don't
care about -- is fixed.
2020-05-01 09:18:27 -07:00
Eric House
cfaa6849b2
pass env into dict-related methods
...
I was getting an occasional crash using a stale env to delete a dict's
resources because the dict was cacheing the env that created it. Dumb!
Using the thread->env mapping stuff worked, but that felt risky and so I
tried just passing it in. It's safe, and involves an amount of change I
can tolerate. So likely going that way.
2020-04-26 13:39:16 -07:00
eehouse111999
845370c9ca
cleanup and fix test script stalls
...
Old code always had client trying to connect. So do that here
too. Seems to fix test script stalling.
2020-02-07 23:11:20 -08:00
Eric House
ca8c84b9ae
make it possible to run without an open game
2020-01-29 20:40:14 -08:00
Eric House
97eb6018d9
comment out dead code I keep reading
2019-02-22 19:59:55 -08:00
Eric House
3bb6f842b2
fix valgrind-flagged errors
2018-04-14 09:13:43 -07:00
Eric House
a4302897e2
enlarge dictmgr to track a compile-time defined number of dicts
2014-03-10 21:01:24 -07:00
Eric House
6203a23c62
don't crash in networked games
2014-03-10 18:58:16 -07:00
Eric House
5500d36cde
add and use dict manager that caches, using refcount, dicts across games. Allows multiple games to be opened, and open at the same time, with only one instance of a dict ever created. Works on linux; not used or tested yet on Android.
2014-03-09 19:12:21 -07:00
Eric House
a7c114e3f9
refcount dicts. Model "owns" its copy and so increments the refcount when gaining one and decrements the count on any being replaced (and on all on exit). This is setting up the real change, which is to let the java world wrap dicts in objects that hang onto them until they're destroyed, which should fix problems where dicts are referenced after they've been destroyed.
2014-03-08 20:57:27 -08:00
Eric House
e34cc9007d
fix problems with opening and using wordlists on 64-bit linux by
...
making XP_U32 32 rather than 64 bits. Duh. Do same on Android jni just
in case.
2014-01-07 06:58:20 -08:00
Eric House
070590b3c2
cleanup
2013-06-30 08:34:09 -07:00
Eric House
6fbf2d4a8b
use g_compute_checksum_for_data, removing self-written equivalent
2013-06-30 07:36:56 -07:00
Eric House
17eda4e5e1
move md5sum code into separate function that relay can copy
2013-06-28 20:33:12 -07:00
Eric House
541fc546ab
remove that bit from flags -- since we already do the right thing for it.
2013-04-20 19:46:35 -07:00
Eric House
e4f52c5678
add assert and comment explaining why non-utf-8-aware hack is safe.
2013-04-18 07:15:14 -07:00
Eric House
2873d08974
fix memory leak
2013-04-13 16:49:20 -07:00
Eric House
07cfdad699
fix to support synonyms within specials too -- for linux only so far.
...
Seems to work, though the dawg2dict.pl script is broken.
2013-04-09 07:43:04 -07:00
Eric House
3a628f4375
load new-format dict into linux client, display default faces
...
correctly, and search using alternate as well as default faces. Next:
support for alternate specials.
2013-04-06 11:43:57 -07:00
Eric House
140c982d41
merge from android_branch
2012-09-24 07:39:44 -07:00
Eric House
8fbc9ca343
fix to compile in release mode
2012-09-09 09:22:00 -07:00
Eric House
9a72f252ed
Merge branch 'android_branch' into android_dictname
2012-09-08 13:20:59 -07:00
Eric House
14a77ff7f1
factor out common code
2012-09-08 07:45:18 -07:00
Eric House
5fa9b60846
add md5Sum field to dict struct, and on linux load it if present,
...
otherwise calculate it. In DEBUG builds always calculate and assert
they match.
2012-09-07 20:34:06 -07:00
Eric House
270a19f3aa
Revert "first of a set of changes to communicate to clients dictionary being"
...
This reverts commit b7a0f1489b
, which I didn't mean to check in on this branch.
2012-09-03 21:34:51 -07:00
Eric House
ea4d805d5f
first of a set of changes to communicate to clients dictionary being
...
used by server. Clients need to care if e.g. the server's disallowing
phonies based on its dict. Can only be sent if client is of latest
version. In that case, common code calls into new util function. In
future changes, BoardActivity's implemention of the callback will need
to check if the server's choice of dict is available, and if not offer
to download it. Once it's available, will want to install it.
2012-09-03 21:33:46 -07:00
Eric House
b7a0f1489b
first of a set of changes to communicate to clients dictionary being
...
used by server. Clients need to care if e.g. the server's disallowing
phonies based on its dict. Can only be sent if client is of latest
version. In that case, common code calls into new util function. In
future changes, BoardActivity's implemention of the callback will need
to check if the server's choice of dict is available, and if not offer
to download it. Once it's available, will want to install it.
2012-09-03 21:29:21 -07:00
Eric House
9d174601b9
add field, and getter, for new dict header description string, and
...
load it in linux client.
2012-08-26 20:58:28 -07:00
Eric House
b29df8512a
add null-terminated note to dawg header and modify linux client to
...
accept it if present. Android client will successfully ignore it and
will need to be modified to capture and display it if present. Idea's
to display information about copyright, source, etc. of wordlists.
2012-08-25 10:20:52 -07:00
Eric House
464696566d
get rid of NODE_CAN_4. Not change to post-compiled code
2012-08-01 20:29:15 -07:00
Andy2
f32f7a8b19
Don't behave badly in presence of empty dict: word count should be 0
...
and sanity test should pass.
2011-11-21 18:07:08 -08:00
Eric House
d6fecaa3d3
don't crash when dict is empty file
2011-11-13 17:06:57 -08:00
Eric House
268f018140
add dict sanity check that will, I hope, catch corrupt dicts.
2011-11-09 06:51:12 -08:00
Eric House
4093e1c947
add option to switch between mmap and malloc for dict runtime access.
2011-07-18 18:07:15 -07:00
Andy2
d81458c34c
use nmap -- as test case for doing same in jni
2011-07-15 18:24:08 -07:00
Eric House
c4cdc24b78
initial changes to add a header to xwd format so that stuff like
...
number of words can be included. Changed to build dicts and linux to
open them. Android still needs to learn. Also, some of the tools in
dawg/ need to be fixed to read old-format (pre-utf8) .xwd files.
2010-12-05 19:33:10 -08:00
Andy2
b3d3673dc9
read the langcode out of dict and into common struct
2010-09-10 01:57:22 -07:00
eehouse
6e9fb31f60
fix compile errors due to making some fields const
2010-02-24 04:28:22 +00:00
ehouse
a91fd28773
fix some warnings when building linux client without debugging but
...
with warnings as errors.
2009-09-20 21:51:29 +00:00
ehouse
535e97b855
replace array of indices with array of ptrs for faster & smaller code
2009-09-13 05:28:12 +00:00
ehouse
3a1c2572dd
Merge in unicode changes to read in utf-8 dictionary format
2009-09-04 12:30:10 +00:00
ehouse
1c8147c21c
Tweak to support non-ascii utf-8 chars from dicts. Seems to display
...
Catalan and Polish fine (on board.)
2009-08-29 16:09:58 +00:00
ehouse
a9b88d95b2
Read new dicts and old into new format.
2009-04-05 19:22:55 +00:00
ehouse
863f79bfb9
Fix compile errors using latest gcc (fread etc must have return value checked)
2009-01-03 18:12:34 +00:00
ehouse
d6ef943a5f
add linux_dict_getShortName
2006-09-24 15:35:33 +00:00
ehouse
40563a6790
strutils macro change; log PID on startup for easier attaching
2006-09-15 07:45:40 +00:00