<commit_before>! Copyright (C) 2010 <NAME>.
! See http://factorcode.org/license.txt for BSD license.
USING: alien alien.c-types alien.libraries alien.syntax classes.struct
combinators system ;
IN: gdbm.ffi

<< "libgdbm" {
    { [ os macosx? ] [ "libgdbm.dylib" ] }
    { [ os unix? ] [ "libgdbm.so.3" ] }
    { [ os windows? ] [ "gdbm3.dll" ] }
} cond cdecl add-library >>

LIBRARY: libgdbm

C-GLOBAL: c-string gdbm_version

CONSTANT: GDBM_SYNC   0x20
CONSTANT: GDBM_NOLOCK 0x40

CONSTANT: GDBM_INSERT  0
CONSTANT: GDBM_REPLACE 1

CONSTANT: GDBM_CACHESIZE    1<commit_msg>gdbm.ffi: Use alien library finder except on Windows until we can test if it works there.<commit_after>! Copyright (C) 2010 <NAME>.
! See http://factorcode.org/license.txt for BSD license.
USING: alien alien.c-types alien.libraries alien.libraries.finder
alien.syntax classes.struct combinators kernel system ;
IN: gdbm.ffi

<< "libgdbm"
os windows? [ "gdbm3.dll" ] [ "gdbm" find-library ] if
cdecl add-library >>

LIBRARY: libgdbm

C-GLOBAL: c-string gdbm_version

CONSTANT: GDBM_SYNC   0x20
CONSTANT: GDBM_NOLOCK 0x40

CONSTANT: GDBM_INSERT  0
CONSTANT: GDBM_REPLACE 1

CONSTANT: GDBM_CACHESIZE    1
{'fraction_non_alphanumeric': 0.113384484228474, 'fraction_numerical': 0.0247229326513214, 'mean_word_length': 4.149122807017544, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4118576', 'n_tokens_mistral': 489, 'n_tokens_neox': 464, 'n_words': 118}