summaryrefslogtreecommitdiffstats
path: root/nserver
Commit message (Collapse)AuthorAgeFilesLines
* nserver: Update mk_datumrsiddharth2020-04-171-1/+1
| | | | | * nserver/src/db.c (mk_datum): Set datum's dsize to exactly the length of the data.
* nserver: ncmd.h: Add NS_STORE.rsiddharth2020-04-173-0/+61
| | | | | | | | | * nserver/src/ncmd.c (find_function): Add handling to find NS_STORE. (call_function): Add handling for NS_STORE. * nserver/src/ncmd.h (FUNCTIONS): Add NS_STORE * nserver/tests/ncmd_tests.c (test_find_function) (test_call_function, test_process): Update tests to check the correctness of NS_STORE.
* nserver: Add ssload.rsiddharth2020-04-173-0/+58
| | | | | | * nserver/src/protocol.c (ssload): New function definition. * nserver/src/protocol.h (ssload): New function declaration. * nserver/tests/protocol_tests.c (test_ssload): New test.
* nserver: Update ssdump.rsiddharth2020-04-171-1/+1
| | | | * nserver/src/protocol.c (ssdump): Fix key strlen check.
* nserver: Update test_ssdelete.rsiddharth2020-04-171-1/+1
| | | | * nserver/tests/protocol_tests.c (test_ssdelete): Fix test.
* nserver: Add ssstore.rsiddharth2020-04-173-0/+39
| | | | | | * nserver/src/protocol.c (ssstore): New function definition. * nserver/src/protocol.h (ssstore): New function declaration. * nserver/tests/protocol_tests.c (test_ssstore): New test.
* nserver: Add db_load.rsiddharth2020-04-173-3/+55
| | | | | | * nserver/src/db.c (db_load): New function definition. * nserver/src/db.h (db_load): New function declaration. * nserver/tests/db_tests.c (test_db_load): New test.
* nserver: Add db_store.rsiddharth2020-04-173-0/+65
| | | | | | * nserver/src/db.c (db_store): New function definition. * nserver/src/db.h (db_store): New function declaration. * nserver/tests/db_tests.c (test_db_store): New test.
* nserver/src/db.c: Add mk_datum.rsiddharth2020-04-171-1/+22
| | | | * nserver/src/db.c (mk_datum): New function.
* nserver: Update db_init.rsiddharth2020-04-171-2/+6
| | | | | * nserver/src/db.c (db_open): New function. (db_init): Use db_open to get GDBM_FILE.
* nserver: Add Stats_unstringify.rsiddharth2020-04-173-4/+65
| | | | | | | | | | * nserver/src/stats.c (Stats_unstringify): New function definition. * nserver/src/stats.h (Stats_unstringify): New function declaration. * nserver/tests/stats_tests.c (tests_stats_unstringify): Test for Stats_unstringify. (tests_stats_unstringify): st_str is now a static variable. Don't free it; it's done in tests_stats_unstringify. (st_str): New static variable.
* nserver: Update Stats_stringify.rsiddharth2020-04-172-2/+2
| | | | | * nserver/src/stats.c (Stats_stringify): Change format of stringified Stats. * nserver/tests/stats_tests.c (test_stats_stringify): Update test.
* nserver: Add Stats_stringify.rsiddharth2020-04-173-0/+69
| | | | | | | * nserver/src/stats.c (Stats_stringify): New function definition. * nserver/src/stats.h (Stats_stringify): New function declaration. * nserver/tests/stats_tests.c (test_tests_stringify): Test for Stats_stringify.
* nserver: Add db.hrsiddharth2020-04-175-2/+56
| | | | | | | | | | * nserver/.gitignore: Add nserver.db * nserver/Makefile ($(PROGRAMS)) (tests): Link gdbm. (clean): Remove nserver.db * nserver/src/db.c (db_init): New function. * nserver/src/db.h (db_init): New function declaration. * nserver/tests/db_tests.c: Tests for db.h
* nserver/Makefile: Update clean.rsiddharth2020-04-171-1/+1
|
* nserver/Makefile: Update CFLAGS.rsiddharth2020-04-171-2/+2
| | | | Include /usr/local/include.
* nserver: Update call_function.rsiddharth2020-04-171-1/+1
| | | | Update sscreate error check.
* nserver: Update ssmean.rsiddharth2020-04-171-1/+1
|
* nserver/tests: Update protocol_tests.c.rsiddharth2020-04-171-6/+36
| | | | | * nserver/tests/protocol_tests.c (test_sscreate) (test_sssample, test_ssmean, test_ssdump): Add delete flag test.
* nserver/src/protocol.c: Update ssdelete.rsiddharth2020-04-171-0/+7
| | | | | | * nserver/src/protocol.c (ssdelete): Clear Stats record. (sscreate): Allocated fresh Stats record for deleted key that's added back again.
* nserver: Update sscreate.rsiddharth2020-04-171-1/+1
| | | | * nserver/src/protocol.c (sscreate) Fix typo.
* nserver/src/protocol.c: Add "deleted" flag handling.rsiddharth2020-04-171-0/+9
| | | | | | * nserver/src/protocol.c (sssample_parent, sssample) (ssmean, ssdump, traverse_tree): Add check to see if record was deleted.
* nserver/src/protocol.c: Update ssdelete.rsiddharth2020-04-171-1/+1
| | | | Use TSTree_search.
* nserver/src/protocol.c: Updat ssdelete.rsiddharth2020-04-172-21/+12
| | | | | | * nserver/src/protocol.c (ssdelete): Refactor to use TSTree. (hash): Remove static variable. No longer used. * nserver/tests/protocol_tests.c (all_tests): Uncomment test_ssdelete.
* nserver: Refactor sslist.rsiddharth2020-04-172-30/+29
| | | | | * nserver/src/protocol.c (sslist): Refactor sslist to use TSTree. * nserver/tests/protocol_tests.c (test_sslist): Update test.
* nserver/src/protocol.c: Refactor ssdump.rsiddharth2020-04-172-10/+10
| | | | | * nserver/src/protocol.c (ssdump): Refactor function to use TSTree. * server/tests/protocol_tests.c (test_ssdump): Updat test.
* nserver: Update ssmean.rsiddharth2020-04-172-10/+10
| | | | | | * nserver/src/protocol.c (ssmean): Rewrite to use TSTree instead of Hashmap. * nserver/tests/protocol_tests.c (test_ssmean): Update test.
* nserver/src/protocol.c: ssample_parent -> sssample_parent.rsiddharth2020-04-171-2/+2
| | | | | | * nserver/src/protocol.c (ssample_parent): Rename to... (sssample_parent): ...this. (sssample): Update function.
* nserver/src/protocol.c: Update sssample.rsiddharth2020-04-172-1/+14
| | | | | | * nserver/src/protocol.c (sssample): Call ssample_parent on key. * nserver/tests/protocol_tests.c (test_sscreate, test_sssample): Update tests to test ssample_parent.
* nserver/src/protocol.c: Add ssample_parent.rsiddharth2020-04-171-0/+22
| | | | * nserver/src/protocol.c (ssample_parent): New function.
* nserver/src/tstree.c: Update TSTree_search_prefix.rsiddharth2020-04-171-12/+4
|
* nserver/tests/protocol_tests.c;: Updat test_sscreate.rsiddharth2020-04-171-1/+4
| | | | * nserver/tests/protocol_tests.c (test_sscreate): Update test.
* nserver/src/protocol.c: Update ssample.rsiddharth2020-04-172-14/+13
| | | | | * nserver/src/protocol.c (ssample): Refactor to use TSTree. * nserver/tests/protocol_tests.c (test_ssample): Update test.
* nserver/src/protocol.c: Refactor sscreate.rsiddharth2020-04-171-18/+28
| | | | | * nserver/src/protocol.c (ssinit): Remove function. (sscreate): Refactor to use TSTree instead of Hashmap.
* nserver/src/protocol.h: Include tstree.h.rsiddharth2020-04-171-0/+1
|
* nserver/src/protocol.h: Add Record.rsiddharth2020-04-171-0/+6
|
* nserver: Add tstree.hrsiddharth2020-04-172-0/+287
|
* nserver: ncmd.c: Update call_function.rsiddharth2020-04-172-7/+12
| | | | | | | * nserver/src/ncmd.c (call_function): Update sssample handling; now returns mean on success. * nserver/tests/ncmd_tests.c (test_call_function) (test_process): Update tests.
* nserver: protocol.h: Update sssample.rsiddharth2020-04-173-18/+21
| | | | | | | * nserver/src/protocol.c (sssample): Return mean on success. * nserver/src/protocol.h (sssample): Change return data type to double. * nserver/tests/protocol_tests.c (test_sssample): Update test.
* nserver/src/nserve.c: Update nserve.rsiddharth2020-04-171-9/+5
| | | | | * nserver/src/nserve.c (nserve): Use `process` to do the actual thing instead of just barfing out the cmd.
* nserver/src/ncmd.c: Update process.rsiddharth2020-04-171-1/+6
| | | | * nserver/src/ncmd.c (process): Add cmd check via check_cmd.
* nserver: Update nserve.rsiddharth2020-04-171-9/+11
| | | | | * nserver/src/nserve.c (nserve): Update check_cmd handling; Update cmd initialization.
* nserver: Update check_cmd.rsiddharth2020-04-173-22/+25
| | | | | | * nserver/src/ncmd.c (check_cmd): Add argument err. * nserver/src/ncmd.h (check_cmd): Update function declaration. * nserver/tests/ncmd_tests.c (test_check_cmd): Update test.
* nserver: Flesh out process.rsiddharth2020-04-173-8/+63
| | | | | | | * nserver/src/ncmd.c (process): Initial version. * nserver/src/ncmd.h (process): Update declaration. * nserver/tests/ncmd_tests.c (test_process): Test for process. (all_tests): Add test_process.
* nserver: ncmd_tests.c: Update test_call_function.rsiddharth2020-04-171-0/+15
| | | | | * nserver/tests/ncmd_tests.c (test_call_function): Delete ham and beef too.
* nserver: Update call_function.rsiddharth2020-04-173-66/+103
| | | | | | | | | * nserver/src/ncmd.c (call_function): Add arg out. Return integer. (process): Skeleton commented out. * nserver/src/ncmd.h (call_function): Update function declaration. (process): New function declaration. * nserver/tests/ncmd_tests.c (test_call_function): Update test.
* nserver: Update call_function.rsiddharth2020-04-172-27/+47
| | | | | | * nserver/src/ncmd.c (call_function): Dynmically allocate space for msg. * nserver/tests/ncmd_tests.c (test_call_function): Updat test.
* nserver: Update find_function.rsiddharth2020-04-171-12/+0
| | | | | * nserver/src/ncmd.c (find_function): Remove qty checks. Done by call_function.
* nserver: Add call_function.rsiddharth2020-04-173-0/+169
| | | | | | | | | * nserver/src/ncmd.c (call_function): New function definition. Initial version. * nserver/src/ncmd.h (call_function): New function declaration. * nserver/tests/ncmd_tests.c (test_call_function): Test for call_function. (all_tests): Add test_call_function.
* nserver: Update Stats_dump.rsiddharth2020-04-171-1/+1
| | | | * nserver/src/stats.c (Stats_dump): Add newline to dstr.