From 4fe567d9d94b9159254a2f2cce64855a794d9699 Mon Sep 17 00:00:00 2001 From: Martin Schanzenbach Date: Tue, 2 Aug 2022 17:25:41 +0200 Subject: DOC: Move from texinfo to sphinx --- doc/tutorial/examples/001.c | 29 ---------- doc/tutorial/examples/002.c | 17 ------ doc/tutorial/examples/003.c | 11 ---- doc/tutorial/examples/004.c | 5 -- doc/tutorial/examples/005.c | 9 ---- doc/tutorial/examples/006.c | 31 ----------- doc/tutorial/examples/007.c | 10 ---- doc/tutorial/examples/008.c | 22 -------- doc/tutorial/examples/009.c | 9 ---- doc/tutorial/examples/010.c | 8 --- doc/tutorial/examples/011.c | 8 --- doc/tutorial/examples/012.c | 4 -- doc/tutorial/examples/013.1.c | 3 -- doc/tutorial/examples/013.c | 12 ----- doc/tutorial/examples/014.c | 8 --- doc/tutorial/examples/015.c | 8 --- doc/tutorial/examples/016.c | 4 -- doc/tutorial/examples/017.c | 4 -- doc/tutorial/examples/018.c | 2 - doc/tutorial/examples/019.c | 18 ------- doc/tutorial/examples/020.c | 25 --------- doc/tutorial/examples/021.c | 13 ----- doc/tutorial/examples/022.c | 8 --- doc/tutorial/examples/023.c | 17 ------ doc/tutorial/examples/024.c | 9 ---- doc/tutorial/examples/025.Makefile.am | 15 ------ doc/tutorial/examples/026.c | 52 ------------------ doc/tutorial/examples/testbed_test.c | 99 ----------------------------------- 28 files changed, 460 deletions(-) delete mode 100644 doc/tutorial/examples/001.c delete mode 100644 doc/tutorial/examples/002.c delete mode 100644 doc/tutorial/examples/003.c delete mode 100644 doc/tutorial/examples/004.c delete mode 100644 doc/tutorial/examples/005.c delete mode 100644 doc/tutorial/examples/006.c delete mode 100644 doc/tutorial/examples/007.c delete mode 100644 doc/tutorial/examples/008.c delete mode 100644 doc/tutorial/examples/009.c delete mode 100644 doc/tutorial/examples/010.c delete mode 100644 doc/tutorial/examples/011.c delete mode 100644 doc/tutorial/examples/012.c delete mode 100644 doc/tutorial/examples/013.1.c delete mode 100644 doc/tutorial/examples/013.c delete mode 100644 doc/tutorial/examples/014.c delete mode 100644 doc/tutorial/examples/015.c delete mode 100644 doc/tutorial/examples/016.c delete mode 100644 doc/tutorial/examples/017.c delete mode 100644 doc/tutorial/examples/018.c delete mode 100644 doc/tutorial/examples/019.c delete mode 100644 doc/tutorial/examples/020.c delete mode 100644 doc/tutorial/examples/021.c delete mode 100644 doc/tutorial/examples/022.c delete mode 100644 doc/tutorial/examples/023.c delete mode 100644 doc/tutorial/examples/024.c delete mode 100644 doc/tutorial/examples/025.Makefile.am delete mode 100644 doc/tutorial/examples/026.c delete mode 100644 doc/tutorial/examples/testbed_test.c (limited to 'doc/tutorial/examples') diff --git a/doc/tutorial/examples/001.c b/doc/tutorial/examples/001.c deleted file mode 100644 index 7f6699dd2..000000000 --- a/doc/tutorial/examples/001.c +++ /dev/null @@ -1,29 +0,0 @@ -#include -#include - -static int ret; - -static void -run (void *cls, - char *const *args, - const char *cfgfile, - const struct GNUNET_CONFIGURATION_Handle *cfg) -{ - // main code here - ret = 0; -} - -int -main (int argc, char *const *argv) -{ - struct GNUNET_GETOPT_CommandLineOption options[] = { - GNUNET_GETOPT_OPTION_END - }; - return (GNUNET_OK == - GNUNET_PROGRAM_run (argc, - argv, - "binary-name", - gettext_noop ("binary description text"), - options, &run, NULL)) ? ret : 1; -} - diff --git a/doc/tutorial/examples/002.c b/doc/tutorial/examples/002.c deleted file mode 100644 index 02233fd61..000000000 --- a/doc/tutorial/examples/002.c +++ /dev/null @@ -1,17 +0,0 @@ -static char *string_option; -static int a_flag; - -// ... - struct GNUNET_GETOPT_CommandLineOption options[] = { - GNUNET_GETOPT_option_string ('s', "name", "SOMESTRING", - gettext_noop ("text describing the string_option NAME"), - &string_option}, - GNUNET_GETOPT_option_flag ('f', "flag", - gettext_noop ("text describing the flag option"), - &a_flag), - GNUNET_GETOPT_OPTION_END - }; - string_option = NULL; - a_flag = GNUNET_SYSERR; -// ... - diff --git a/doc/tutorial/examples/003.c b/doc/tutorial/examples/003.c deleted file mode 100644 index d158d7e75..000000000 --- a/doc/tutorial/examples/003.c +++ /dev/null @@ -1,11 +0,0 @@ -struct GNUNET_MQ_MessageHandlers handlers[] = { - // ... - GNUNET_MQ_handler_end () -}; -struct GNUNET_MQ_Handle *mq; - -mq = GNUNET_CLIENT_connect (cfg, - "service-name", - handlers, - &error_cb, - NULL); diff --git a/doc/tutorial/examples/004.c b/doc/tutorial/examples/004.c deleted file mode 100644 index 0ef007907..000000000 --- a/doc/tutorial/examples/004.c +++ /dev/null @@ -1,5 +0,0 @@ -struct GNUNET_MessageHeader -{ - uint16_t size GNUNET_PACKED; - uint16_t type GNUNET_PACKED; -}; diff --git a/doc/tutorial/examples/005.c b/doc/tutorial/examples/005.c deleted file mode 100644 index 1b59f85a6..000000000 --- a/doc/tutorial/examples/005.c +++ /dev/null @@ -1,9 +0,0 @@ -struct GNUNET_MQ_Envelope *env; -struct GNUNET_MessageHeader *msg; - -env = GNUNET_MQ_msg_extra (msg, payload_size, GNUNET_MY_MESSAGE_TYPE); -GNUNET_memcpy (&msg[1], - &payload, - payload_size); -// Send message via message queue 'mq' -GNUNET_mq_send (mq, env); diff --git a/doc/tutorial/examples/006.c b/doc/tutorial/examples/006.c deleted file mode 100644 index 944d2b18c..000000000 --- a/doc/tutorial/examples/006.c +++ /dev/null @@ -1,31 +0,0 @@ -static void -handle_fix (void *cls, const struct MyMessage *msg) -{ - // process 'msg' -} - -static int -check_var (void *cls, const struct MyVarMessage *msg) -{ - // check 'msg' is well-formed - return GNUNET_OK; -} - -static void -handle_var (void *cls, const struct MyVarMessage *msg) -{ - // process 'msg' -} - -struct GNUNET_MQ_MessageHandler handlers[] = { - GNUNET_MQ_hd_fixed_size (fix, - GNUNET_MESSAGE_TYPE_MY_FIX, - struct MyMessage, - NULL), - GNUNET_MQ_hd_fixed_size (var, - GNUNET_MESSAGE_TYPE_MY_VAR, - struct MyVarMessage, - NULL), - - GNUNET_MQ_handler_end () -}; diff --git a/doc/tutorial/examples/007.c b/doc/tutorial/examples/007.c deleted file mode 100644 index 096539e43..000000000 --- a/doc/tutorial/examples/007.c +++ /dev/null @@ -1,10 +0,0 @@ -GNUNET_SERVICE_MAIN -("service-name", - GNUNET_SERVICE_OPTION_NONE, - &run, - &client_connect_cb, - &client_disconnect_cb, - NULL, - GNUNET_MQ_hd_fixed_size (...), - GNUNET_MQ_hd_var_size (...), - GNUNET_MQ_handler_end ()); diff --git a/doc/tutorial/examples/008.c b/doc/tutorial/examples/008.c deleted file mode 100644 index 2dffe2cf9..000000000 --- a/doc/tutorial/examples/008.c +++ /dev/null @@ -1,22 +0,0 @@ -static void -run (void *cls, - const struct GNUNET_CONFIGURATION_Handle *c, - struct GNUNET_SERVICE_Handle *service) -{ -} - -static void * -client_connect_cb (void *cls, - struct GNUNET_SERVICE_Client *c, - struct GNUNET_MQ_Handle *mq) -{ - return c; -} - -static void -client_disconnect_cb (void *cls, - struct GNUNET_SERVICE_Client *c, - void *internal_cls) -{ - GNUNET_assert (c == internal_cls); -} diff --git a/doc/tutorial/examples/009.c b/doc/tutorial/examples/009.c deleted file mode 100644 index 26d918fb0..000000000 --- a/doc/tutorial/examples/009.c +++ /dev/null @@ -1,9 +0,0 @@ -#include - -struct GNUNET_CORE_Handle * -GNUNET_CORE_connect (const struct GNUNET_CONFIGURATION_Handle *cfg, - void *cls, - GNUNET_CORE_StartupCallback init, - GNUNET_CORE_ConnectEventHandler connects, - GNUNET_CORE_DisconnectEventHandler disconnects, - const struct GNUNET_MQ_MessageHandler *handlers); diff --git a/doc/tutorial/examples/010.c b/doc/tutorial/examples/010.c deleted file mode 100644 index 33494490d..000000000 --- a/doc/tutorial/examples/010.c +++ /dev/null @@ -1,8 +0,0 @@ -void * -connects (void *cls, - const struct GNUNET_PeerIdentity *peer, - struct GNUNET_MQ_Handle *mq) -{ - return mq; -} - diff --git a/doc/tutorial/examples/011.c b/doc/tutorial/examples/011.c deleted file mode 100644 index 23bc051de..000000000 --- a/doc/tutorial/examples/011.c +++ /dev/null @@ -1,8 +0,0 @@ -void -disconnects (void *cls, - const struct GNUNET_PeerIdentity * peer) -{ - /* Remove peer's identity from known peers */ - /* Make sure no messages are sent to peer from now on */ -} - diff --git a/doc/tutorial/examples/012.c b/doc/tutorial/examples/012.c deleted file mode 100644 index cb21d78ab..000000000 --- a/doc/tutorial/examples/012.c +++ /dev/null @@ -1,4 +0,0 @@ -#include "gnunet_peerstore_service.h" - -peerstore_handle = GNUNET_PEERSTORE_connect (cfg); - diff --git a/doc/tutorial/examples/013.1.c b/doc/tutorial/examples/013.1.c deleted file mode 100644 index fa5212868..000000000 --- a/doc/tutorial/examples/013.1.c +++ /dev/null @@ -1,3 +0,0 @@ -void -GNUNET_PEERSTORE_store_cancel (struct GNUNET_PEERSTORE_StoreContext - *sc); diff --git a/doc/tutorial/examples/013.c b/doc/tutorial/examples/013.c deleted file mode 100644 index 6792417e1..000000000 --- a/doc/tutorial/examples/013.c +++ /dev/null @@ -1,12 +0,0 @@ -struct GNUNET_PEERSTORE_StoreContext * -GNUNET_PEERSTORE_store (struct GNUNET_PEERSTORE_Handle *h, - const char *sub_system, - const struct GNUNET_PeerIdentity *peer, - const char *key, - const void *value, - size_t size, - struct GNUNET_TIME_Absolute expiry, - enum GNUNET_PEERSTORE_StoreOption options, - GNUNET_PEERSTORE_Continuation cont, - void *cont_cls); - diff --git a/doc/tutorial/examples/014.c b/doc/tutorial/examples/014.c deleted file mode 100644 index db2ed1165..000000000 --- a/doc/tutorial/examples/014.c +++ /dev/null @@ -1,8 +0,0 @@ -struct GNUNET_PEERSTORE_IterateContext * -GNUNET_PEERSTORE_iterate (struct GNUNET_PEERSTORE_Handle *h, - const char *sub_system, - const struct GNUNET_PeerIdentity *peer, - const char *key, - GNUNET_PEERSTORE_Processor callback, - void *callback_cls); - diff --git a/doc/tutorial/examples/015.c b/doc/tutorial/examples/015.c deleted file mode 100644 index 0dd267e8e..000000000 --- a/doc/tutorial/examples/015.c +++ /dev/null @@ -1,8 +0,0 @@ -struct GNUNET_PEERSTORE_WatchContext * -GNUNET_PEERSTORE_watch (struct GNUNET_PEERSTORE_Handle *h, - const char *sub_system, - const struct GNUNET_PeerIdentity *peer, - const char *key, - GNUNET_PEERSTORE_Processor callback, - void *callback_cls); - diff --git a/doc/tutorial/examples/016.c b/doc/tutorial/examples/016.c deleted file mode 100644 index d169da16d..000000000 --- a/doc/tutorial/examples/016.c +++ /dev/null @@ -1,4 +0,0 @@ -void -GNUNET_PEERSTORE_watch_cancel (struct GNUNET_PEERSTORE_WatchContext - *wc); - diff --git a/doc/tutorial/examples/017.c b/doc/tutorial/examples/017.c deleted file mode 100644 index c86fbcd1f..000000000 --- a/doc/tutorial/examples/017.c +++ /dev/null @@ -1,4 +0,0 @@ -void -GNUNET_PEERSTORE_disconnect (struct GNUNET_PEERSTORE_Handle *h, - int sync_first); - diff --git a/doc/tutorial/examples/018.c b/doc/tutorial/examples/018.c deleted file mode 100644 index 3fc22584c..000000000 --- a/doc/tutorial/examples/018.c +++ /dev/null @@ -1,2 +0,0 @@ -dht_handle = GNUNET_DHT_connect (cfg, parallel_requests); - diff --git a/doc/tutorial/examples/019.c b/doc/tutorial/examples/019.c deleted file mode 100644 index aaf001516..000000000 --- a/doc/tutorial/examples/019.c +++ /dev/null @@ -1,18 +0,0 @@ -message_sent_cont (void *cls, - const struct GNUNET_SCHEDULER_TaskContext *tc) -{ - // Request has left local node -} - -struct GNUNET_DHT_PutHandle * -GNUNET_DHT_put (struct GNUNET_DHT_Handle *handle, - const struct GNUNET_HashCode *key, - uint32_t desired_replication_level, - enum GNUNET_DHT_RouteOption options, - enum GNUNET_BLOCK_Type type, - size_t size, - const void *data, - struct GNUNET_TIME_Absolute exp, - struct GNUNET_TIME_Relative timeout, - GNUNET_DHT_PutContinuation cont, void *cont_cls) - diff --git a/doc/tutorial/examples/020.c b/doc/tutorial/examples/020.c deleted file mode 100644 index 596db3069..000000000 --- a/doc/tutorial/examples/020.c +++ /dev/null @@ -1,25 +0,0 @@ -static void -get_result_iterator (void *cls, struct GNUNET_TIME_Absolute expiration, - const struct GNUNET_HashCode *key, - const struct GNUNET_PeerIdentity *get_path, - unsigned int get_path_length, - const struct GNUNET_PeerIdentity *put_path, - unsigned int put_path_length, - enum GNUNET_BLOCK_Type type, size_t size, - const void *data) -{ - // Optionally: - GNUNET_DHT_get_stop (get_handle); -} - -get_handle = - GNUNET_DHT_get_start (dht_handle, - block_type, - &key, - replication, - GNUNET_DHT_RO_NONE, - NULL, - 0, - &get_result_iterator, - cls) - diff --git a/doc/tutorial/examples/021.c b/doc/tutorial/examples/021.c deleted file mode 100644 index 688a31fe0..000000000 --- a/doc/tutorial/examples/021.c +++ /dev/null @@ -1,13 +0,0 @@ -static enum GNUNET_BLOCK_EvaluationResult -block_plugin_SERVICE_evaluate (void *cls, - enum GNUNET_BLOCK_Type type, - struct GNUNET_BlockGroup *bg, - const GNUNET_HashCode *query, - const void *xquery, - size_t xquery_size, - const void *reply_block, - size_t reply_block_size) -{ - // Verify type, block and bg -} - diff --git a/doc/tutorial/examples/022.c b/doc/tutorial/examples/022.c deleted file mode 100644 index a373619bd..000000000 --- a/doc/tutorial/examples/022.c +++ /dev/null @@ -1,8 +0,0 @@ -static int -block_plugin_SERVICE_get_key (void *cls, enum GNUNET_BLOCK_Type type, - const void *block, size_t block_size, - struct GNUNET_HashCode *key) -{ - // Store the key in the key argument, return GNUNET_OK on success. -} - diff --git a/doc/tutorial/examples/023.c b/doc/tutorial/examples/023.c deleted file mode 100644 index 820c38b10..000000000 --- a/doc/tutorial/examples/023.c +++ /dev/null @@ -1,17 +0,0 @@ -void * -libgnunet_plugin_block_SERVICE_init (void *cls) -{ - static enum GNUNET_BLOCK_Type types[] = - { - GNUNET_BLOCK_TYPE_SERVICE_BLOCKYPE, - GNUNET_BLOCK_TYPE_ANY - }; - struct GNUNET_BLOCK_PluginFunctions *api; - - api = GNUNET_new (struct GNUNET_BLOCK_PluginFunctions); - api->evaluate = &block_plugin_SERICE_evaluate; - api->get_key = &block_plugin_SERVICE_get_key; - api->types = types; - return api; -} - diff --git a/doc/tutorial/examples/024.c b/doc/tutorial/examples/024.c deleted file mode 100644 index 2e84b5905..000000000 --- a/doc/tutorial/examples/024.c +++ /dev/null @@ -1,9 +0,0 @@ -void * -libgnunet_plugin_block_SERVICE_done (void *cls) -{ - struct GNUNET_TRANSPORT_PluginFunctions *api = cls; - - GNUNET_free (api); - return NULL; -} - diff --git a/doc/tutorial/examples/025.Makefile.am b/doc/tutorial/examples/025.Makefile.am deleted file mode 100644 index 66d4f80ec..000000000 --- a/doc/tutorial/examples/025.Makefile.am +++ /dev/null @@ -1,15 +0,0 @@ - plugindir = $(libdir)/gnunet - - plugin_LTLIBRARIES = \ - libgnunet_plugin_block_ext.la - libgnunet_plugin_block_ext_la_SOURCES = \ - plugin_block_ext.c - libgnunet_plugin_block_ext_la_LIBADD = \ - $(prefix)/lib/libgnunethello.la \ - $(prefix)/lib/libgnunetblock.la \ - $(prefix)/lib/libgnunetutil.la - libgnunet_plugin_block_ext_la_LDFLAGS = \ - $(GN_PLUGIN_LDFLAGS) - libgnunet_plugin_block_ext_la_DEPENDENCIES = \ - $(prefix)/lib/libgnunetblock.la - diff --git a/doc/tutorial/examples/026.c b/doc/tutorial/examples/026.c deleted file mode 100644 index 264e0b6b9..000000000 --- a/doc/tutorial/examples/026.c +++ /dev/null @@ -1,52 +0,0 @@ -static void -get_callback (void *cls, - enum GNUNET_DHT_RouteOption options, - enum GNUNET_BLOCK_Type type, - uint32_t hop_count, - uint32_t desired_replication_level, - unsigned int path_length, - const struct GNUNET_PeerIdentity *path, - const struct GNUNET_HashCode * key) -{ -} - - -static void -get_resp_callback (void *cls, - enum GNUNET_BLOCK_Type type, - const struct GNUNET_PeerIdentity *get_path, - unsigned int get_path_length, - const struct GNUNET_PeerIdentity *put_path, - unsigned int put_path_length, - struct GNUNET_TIME_Absolute exp, - const struct GNUNET_HashCode * key, - const void *data, - size_t size) -{ -} - - -static void -put_callback (void *cls, - enum GNUNET_DHT_RouteOption options, - enum GNUNET_BLOCK_Type type, - uint32_t hop_count, - uint32_t desired_replication_level, - unsigned int path_length, - const struct GNUNET_PeerIdentity *path, - struct GNUNET_TIME_Absolute exp, - const struct GNUNET_HashCode * key, - const void *data, - size_t size) -{ -} - - -monitor_handle = GNUNET_DHT_monitor_start (dht_handle, - block_type, - key, - &get_callback, - &get_resp_callback, - &put_callback, - cls); - diff --git a/doc/tutorial/examples/testbed_test.c b/doc/tutorial/examples/testbed_test.c deleted file mode 100644 index 1696234b0..000000000 --- a/doc/tutorial/examples/testbed_test.c +++ /dev/null @@ -1,99 +0,0 @@ -#include -#include -#include -#include -#include - -#define NUM_PEERS 20 - -static struct GNUNET_TESTBED_Operation *dht_op; - -static struct GNUNET_DHT_Handle *dht_handle; - - -struct MyContext -{ - int ht_len; -} ctxt; - - -static int result; - - -static void -shutdown_task (void *cls) -{ - if (NULL != dht_op) - { - GNUNET_TESTBED_operation_done (dht_op); - dht_op = NULL; - dht_handle = NULL; - } - result = GNUNET_OK; -} - - -static void -service_connect_comp (void *cls, - struct GNUNET_TESTBED_Operation *op, - void *ca_result, - const char *emsg) -{ - GNUNET_assert (op == dht_op); - dht_handle = ca_result; - // Do work here... - GNUNET_SCHEDULER_shutdown (); -} - - -static void * -dht_ca (void *cls, const struct GNUNET_CONFIGURATION_Handle *cfg) -{ - struct MyContext *ctxt = cls; - - dht_handle = GNUNET_DHT_connect (cfg, ctxt->ht_len); - return dht_handle; -} - - -static void -dht_da (void *cls, void *op_result) -{ - struct MyContext *ctxt = cls; - - GNUNET_DHT_disconnect ((struct GNUNET_DHT_Handle *) op_result); - dht_handle = NULL; -} - - -static void -test_master (void *cls, - struct GNUNET_TESTBED_RunHandle *h, - unsigned int num_peers, - struct GNUNET_TESTBED_Peer **peers, - unsigned int links_succeeded, - unsigned int links_failed) -{ - ctxt.ht_len = 10; - dht_op = GNUNET_TESTBED_service_connect - (NULL, peers[0], "dht", - &service_connect_comp, NULL, - &dht_ca, &dht_da, &ctxt); - GNUNET_SCHEDULER_add_shutdown (&shutdown_task, NULL); -} - - -int -main (int argc, char **argv) -{ - int ret; - - result = GNUNET_SYSERR; - ret = GNUNET_TESTBED_test_run - ("awesome-test", "template.conf", - NUM_PEERS, 0LL, - NULL, NULL, &test_master, NULL); - if ( (GNUNET_OK != ret) || (GNUNET_OK != result) ) - return 1; - return 0; -} -- cgit v1.2.3