![]() |
GNUnet
0.11.x
|
#include <stdio.h>
#include <zbar.h>
#include <stdbool.h>
#include "platform.h"
#include "gnunet_util_lib.h"
Go to the source code of this file.
Macros | |
#define | LOG(fmt, ...) |
Functions | |
static void | maint_child_death (void *cls) |
Task triggered whenever we receive a SIGCHLD (child process died) or when user presses CTRL-C. More... | |
static void | sighandler_chld () |
Signal handler called for signals that causes us to wait for the child process. More... | |
static void | gnunet_uri (void *cls, const char *uri, const char *cfgfile, const struct GNUNET_CONFIGURATION_Handle *cfg) |
Dispatch URIs to the appropriate GNUnet helper process. More... | |
static const zbar_symbol_t * | get_symbol (zbar_processor_t *proc) |
Obtain QR code 'symbol' from proc. More... | |
static char * | run_zbar () |
Run zbar QR code parser. More... | |
static void | run (void *cls, char *const *args, const char *cfgfile, const struct GNUNET_CONFIGURATION_Handle *cfg) |
Main function that will be run by the scheduler. More... | |
int | main (int argc, char *const *argv) |
Variables | |
static char * | device |
Video device to capture from. More... | |
static unsigned int | verbose |
–verbose option More... | |
static int | silent = false |
–silent option More... | |
static long unsigned int | exit_code = 0 |
Handler exit code. More... | |
static struct GNUNET_OS_Process * | p |
Helper process we started. More... | |
static struct GNUNET_SIGNAL_Context * | shc_chld |
Child signal handler. More... | |
static struct GNUNET_DISK_PipeHandle * | sigpipe |
Pipe used to communicate child death via signal. More... | |
static pid_t | my_pid |
Process ID of this process at the time we installed the various signal handlers. More... | |
Definition in file gnunet-qr.c.
#define LOG | ( | fmt, | |
... | |||
) |
Definition at line 32 of file gnunet-qr.c.
Referenced by get_symbol(), and run_zbar().
|
static |
Task triggered whenever we receive a SIGCHLD (child process died) or when user presses CTRL-C.
cls | closure, NULL |
Definition at line 84 of file gnunet-qr.c.
References exit_code, GNUNET_break, GNUNET_DISK_pipe_close(), GNUNET_OK, GNUNET_OS_process_destroy(), GNUNET_OS_PROCESS_EXITED, GNUNET_OS_process_kill(), GNUNET_OS_process_status(), GNUNET_SIGNAL_handler_uninstall(), GNUNET_TERM_SIG, and type.
Referenced by gnunet_uri().
|
static |
Signal handler called for signals that causes us to wait for the child process.
Definition at line 106 of file gnunet-qr.c.
References GNUNET_DISK_file_write(), GNUNET_DISK_PIPE_END_WRITE, GNUNET_DISK_pipe_handle(), and my_pid.
Referenced by gnunet_uri().
|
static |
Dispatch URIs to the appropriate GNUnet helper process.
cls | closure |
uri | uri to dispatch |
cfgfile | name of the configuration file used (for saving, can be NULL!) |
cfg | configuration |
Definition at line 130 of file gnunet-qr.c.
References _, GNUNET_array_append, GNUNET_array_grow, GNUNET_assert, GNUNET_CONFIGURATION_get_value_string(), GNUNET_DISK_PF_NONE, GNUNET_DISK_pipe(), GNUNET_DISK_PIPE_END_READ, GNUNET_DISK_pipe_handle(), GNUNET_free, GNUNET_OK, GNUNET_OS_INHERIT_STD_ALL, GNUNET_OS_start_process_vap(), GNUNET_SCHEDULER_add_read_file(), GNUNET_SCHEDULER_cancel(), GNUNET_SIGNAL_handler_install(), GNUNET_strdup, GNUNET_strndup, GNUNET_TIME_UNIT_FOREVER_REL, maint_child_death(), my_pid, sighandler_chld(), subsystem, and uri.
Referenced by run().
|
static |
Obtain QR code 'symbol' from proc.
proc | zbar processor to use |
Definition at line 218 of file gnunet-qr.c.
References device, GNUNET_break, GNUNET_ERROR_TYPE_ERROR, GNUNET_log, GNUNET_strdup, and LOG.
Referenced by run_zbar().
|
static |
Run zbar QR code parser.
Definition at line 277 of file gnunet-qr.c.
References data, device, get_symbol(), GNUNET_break, GNUNET_free, GNUNET_strdup, LOG, and ret.
Referenced by run().
|
static |
Main function that will be run by the scheduler.
cls | closure |
args | remaining command-line arguments |
cfgfile | name of the configuration file used (for saving, can be NULL!) |
cfg | configuration |
Definition at line 325 of file gnunet-qr.c.
References data, exit_code, GNUNET_free, gnunet_uri(), and run_zbar().
Referenced by main().
int main | ( | int | argc, |
char *const * | argv | ||
) |
Definition at line 349 of file gnunet-qr.c.
References device, exit_code, gettext_noop, GNUNET_GETOPT_OPTION_END, GNUNET_GETOPT_option_flag(), GNUNET_GETOPT_option_string(), GNUNET_GETOPT_option_verbose(), GNUNET_OK, GNUNET_PROGRAM_run(), ret, run(), silent, and verbose.
|
static |
Video device to capture from.
Sane default for GNU/Linux systems.
Definition at line 39 of file gnunet-qr.c.
Referenced by get_symbol(), main(), and run_zbar().
|
static |
|
static |
|
static |
Handler exit code.
Definition at line 54 of file gnunet-qr.c.
Referenced by main(), maint_child_death(), and run().
|
static |
Helper process we started.
Definition at line 59 of file gnunet-qr.c.
Referenced by _make_continuous_arg_copy(), access_handler_callback(), adjust(), age_values(), ats_performance_info_cb(), block_proc(), block_reader(), check_priority(), comm_connect_cb(), comm_disconnect_cb(), comm_schedule_send(), compute_scalar_product(), compute_service_response(), context_state_callback(), create_loc_uri(), CustomPeerMap_put(), CustomPeerMap_remove_peer(), display_bar(), display_request(), dns_result_parser(), do_connect_peers(), do_shutdown(), do_stop_task(), download_stop_task(), dump_buffer(), encode_cont(), enforce_add_address(), enforce_del_address(), enforce_start_property(), enforce_start_request(), enforce_stop_preference(), enforce_stop_request(), enforce_stop_send(), evaluate(), find_timed_out(), format_help(), free_link_properties(), free_preference(), get_all_peers_iterator(), get_all_tunnels_iterator(), get_hello(), get_keywords_from_tokens(), get_longest_prefix(), get_path_from_GNUNET_PREFIX(), get_path_from_PATH(), get_pipeline(), get_preferences_cb(), getPRK(), GN_getopt_internal(), gns_resolve_name(), GNUNET_ATS_solver_generate_preferences_start(), GNUNET_ATS_TEST_logging_now(), GNUNET_CADET_open_port(), GNUNET_CONFIGURATION_create(), GNUNET_CONTAINER_meta_data_insert(), GNUNET_CONTAINER_multihashmap32_remove(), GNUNET_CONTAINER_multihashmap32_remove_all(), GNUNET_CONTAINER_multihashmap_remove(), GNUNET_CONTAINER_multihashmap_remove_all(), GNUNET_CONTAINER_multipeermap_remove(), GNUNET_CONTAINER_multipeermap_remove_all(), GNUNET_CONTAINER_multishortmap_remove(), GNUNET_CONTAINER_multishortmap_remove_all(), GNUNET_CONTAINER_multiuuidmap_remove(), GNUNET_CONTAINER_multiuuidmap_remove_all(), GNUNET_CRYPTO_ecc_ecdh(), GNUNET_CRYPTO_ecdh_ecdsa(), GNUNET_CRYPTO_ecdh_eddsa(), GNUNET_CRYPTO_ecdsa_ecdh(), GNUNET_CRYPTO_eddsa_ecdh(), GNUNET_CRYPTO_mpi_print_unsigned(), GNUNET_CRYPTO_paillier_create(), GNUNET_CRYPTO_zero_keys(), GNUNET_DISK_pipe_from_fd(), GNUNET_DNSPARSER_parse(), GNUNET_FS_publish_main_(), GNUNET_FS_publish_make_status_(), GNUNET_MY_exec_prepared(), GNUNET_OS_check_helper_binary(), GNUNET_OS_init(), GNUNET_SCHEDULER_cancel(), GNUNET_SECRETSHARING_share_read(), GNUNET_SECRETSHARING_share_write(), GNUNET_SERVER_add_handlers(), GNUNET_TRANSPORT_TESTING_connect_check(), GNUNET_TRANSPORT_TESTING_done(), GNUNET_TRANSPORT_TESTING_start_peer(), GSF_cadet_query_cancel(), handle_dns_request(), handle_index_start_failed(), handle_index_start_ok(), handle_ping(), handle_pong(), handle_show_path(), handle_signature_response(), hash_for_index_cb(), hello_iter_cb(), ibf_hashcode_from_key(), index_mq_error_handler(), libgnunet_plugin_transport_udp_init(), main(), modify_request(), notify_connect(), notify_disconnect(), oprelease_overlay_configure_topology(), opstart_overlay_configure_topology(), parse_definitions(), parse_pattern(), peer_info_cb(), peerinformation_cb(), process_result(), progress_cb(), progress_proc(), publish_content(), publish_kblocks(), publish_kblocks_cont(), publish_stop_task(), queue_ready_task(), recursive_dns_resolution(), regex_add(), regex_combine(), REGEX_INTERNAL_construct_nfa(), retrieve_hello(), run(), run_process_and_wait(), search_stop_task(), set_feedback_task(), set_pref_task(), set_prop_task(), shutdown_task(), solver_bandwidth_changed_cb(), start_cb(), start_download(), start_publish(), stop_broadcast(), update_ping_data(), and update_pong_data().
|
static |
Child signal handler.
Definition at line 64 of file gnunet-qr.c.
Referenced by GNUNET_TESTING_setup(), and main().
|
static |
Pipe used to communicate child death via signal.
Definition at line 69 of file gnunet-qr.c.
|
static |
Process ID of this process at the time we installed the various signal handlers.
Definition at line 75 of file gnunet-qr.c.
Referenced by gnunet_uri(), and sighandler_chld().