{"id":18847812,"url":"https://github.com/interkosmos/fortran-tcdb","last_synced_at":"2026-02-01T10:30:15.045Z","repository":{"id":139286193,"uuid":"203033141","full_name":"interkosmos/fortran-tcdb","owner":"interkosmos","description":"Fortran 2008 interface bindings to Tokyo Cabinet","archived":false,"fork":false,"pushed_at":"2020-09-09T14:25:56.000Z","size":99,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-12-30T13:57:25.162Z","etag":null,"topics":["database","fortran","nosql","tokyo-cabinet"],"latest_commit_sha":null,"homepage":"","language":"Fortran","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/interkosmos.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2019-08-18T17:01:24.000Z","updated_at":"2023-07-13T18:05:04.000Z","dependencies_parsed_at":"2023-09-25T02:08:08.923Z","dependency_job_id":null,"html_url":"https://github.com/interkosmos/fortran-tcdb","commit_stats":{"total_commits":41,"total_committers":1,"mean_commits":41.0,"dds":0.0,"last_synced_commit":"649781d0262041a237843f635611a8984eceda2a"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/interkosmos%2Ffortran-tcdb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/interkosmos%2Ffortran-tcdb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/interkosmos%2Ffortran-tcdb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/interkosmos%2Ffortran-tcdb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/interkosmos","download_url":"https://codeload.github.com/interkosmos/fortran-tcdb/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239783807,"owners_count":19696447,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["database","fortran","nosql","tokyo-cabinet"],"created_at":"2024-11-08T03:09:44.435Z","updated_at":"2026-02-01T10:30:14.544Z","avatar_url":"https://github.com/interkosmos.png","language":"Fortran","funding_links":[],"categories":[],"sub_categories":[],"readme":"# fortran-tcdb\nA collection of ISO C binding interfaces to the\n[Tokyo Cabinet](https://fallabs.com/tokyocabinet/) key-value database for Fortran\n2008. At the moment, only hash databases are supported.\n\n![Tokyo Cabinet](logo.png)\n\nThe interfaces are split across several modules:\n\n  * **tchdb.f90**: File-based hash database API.\n  * **tcmdb.f90**: On-memory hash database API.\n  * **tclist.f90**: Array List API.\n  * **tcmisc.f90**: Miscellaneous utilities API (date \u0026 time, MD5).\n  * **tcutil.f90**: Includes hack to access Tokyo Cabinet version number.\n\nTested with Tokyo Cabinet 1.4.48 on FreeBSD 12 with GNU Fortran 9, but should be\ncompatible to other Unix-like operating systems and Fortran 2008 compilers.\n\n### String Arguments\nIn some cases, convenience routines are used to add `c_null_char` to string\narguments automatically. Performance is therefore slightly decreased, as an\nadditional function call is necessary. To avoid these wrappers, affected\ninterfaces are exposed directly, with a trailing underscore in their name, but\nnull termination must be handled manually:\n\n```fortran\n! Calling the wrapper function that does null termination for us:\nerr = tc_hdb_put2(hdb, 'foo', 'bar')\n\n! Calling the interface directly:\nerr = tc_hdb_put2_(hdb, 'foo' // c_null_char, 'bar' // c_null_char)\n```\n\n## Build\nAt first, install Tokyo Cabinet. On FreeBSD, run:\n\n```\n# pkg install databases/tokyocabinet\n```\n\nDevelopment headers may be required on Linux. Then, compile the static library\n`libfortran-tcdb.a` with:\n\n```\n$ make static\n```\n\nMake sure that `PREFIX` points to the correct path. Link Tokyo Cabinet with\n`libfortran-tcdb.a` and `-ltokyocabinet -lz -lbz2 -lrt -lpthread -lm -lc`.\n\n## Example\n```fortran\n! example.f90\nprogram main\n    use, intrinsic :: iso_c_binding, only: c_ptr\n    use :: tchdb\n    implicit none\n    type(c_ptr)                   :: hdb\n    character(len=:), allocatable :: value\n    logical                       :: err\n\n    hdb = tc_hdb_new()\n    err = tc_hdb_open(hdb, 'casket.tch', ior(HDB_OWRITER, HDB_OCREAT))\n    err = tc_hdb_put2(hdb, 'foo', 'bar')\n\n    value = tc_hdb_get2(hdb, 'foo')\n    print '(2a)', 'value: ', value\n\n    err = tc_hdb_close(hdb)\n    call tc_hdb_del(hdb)\nend program main\n```\n\nCompile and run the example with:\n\n```\n$ gfortran -I/usr/local/include/ -L/usr/local/lib/ -o example example.f90 libfortran-tcdb.a -ltokyocabinet\n$ ./example\n```\n\n## Further Examples\nAdditional examples can be found in `examples/`:\n\n  * **hdb** opens a hash database and does read/write operations.\n  * **mdb** creates an on-memory hash database to store strings.\n  * **list** pushes strings to an array list.\n  * **tcv** prints the Tokyo Cabinet version number (in case you really need this info …).\n\nBuild them with:\n\n```\n$ make examples\n```\n\n## Coverage\n### Array List API\n| C Function Name   | Fortran Interface Name                    | Bound |\n|-------------------|-------------------------------------------|-------|\n| `tclistbsearch`   | `tc_list_bsearch`                         |   ✓   |\n| `tclistclear`     | `tc_list_clear`                           |   ✓   |\n| `tclistdel`       | `tc_list_del`                             |   ✓   |\n| `tclistdump`      | `tc_list_dump`                            |   ✓   |\n| `tclistdup`       | `tc_list_dup`                             |   ✓   |\n| `tclistinsert`    | `tc_list_insert`                          |   ✓   |\n| `tclistinsert2`   | `tc_list_insert2`, `tc_list_insert2_`     |   ✓   |\n| `tclistload`      | `tc_list_load`                            |   ✓   |\n| `tclistlsearch`   | `tc_list_lsearch`                         |   ✓   |\n| `tclistnew`       | `tc_list_new`                             |   ✓   |\n| `tclistnew2`      | `tc_list_new2`                            |   ✓   |\n| `tclistnew3`      |                                           |       |\n| `tclistnum`       | `tc_list_num`                             |   ✓   |\n| `tclistover`      | `tc_list_over`                            |   ✓   |\n| `tclistover2`     | `tc_list_over2`, `tc_list_over2_`         |   ✓   |\n| `tclistpop`       | `tc_list_pop`                             |   ✓   |\n| `tclistpop2`      | `tc_list_pop2`                            |   ✓   |\n| `tclistpush`      | `tc_list_push`                            |   ✓   |\n| `tclistpush2`     | `tc_list_push2`, `tc_list_push2_`         |   ✓   |\n| `tclistremove`    | `tc_list_remove`                          |   ✓   |\n| `tclistremove2`   | `tc_list_remove2`, `tc_list_remove2_`     |   ✓   |\n| `tclistshift`     | `tc_list_shift`                           |   ✓   |\n| `tclistshift2`    | `tc_list_shift2`, `tc_list_shift2_`       |   ✓   |\n| `tclistsort`      | `tc_list_sort`                            |   ✓   |\n| `tclistunshift`   | `tc_list_unshift`                         |   ✓   |\n| `tclistunshift2`  | `tc_list_unshift2`, `tc_list_unshift2_`   |   ✓   |\n| `tclistval`       | `tc_list_val`                             |   ✓   |\n| `tclistval2`      | `tc_list_val2`, `tc_list_val2_`           |   ✓   |\n\n### On-Memory Hash Database API\n| C Function Name   | Fortran Interface Name                    | Bound |\n|-------------------|-------------------------------------------|-------|\n| `tcmdbadddouble`  | `tc_mdb_add_double`                       |   ✓   |\n| `tcmdbaddint`     | `tc_mdb_add_int`                          |   ✓   |\n| `tcmdbcutfront`   | `tc_mdb_cut_front`                        |   ✓   |\n| `tcmdbdel`        | `tc_mdb_del`                              |   ✓   |\n| `tcmdbfwmkeys`    | `tc_mdb_fwm_keys`                         |   ✓   |\n| `tcmdbfwmkeys2`   | `tc_mdb_fwm_keys2`, `tc_mdb_fwm_keys2_`   |   ✓   |\n| `tcmdbget`        | `tc_mdb_get`                              |   ✓   |\n| `tcmdbget2`       | `tc_mdb_get2`, `tc_mdb_get2_`             |   ✓   |\n| `tcmdbiterinit`   | `tc_mdb_iter_init`                        |   ✓   |\n| `tcmdbiternext`   | `tc_mdb_iter_next`                        |   ✓   |\n| `tcmdbiternext2`  | `tc_mdb_iter_next2`                       |   ✓   |\n| `tcmdbmsiz`       | `tc_mdb_msiz`                             |   ✓   |\n| `tcmdbnew`        | `tc_mdb_new`                              |   ✓   |\n| `tcmdbnew2`       | `tc_mdb_new2`                             |   ✓   |\n| `tcmdbout`        | `tc_mdb_out`                              |   ✓   |\n| `tcmdbout2`       | `tc_mdb_out2`, `tc_mdb_out2_`             |   ✓   |\n| `tcmdbput`        | `tc_mdb_put`                              |   ✓   |\n| `tcmdbput2`       | `tc_mdb_put2`, `tc_mdb_put2_`             |   ✓   |\n| `tcmdbputcat`     | `tc_mdb_put_cat`                          |   ✓   |\n| `tcmdbputcat2`    | `tc_mdb_put_cat2`, `tc_mdb_put_cat2_`     |   ✓   |\n| `tcmdbputkeep`    | `tc_mdb_put_keep`                         |   ✓   |\n| `tcmdbputkeep2`   | `tc_mdb_put_keep2`, `tc_mdb_put_keep2_`   |   ✓   |\n| `tcmdbrnum`       | `tc_mdb_rnum`                             |   ✓   |\n| `tcmdbvanish`     | `tc_mdb_vanish`                           |   ✓   |\n| `tcmdbvsiz`       | `tc_mdb_vsiz`                             |   ✓   |\n| `tcmdbvsiz2`      | `tc_mdb_vsiz2`, `tc_mdb_vsiz2_`           |   ✓   |\n\n### Hash Database API\n| C Function Name   | Fortran Interface Name                    | Bound |\n|-------------------|-------------------------------------------|-------|\n| `tchdbadddouble`  | `tc_hdb_add_double`                       |   ✓   |\n| `tchdbaddint`     | `tc_hdb_add_int`                          |   ✓   |\n| `tchdbclose`      | `tc_hdb_close`                            |   ✓   |\n| `tchdbcopy`       | `tc_hdb_copy`, `tc_hdb_copy_`             |   ✓   |\n| `tchdbdel`        | `tc_hdb_del`                              |   ✓   |\n| `tchdbecode`      | `tc_hdb_ecode`                            |   ✓   |\n| `tchdberrmsg`     | `tc_hdb_err_msg`                          |   ✓   |\n| `tchdbfsiz`       | `tc_hdb_fsiz`                             |   ✓   |\n| `tchdbfwmkeys`    | `tc_hdb_fwm_keys`                         |   ✓   |\n| `tchdbfwmkeys2`   | `tc_hdb_fwm_keys2`, `tc_hdb_fwm_keys2_`   |   ✓   |\n| `tchdbget`        | `tc_hdb_get`                              |   ✓   |\n| `tchdbget2`       | `tc_hdb_get2`, `tc_hdb_get2_`             |   ✓   |\n| `tchdbget3`       | `tc_hdb_get3`                             |   ✓   |\n| `tchdbiterinit`   | `tc_hdb_iter_init`                        |   ✓   |\n| `tchdbiternext`   | `tc_hdb_iter_next`                        |   ✓   |\n| `tchdbiternext2`  | `tc_hdb_iter_next2`                       |   ✓   |\n| `tchdbiternext3`  | `tc_hdb_iter_next3`                       |   ✓   |\n| `tchdbnew`        | `tc_hdb_new`                              |   ✓   |\n| `tchdbopen`       | `tc_hdb_open`, `tc_hdb_open_`             |   ✓   |\n| `tchdboptimize`   | `tc_hdb_optimize`                         |   ✓   |\n| `tchdbout`        | `tc_hdb_out`                              |   ✓   |\n| `tchdbout2`       | `tc_hdb_out2`, `tc_hdb_out2_`             |   ✓   |\n| `tchdbpath`       | `tc_hdb_path`                             |   ✓   |\n| `tchdbput`        | `tc_hdb_put`                              |   ✓   |\n| `tchdbput2`       | `tc_hdb_put2`, `tc_hdb_put2_`             |   ✓   |\n| `tchdbputasync`   | `tc_hdb_put_async`                        |   ✓   |\n| `tchdbputasync2`  | `tc_hdb_put_async2`, `tc_hdb_put_async2_` |   ✓   |\n| `tchdbputcat`     | `tc_hdb_put_cat`                          |   ✓   |\n| `tchdbputcat2`    | `tc_hdb_put_cat2`, `tc_hdb_put_cat2_`     |   ✓   |\n| `tchdbputkeep`    | `tc_hdb_put_keep`                         |   ✓   |\n| `tchdbputkeep2`   | `tc_hdb_put_keep2`, `tc_hdb_put_keep2_`   |   ✓   |\n| `tchdbrnum`       | `tc_hdb_rnum`                             |   ✓   |\n| `tchdbsetdfunit`  | `tc_hdb_set_dfunit`                       |   ✓   |\n| `tchdbsetcache`   | `tc_hdb_set_cache`                        |   ✓   |\n| `tchdbsetmutex`   | `tc_hdb_set_mutex`                        |   ✓   |\n| `tchdbsetxmsiz`   | `tc_hdb_set_xmsiz`                        |   ✓   |\n| `tchdbsync`       | `tc_hdb_sync`                             |   ✓   |\n| `tchdbtranabort`  | `tc_hdb_tran_abort`                       |   ✓   |\n| `tchdbtranbegin`  | `tc_hdb_tran_begin`                       |   ✓   |\n| `tchdbtrancommit` | `tc_hdb_tran_commit`                      |   ✓   |\n| `tchdbtune`       | `tc_hdb_tune`                             |   ✓   |\n| `tchdbvanish`     | `tc_hdb_vanish`                           |   ✓   |\n| `tchdbvsiz`       | `tc_hdb_vsiz`                             |   ✓   |\n| `tchdbvsiz2`      | `tc_hdb_vsiz2`, `tc_hdb_vsiz2_`           |   ✓   |\n\n### Basic Utilities API\n| C Variable Name   | Fortran Interface Name                    | Bound |\n|-------------------|-------------------------------------------|-------|\n| `*tcversion`      | `tc_version`                              |   ✓   |\n\n### Miscellaneous Utilities API\n| C Function Name   | Fortran Interface Name                    | Bound |\n|-------------------|-------------------------------------------|-------|\n| `tcdatestrwww`    | `tc_date_str_www`                         |   ✓   |\n| `tcmd5hash`       | `tc_md5_hash`                             |   ✓   |\n| `tcstrmktime`     | `tc_str_mk_time`                          |   ✓   |\n\n## Licence\nISC\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finterkosmos%2Ffortran-tcdb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finterkosmos%2Ffortran-tcdb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finterkosmos%2Ffortran-tcdb/lists"}