| 1 | PROJECT arboo_server |
|---|
| 2 | OBJECT_KEY AN, # MAIN PREFIX |
|---|
| 3 | MAX_KEY 21, # MAX NUMBER OF AN ATTRIBUTE |
|---|
| 4 | MAX_OBJECT 4, # MAX DIFFERENT USER STRUCTURES |
|---|
| 5 | MAX_STRING_LEN 1024, |
|---|
| 6 | MAX_PAR_CNT 16, |
|---|
| 7 | MAGIC_NUMBER 0x414e53, # MAGIC_NUMBER 6 HEX DIGITS (see AISC/magic.lst@NAMESERVER) |
|---|
| 8 | |
|---|
| 9 | |
|---|
| 10 | SERVER_INCLUDES (~ |
|---|
| 11 | #include <stdio.h> |
|---|
| 12 | #include <aisc.h> |
|---|
| 13 | #include <aisc_com.h>~) |
|---|
| 14 | INCLUDE_INCLUDES (~$$(#FILE aisc_include.header)~) |
|---|
| 15 | |
|---|
| 16 | DATA { |
|---|
| 17 | |
|---|
| 18 | # ********************************* USER DATA ******************************************* |
|---|
| 19 | |
|---|
| 20 | # ******************************* PRIVAT STRUCTURES: DO NOT CHANGE ********************************* |
|---|
| 21 | |
|---|
| 22 | @STRUCT, @SKEY, @SKEYC, @SDOCU; |
|---|
| 23 | |
|---|
| 24 | dll_public, , , (~parent of dll (=DoubledLinkedList)~), { |
|---|
| 25 | @TYPE, @IDENT, @REF, @ACC, @SAVE, @KEY, @KEYC, @INIT, @DOCU; |
|---|
| 26 | t_key, key, t, r, , , , , (~The key~); |
|---|
| 27 | int, cnt, t, r, , CNT, 0, , (~Number of elements~); |
|---|
| 28 | long, hash, t, , , , , , (~Hash Table~); |
|---|
| 29 | dllheader_ext, parent, flt, r, , PARENT, 1, , (~My Owner~); |
|---|
| 30 | dllheader_ext, last, flt, r, , LAST, 2, , (~Pointer to the last element~); |
|---|
| 31 | }; |
|---|
| 32 | |
|---|
| 33 | |
|---|
| 34 | dll_header, COMMON, 0, (~link header (should be head of each function)~), { |
|---|
| 35 | @TYPE, @IDENT, @REF, @ACC, @SAVE, @KEY, @KEYC, @INIT, @DOCU; |
|---|
| 36 | t_key, key, t, r, , KEY, 0, , (~The Key~); |
|---|
| 37 | aisc_string, aisc_get_keystring, %, r, , KEYSTRING, 1, , (~THE STRING of the KEY~); |
|---|
| 38 | dll_public, parent, ls, r, , (~~), 2, , (~Pointer to dll_public~); |
|---|
| 39 | aisc_string, ident, t, , 1, IDENT, 5, , (~The ident [not necessary]~); |
|---|
| 40 | }; |
|---|
| 41 | |
|---|
| 42 | |
|---|
| 43 | # ********************************* USER STRUCTURES ******************************************* |
|---|
| 44 | |
|---|
| 45 | AN_revers, REVERS, 4, (~revers mapping for shorts~), { |
|---|
| 46 | @TYPE, @IDENT, @REF, @ACC, @SAVE, @KEY, @KEYC, @INIT, @DOCU; |
|---|
| 47 | dllh, mh, t, , , (~~), 0, , (~Header~); |
|---|
| 48 | aisc_string, full_name, t, rw, , , , , (~the full name of a species~); |
|---|
| 49 | aisc_string, acc, t, rw, , , , , (~accession number~); |
|---|
| 50 | aisc_string, add_id, t, rw, , , , , (~additional id data~); |
|---|
| 51 | }; |
|---|
| 52 | |
|---|
| 53 | AN_shorts, SHORTS, 3, (~a dictionary~), SAVEDIRECTION HORIZONTAL, { |
|---|
| 54 | @TYPE, @IDENT, @REF, @ACC, @SAVE, @KEY, @KEYC, @INIT, @DOCU; |
|---|
| 55 | dllh, mh, t, , 1, (~~), 0, , (~Header~); |
|---|
| 56 | aisc_string, full_name, t, r, 1, FULL_NAME, 8, , (~the full name of a species~); |
|---|
| 57 | aisc_string, acc, t, r, 1, ACC, 9, , (~accession number~); |
|---|
| 58 | aisc_string, add_id, t, r, 1, ADDID, 10, , (~additional id data~); |
|---|
| 59 | aisc_string, shrt, t, r, 1, SHORT, 11, , (~The Short~); |
|---|
| 60 | }; |
|---|
| 61 | |
|---|
| 62 | |
|---|
| 63 | # called from code using id AN_LOCAL |
|---|
| 64 | # single functions: LOCAL_GET_SHORT LOCAL_DEL_SHORT |
|---|
| 65 | |
|---|
| 66 | AN_local, LOCAL, 2, (~local communication buffer~), { |
|---|
| 67 | @TYPE, @IDENT, @REF, @ACC, @SAVE, @KEY, @KEYC, @INIT, @DOCU; |
|---|
| 68 | dllh, mh, t, , , (~~), 0, , (~Header~); |
|---|
| 69 | int, socket, t, , , , , names_init_socket(THIS), (~the callback~), DESTROY names_destroy_socket(THIS); |
|---|
| 70 | aisc_string, whoami, t, , , WHOAMI, 8, , (~who am i~); |
|---|
| 71 | aisc_string, full_name, t, rw, , FULL_NAME, 9, "", (~the full name of a species~); |
|---|
| 72 | aisc_string, acc, t, rw, , ACCESSION, 10, "", (~accession number~); |
|---|
| 73 | aisc_string, add_id, t, rw, , ADDID, 11, "", (~additional id data~); |
|---|
| 74 | aisc_string, advice, t, rw, , ADVICE, 13, "", (~advice for the short name~); |
|---|
| 75 | aisc_string, get_short, %, r, , GET_SHORT, 14, , (~get a short name~); |
|---|
| 76 | int, del_short, %, r, , DEL_SHORT, 15, , (~forget stored short name~); |
|---|
| 77 | }; |
|---|
| 78 | |
|---|
| 79 | |
|---|
| 80 | # called from code using id AN_MAIN |
|---|
| 81 | # single functions: MAIN_SHUTDOWN MAIN_SAVEALL |
|---|
| 82 | |
|---|
| 83 | AN_main, MAIN, 1, (~global data~), SAVEDIRECTION VERTICAL, { |
|---|
| 84 | @TYPE, @IDENT, @REF, @ACC, @SAVE, @KEY, @KEYC, @INIT, @DOCU; |
|---|
| 85 | t_key, key, t, n, , , , , (~the KEY~); |
|---|
| 86 | AN_local, loc_st, d, , , LOCAL, 8, , (~the parameters~); |
|---|
| 87 | AN_shorts, shorts1, d, r, 1, SHORTS1, 10, , (~the unique letters for a word~); |
|---|
| 88 | AN_shorts, names, d, r, 1, NAMES, 12, , (~the unique names first*second*S*accession~); |
|---|
| 89 | AN_revers, revers, d, r, , , , , (~the revers unique names first*second*S*accession~); |
|---|
| 90 | int, touched, t, r, , TOUCHED, 14, 0, (~does the database need to be saved?~); |
|---|
| 91 | aisc_string, server_shutdown, %, w, , SHUTDOWN, 15, , (~SHUTDOWN command~); |
|---|
| 92 | int, server_save, %, w, , SAVEALL, 16, , (~SAVE everything~); |
|---|
| 93 | aisc_string, server_file, t, r, , FILENAME, 17, , (~The filename of the keys~); |
|---|
| 94 | int, server_filedate, t, , , FILEDATE, 18, , (~The filedate of server_file~); |
|---|
| 95 | int, dbversion, t, , 1, DBVERSION, 19, 4, (~Nameserver database version~); |
|---|
| 96 | aisc_string, add_field, t, r, 1, ADD_FIELD, 20, , (~additional field used for identification~); |
|---|
| 97 | aisc_string, add_field_default, t, r, 1, AF_DEFAULT, 21, , (~default value for add_field, if field is missing~); |
|---|
| 98 | long, prefix_hash, t, , , , , 0, (~prefix hash table~) |
|---|
| 99 | }; |
|---|
| 100 | }; |
|---|