aboutsummaryrefslogtreecommitdiffstats
path: root/src (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* core: Add Base-64 encoder.Werner Koch2018-03-229-162/+184
| | | | | | | | | | | | | | | | | | | | | | | * src/b64enc.c: Change to fit into libgpg-error. * src/Makefile.am: Add b64enc.c * src/b64dec.c: Use xtrymalloc etc. Always use gpg_err_code_t. (_gpgrt_b64dec_start): Set decoder flag (_gpgrt_b64dec_finish): Check for conflict. (_gpgrt_b64state): Move to ... * src/gpgrt-int.h: here. Add new fields. * src/visibility.c (gpgrt_b64enc_start): New. (gpgrt_b64enc_write): New. (gpgrt_b64enc_finish): New. * src/gpg-error.vers, src/gpg-error.def.in: Add new functions. * src/gpg-error.h.in: Ditto. * src/visibility.h: Ditto. * tests/t-b64dec.c: Remove. * tests/t-b64.c: New. * tests/Makefile.am (TESTS): Replace t-b64dec by t-b64. -- Signed-off-by: Werner Koch <[email protected]>
* core: Add file b64enc.c from gnupgWerner Koch2018-03-221-0/+422
| | | | | | | | | -- This is from GnuPG commit fa0ed1c7e2eee7c559026696e6b21acc882a97aa with two tabs replaced by spaces. Signed-off-by: Werner Koch <[email protected]>
* tools: Use gpgrt_argparse for the gpg-error tool.Werner Koch2018-03-211-67/+60
| | | | | | | | * src/gpg-error.c (show_usage): Remove. (my_strusage): New. (main): Change to use argparse. Also use log_error. Signed-off-by: Werner Koch <[email protected]>
* core: Add public function gpgrt_usage.Werner Koch2018-03-216-5/+17
| | | | | | * src/visibility.c (gpgrt_usage): New. Signed-off-by: Werner Koch <[email protected]>
* core: Add the group of argparse functions.Werner Koch2018-03-219-573/+548
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/visibility.c (gpgrt_argparse): New. (gpgrt_strusage): New. (gpgrt_set_strusage): New. (gpgrt_set_usage_outfnc): New. (gpgrt_set_fixed_string_mapper): New. * src/gpg-error.def.in, src/gpg-error.vers: Add new functions. * src/gpg-error.h.in: Add ARGPARSE macros from the former argparse.h. (gpgrt_argparse_t): New. (gpgrt_opt_t): New. * configure.ac (AH_BOTTOM): Request argparse macros. * src/Makefile.am (libgpg_error_la_SOURCES): Add argparse.c. * src/argparse.h: Remove. * src/argparse.c: Revamp to fit into libgpg-error. (_gpgrt_argparse): New. (_gpgrt_usage): Rename from usage. (_gpgrt_strusage): Rename from strusage. Define two new levels and templates for three common licenses. (_gpgrt_set_strusage): Rename from set_strusage. (_gpgrt_set_usage_outfnc): New. (_gpgrt_set_fixed_string_mapper): New. * tests/t-argparse.c: New. -- These functions are in use by GnuPG and other software for 20 years and it makes sense to have them always available instead of copying and maintaing the source in several projects. Note that there are minor changes in the API compared to GnuPG. Signed-off-by: Werner Koch <[email protected]>
* core: Import argparse code from gnupg masterWerner Koch2018-03-212-0/+1867
| | | | --
* core: Fix regression on arm64 due to invalid use of va_list.Werner Koch2018-03-181-4/+14
| | | | | | | | | | | * src/logging.c (_gpgrt_log_printhex): Provide a dummy arg instead of NULL. -- Fix Suggested-by: Jakub Wilk <[email protected]> Signed-off-by: Werner Koch <[email protected]>
* core: Fix building on W64Werner Koch2018-03-143-6/+35
| | | | | | | | | | | | | * src/w32-add.h: Remove hack to define pid_t. * src/gpg-error.h.in: Eval macro to define pid_t. * src/mkheader.c (have_sys_types_h, sys_types_h_included): New. (parse_config_h): Test for sys/types.h. (write_special): Protect inclusion of sys/types.h. Define new macro 'define:pid_t'. -- Regression-due-to: 1865c0ba1769b407a3c504f1ab0a4278704a9fc1 Signed-off-by: Werner Koch <[email protected]>
* build: Update copyright notices and remove gpgscm from the release.Werner Koch2018-03-132-3/+3
| | | | | | -- Signed-off-by: Werner Koch <[email protected]>
* core: Fix regression due to not exporting the process API.Werner Koch2018-03-132-3/+4
| | | | | | | -- Fixes-commit: 0e503cae75cb1a6aa257228a65941b7630ff35d6 Signed-off-by: Werner Koch <[email protected]>
* core: Remove accidently committed time function API.Werner Koch2018-03-121-31/+0
| | | | | | -- Fixes-commit: f9a33a7f7e44a644ff4e31f7e9f1c2c1ec1f8eee
* core: Do not export the process APIWerner Koch2018-03-125-19/+25
| | | | | | | | | -- We may need to change the API and thus we better wait before publishing this new interface. Signed-off-by: Werner Koch <[email protected]>
* syscfg: Add a riscv64 architecture.NIIBE Yutaka2018-02-282-0/+26
| | | | | | | | | | * src/syscfg/lock-obj-pub.riscv64-unknown-linux-gnu.h: New. * src/Makefile.am (lock_obj_pub): Add it. -- Debian-bug-id: 891663 Co-authored-by: Karsten Merker <[email protected]> Signed-off-by: NIIBE Yutaka <[email protected]>
* doc: Typo fixes.Werner Koch2018-02-212-2/+2
| | | | --
* core: Avoid using estream_t in the public API.Werner Koch2017-12-111-4/+33
| | | | | | | | | | * src/gpg-error.h.in: Always use gpgrt_stream-t. -- estream_t can only be used if GPGRT_ENABLE_ES_MACROS is defined. Fixes-commit: 1865c0ba1769b407a3c504f1ab0a4278704a9fc1 Signed-off-by: Werner Koch <[email protected]>
* core: Rename the gpgrt_log_levels enum values.Werner Koch2017-12-083-42/+44
| | | | | | | | | | | * src/gpg-error.h.in (gprt_log_levels): Rename to GPGRT_LOGLVL. -- Explicitly naming them and not distinguishing them from the other log constants is a Good Thing anyway. It also helps against the symbol name clash with the GPGRT enum values from gnupg's logging module. Signed-off-by: Werner Koch <[email protected]>
* core: Wrap blocking system calls of the spawn functions.Werner Koch2017-11-292-10/+44
| | | | Signed-off-by: Werner Koch <[email protected]>
* core: Unify syscall_clamp functions.Werner Koch2017-11-2910-203/+138
| | | | | | | | | | | | | | | * src/estream.c (_gpgrt_set_syscall_clamp) (_gpgrt_get_syscall_clamp): Move to ... * src/syscall-clamp.c: new file. (_gpgrt_pre_syscall, _gpgrt_post_syscall): New. * src/Makefile.am (libgpg_error_la_SOURCES): Add that file. * src/estream.c: Replace the syscall wrapper with the new functions. * src/posix-lock.c: Ditto. * src/w32-lock.c: Ditto. * src/posix-thread.c: Ditto. * src/w32-thread.c: Ditto. Signed-off-by: Werner Koch <[email protected]>
* core: Implement the spawn functions.Werner Koch2017-11-2910-486/+569
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/gpg-error.h.in (GPGRT_SPAWN_NONBLOCK): New const. (GPGRT_SPAWN_RUN_ASFW): New const. (GPGRT_SPAWN_DETACHED): New const. (gpgrt_make_pipe): New function. (gpgrt_create_pipe): New macro. (gpgrt_create_inbound_pipe): New macro. (gpgrt_create_outbound_pipe): New macro. (gpgrt_spawn_process): New function. (gpgrt_spawn_process_fd): New function. (gpgrt_spawn_process_detached): New function. (gpgrt_wait_process): New function. (gpgrt_wait_processes): New function. (gpgrt_kill_process): New function. (gpgrt_release_process): New function. * src/gpg-error.def.in, src/gpg-error.vers: Add new functions. * src/visibility.c, src/visibility.h: Add wrappers for new functions. * src/spawn-posix.c: Rework to better fit the use in gpgrt. Rename all public function with a _gpgrt prefix. * src/spawn-w32.c: Ditto. * src/gpgrt-int.h: Likewise. * src/Makefile.am (arch_sources): Add spawn-posix.c and spawn-w32.c. * src/w32-add.h: Add pid_t typedef as a temporary hack. * configure.ac: Check for signal.h and getrlimit. (AC_FUNC_FORK): New. -- This does build but porting the tests and further changes are required. Don't assume that the API for the new fucntions is stable. Signed-off-by: Werner Koch <[email protected]>
* Import and relicense exechelp* functions from GnuPG.Werner Koch2017-11-293-0/+1980
| | | | | | | | | | | | | * src/spawn-posix.c: New. Taken from GnuPG's exechelp-posix.c. * src/spawn-w32.c: New. Taken from GnuPG's exechelp-w32.c. * src/gpgrt-int.h: Include prototypes from GnuPG's exechelp.h. -- The original files were under (LGPL-3.0+ OR GPL-2.0+) and have entirely been written by g10 Code employees. Being the responsible person at g10 Code, I endorse the license change to LGPL-2.1. Signed-off-by: Werner Koch <[email protected]>
* core: Change new functions to return gpg_err_code_t.Werner Koch2017-11-284-39/+51
| | | | | | | | | | | | | | | | * src/gpg-error.h.in (gpgrt_sentenv, gpgrt_mkdir, gpgrt_chdir): Change return type to gpg_err_code_t. * src/sysutils.c (_gpgrt_setenv): Implement that. (_gpgrt_mkdir): Ditto. (_gpgrt_chdir): Ditto. * gpgscm/ffi.c (do_setenv, do_mkdir): Adjust for this change. -- The functions are already a bit different and thus it is useful to let them return a gpg-error style error code and don't let the user implement that for each call. Signed-off-by: Werner Koch <[email protected]>
* core: New API functions gpgrt_mkdir, gpgrt_chdir, gpgrt_getcwd.Werner Koch2017-11-287-81/+248
| | | | | | | | | | | | | | | | | | | | | | * src/gpg-error.h.in (gpgrt_mkdir, gpgrt_chdir, gpgrt_getcwd): New. * src/visibility.c, src/visibility.h: Add wrappers. * src/gpg-error.vers, src/gpg-error.def.in: Add them. * src/sysutils.c (modestr_to_mode): New. (_gpgrt_mkdir, _gpgrt_chdir, _gpgrt_getcwd): New. * m4/gnupg-misc.m4: New. * m4/Makefile.am (EXTRA_DIST): Add new M4 file. * configure.ac: Call new GNUPG_FUNC_MKDIR_TAKES_ONE_ARG. (AC_CHECK_FUNCS): Add stat. -- The code has been taken from GnuPG. _gpgrt_mkdir was originally written by me as gnupg_mkdir and here relicensed to LGPLv2.1+. _gpgrt_getcwd was originally written by in 2007 and also here relicensed to LGPLv2.1. The new M4 macro was also written by me for use in in GnuPG; it has been taken from GnUPG's acinclude.m4, moved to its own file here, and relicensed to FSFULLR. Signed-off-by: Werner Koch <[email protected]>
* core: Prepare to build with gpgscm.Werner Koch2017-11-281-1/+1
| | | | | | | | | | | | * configure.ac: New option --enable-gpgscm. Create gpgscm/Makefile. (GPGRT_ENABLE_LOG_MACROS): Define. * Makefile.am (SUBDIRS): Add gpgscm * src/logging.c (_gpgrt_logv_clock): Do not use the log_debug macro. -- Note that gpscm does not yet build. Signed-off-by: Werner Koch <[email protected]>
* core: New API functions gpgrt_getenv and gpgrt_setenv.Werner Koch2017-11-287-0/+218
| | | | | | | | | | | | | | | | | | | * src/gpg-error.h.in (gpgrt_getenv, gpgrt_setenv): New. (gpgrt_unsetenv): New macro. * src/gpg-error.vers, src/gpg-error.def.in: Add them. * src/visibility.c (gpgrt_getenv, gpgrt_setenv): New. * src/visibility.h: Add them. * src/sysutils.c: Include string.h and on Windows windows.h. (_gpgrt_getenv): New. (_gpgrt_setenv): New. -- These functions are wrappers to cope with Windows problems. The code is similar to what we have in GnuPG but not identical. Requires better testing. Signed-off-by: Werner Koch <[email protected]>
* core: Install new files gpgrt.m4 and gpgrt-config.Werner Koch2017-11-273-7/+141
| | | | | | | | | | | | | | | | | | * src/gpgrt.m4: New. Bascially a copy of libgpg-error.m4 * src/gpg-error-config.in: Decide which name to print. * src/Makefile.am (nodist_bin_SCRIPTS): Add gpgrt-config. (m4data_DATA): Add gpgrt.m4 (EXTRA_DIST): Add gpgrt.m4. (BUILT_SOURCES): Add gpgrt-config. (CLEANFILES): Add gpgrt-config. (gpgrt-config): Create from gpg-error-config. -- These files can be used instead of gpg-error-config or gpg-error.m4. The hope is that providing them early will ease an eventual migration from libgpg-error to libgpgrt easier. Signed-off-by: Werner Koch <[email protected]>
* doc: Add a comment to the Windows registry functions.Werner Koch2017-11-271-1/+5
| | | | --
* core: Avoid endless recursion if log_set_sink has not been used.Werner Koch2017-11-271-2/+3
| | | | | | | * src/logging.c (_gpgrt_log_set_sink): Do not call gf_is_valid if the default sink has been requested. Signed-off-by: Werner Koch <[email protected]>
* core: Add new macro log_assert to the API.Werner Koch2017-11-271-2/+13
| | | | | | * src/gpg-error.h.in (log_assert): New macro. Signed-off-by: Werner Koch <[email protected]>
* core: Do not use the estream_t alias in gpg-error.h.Werner Koch2017-11-221-2/+2
| | | | | | | | | * src/gpg-error.h.in: Use gpgrt_stream_t in prototypes. -- estream_t is not necessary enabled so to keep the namespace clean. Signed-off-by: Werner Koch <[email protected]>
* w32: Avoid unused code warning.Werner Koch2017-11-171-0/+8
| | | | | | | | * src/w32-estream.c (_gpgrt_w32_poll) [!ENABLE_TRACING]: Do not use waitinfo. -- Signed-off-by: Werner Koch <[email protected]>
* w32: Add new API fucntion gpgrt_w32_reg_query_string.Werner Koch2017-11-178-6/+224
| | | | | | | | | | | | | | | | | | | | | | | | * src/w32-reg.c: New. * src/w32-add.h: Add gpgrt_w32_reg_query_string. * src/visibility.c (gpgrt_w32_reg_query_string): New wrapper. * src/gpg-error.def.in: Add gpgrt_w32_reg_query_string. * configure.ac (ac_check_funcs): Add stpcpy. * src/Makefile.am (arch_sources): Add w32-reg.c (socklibs): New. (libgpg_error_la_LIBADD): Add socklibs. * src/gpgrt-int.h (xfree, xtrymalloc, xtrycalloc) (xtryrealloc): New internal macros. (_gpgrt_stpcpy, stpcpy): New replacement fucntion and macro. * src/logging.c (_gpgrt_logv_internal): Use new registry query function and add standard registry key. -- This also fixes the build failure on Widnwos for logging.c. The code for gpgrt_w32_reg_query_string has been taken from the function read_w32_registry_string in w32-utils.c in the GPGME package. Signed-off-by: Werner Koch <[email protected]>
* core: New API functions gpgrt_strdup and gpgrt_strconcat.Werner Koch2017-11-177-2/+111
| | | | | | | | | | | | | | | * src/visibility.c (gpgrt_strdup): New API fucntion. (gpgrt_strconcat): New API fucntion. * src/visibility.h: Add corresponding macros. * src/gpg-error.def.in: Add them. * src/gpg-error.vers: Add them. * src/gpgrt-int.h (DIM): New macro. * src/init.c (_gpgrt_strdup): New. (_gpgrt_strconcat_core): New. (_gpgrt_strconcat): New. -- Signed-off-by: Werner Koch <[email protected]>
* core: New API functions gpgrt_malloc, gpgrt_calloc, and gpgrt_realloc.Werner Koch2017-11-177-1/+63
| | | | | | | | | | | | | * src/visibility.c (gpgrt_realloc): New API function. (gpgrt_malloc): New API function. (gpgrt_calloc): New API function. * src/visibility.h: Add corresponding macros. * src/gpg-error.def.in: Add them. * src/gpg-error.vers: Add them. * src/init.c (_gpgrt_calloc): New. * src/gpg-error.h.in: Add prototypes. Signed-off-by: Werner Koch <[email protected]>
* core: Add logging API.Werner Koch2017-11-178-298/+803
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/visibility.c (gpgrt_get_errorcount): New API. (gpgrt_inc_errorcount): New API. (gpgrt_log_set_sink): New API. (gpgrt_log_set_socket_dir_cb): New API. (gpgrt_log_set_pid_suffix_cb): New API. (gpgrt_log_set_prefix): New API. (gpgrt_log_get_prefix): New API. (gpgrt_log_test_fd): New API. (gpgrt_log_get_fd): New API. (gpgrt_log_get_stream): New API. (gpgrt_log): New API. (gpgrt_logv): New API. (gpgrt_logv_prefix): New API. (gpgrt_log_string): New API. (gpgrt_log_info): New API. (gpgrt_log_error): New API. (gpgrt_log_fatal): New API. (gpgrt_log_bug): New API. (gpgrt_log_debug): New API. (gpgrt_log_debug_string): New API. (gpgrt_log_printf): New API. (gpgrt_log_flush): New API. (gpgrt_log_printhex): New API. (gpgrt_log_clock): New API. (_gpgrt_log_assert): New function for the ABI. * src/visibility.h: Add corresponding macros. * src/gpg-error.def.in: Add new functions. * src/gpg-error.vers: Add new functions. * src/gpg-error.h.in (GPGRT_LOG_WITH_PREFIX): New constant. (GPGRT_LOG_WITH_TIME): New constant. (GPGRT_LOG_WITH_PID): New constant. (GPGRT_LOG_RUN_DETACHED): New constant. (GPGRT_LOG_NO_REGISTRY): New constant. (GPGRT_LOG_BEGIN): New enum value. (GPGRT_LOG_CONT): New enum value. (GPGRT_LOG_INFO): New enum value. (GPGRT_LOG_WARN): New enum value. (GPGRT_LOG_ERROR): New enum value. (GPGRT_LOG_FATAL): New enum value. (GPGRT_LOG_BUG): New enum value. (GPGRT_LOG_DEBUG): New enum value. (log_get_errorcount, log_inc_errorcount, log_set_file, log_set_fd) (log_set_stream, log_set_socket_dir_cb, log_set_pid_suffix_cb) (log_set_prefix, log_get_prefix, log_test_fd, log_get_fd) (log_get_stream, log_log, log_logv, log_logv_prefix, log_string) (log_bug, log_fatal, log_error, log_info, log_debug, log_debug_string) (log_printf, log_printhex, log_clock) (log_flush) [GPGRT_ENABLE_LOG_MACROS]: New wrapper macros. (gpgrt_assert): New macro. * src/gpgrt-int.h: Add prototypes for logging.c. (gpgrt_assert): Redefine for internal use. * src/logging.h: Remove. * src/logging.c: Include gpgrt-int.h instead of the stuff from GnuPG. Use _gpgrt malloc funcsions and the internal versions of the estream functions. Rename all public fucntions with a _gpgrt_ prefix. (print_prefix): Return the printed length. (_gpgrt_logv_internal): Ditto. (_gpgrt_log_printhex): Change order of args and turn into a printf like function. (_gpgrt_logv_printhex): New. Take the core of the former log_printhex. (_gpgrt_log_clock): Turn into a printf like functions. (_gpgrt_logv_clock): New. Take the core of the former log_clock. -- This logging API is a slightly modified version of what we are using in GnuPG. Signed-off-by: Werner Koch <[email protected]>
* New configure options and macros for internal use.Werner Koch2017-11-173-11/+158
| | | | | | | | | | | | | * configure.ac: Add option --enable-log-clock. * configure.ac: Add option --enable-werror. * src/sysutils.c: New. * src/Makefile.am (libgpg_error_la_SOURCES): Add sysutils.c * src/gpgrt-int.h: Add internal i18n macros and hacks to make working with sockets easier. (es_stdin, es_stdout, es_stderr): New internal macros. (snprintf): New macro. Signed-off-by: Werner Koch <[email protected]>
* core: Change license of logging.[ch] to LGPLv2.1Werner Koch2017-10-052-48/+32
| | | | | | | | | | | -- This file has a long history. I was first written by me in 1998 for GnuPG under the name logger.c. In 2010 it was renamed to logging.c. Almost everything was written by me. A few minor fixes are from g10 Code employees and some other people. Signed-off-by: Werner Koch <[email protected]>
* core: Import of logging.[ch] from GnuPGWerner Koch2017-10-052-0/+1218
| | | | | | | | | -- Taken from GnuPG master commit 98c260e057e7829580da99f0c8e0037a3896bfae Signed-off-by: Werner Koch <[email protected]>
* syscfg: Add lock-obj-pub file for ia64-unknown-linux-gnu.Werner Koch2017-07-052-0/+26
| | | | | | | | | * src/syscfg/lock-obj-pub.ia64-unknown-linux-gnu.h: new. * src/Makefile.am (lock_obj_pub): Add it. -- GnuPG-bug-id: 3242 Signed-off-by: Werner Koch <[email protected]>
* doc: Typo fixWerner Koch2017-07-051-1/+1
| | | | --
* Align 'es_poll' semantics closer with POSIX.Justus Winter2017-05-311-3/+0
| | | | | | | | | | | | | * src/estream.c (_gpgrt_poll): Do not return early if some streams are found to be ready before even polling the others. -- POSIX mandates that all streams are examined and returning early violates that. It also imposes an order on how the callee serves the streams, which might be incompatible with the order the callee wants to serve them, leading to deadlocks. Signed-off-by: Justus Winter <[email protected]>
* Fix memory leak for estream.NIIBE Yutaka2017-05-301-5/+20
| | | | | | | * src/estream.c (do_list_remove): Free the item. (do_close): Free the buffer. Signed-off-by: NIIBE Yutaka <[email protected]>
* Minor clean up.NIIBE Yutaka2017-04-193-4/+6
| | | | | | | | * src/b64dec.c (_gpgrt_b64dec_proc): Add a comment. * src/estream.c (_gpgrt_fread, _gpgrt_fwrite): Use &&. * src/mkheader.c (xstrdup): Use memcpy as we know length. Signed-off-by: NIIBE Yutaka <[email protected]>
* w32: Conditionalize ISO 2022 definitions.NIIBE Yutaka2017-03-071-0/+2
| | | | | | | | | * src/w32-iconv.c (iso2022_SI_seq, iso2022_SO_seq) [USE_MLANG_DLL]: Only for USE_MLANG_DLL. -- Signed-off-by: NIIBE Yutaka <[email protected]>
* Release 1.27libgpg-error-1.27Werner Koch2017-02-283-3/+3
| | | | | | | | | | * configure.ac: Bump LT version to C22/A22/R0. -- Note that C21/A21/R0 was used in 1.26 but later lost in the repo due to a merge. Signed-off-by: Werner Koch <[email protected]>
* Add support for armv7-unknown-linux-gnueabihf.Werner Koch2017-02-285-72/+7
| | | | | | | | | | | | | | | | | * src/syscfg/lock-obj-pub.arm-unknown-linux-gnueabihf.h: Remove. * src/syscfg/lock-obj-pub.armv5-unknown-linux-musleabi.h: Remove. * src/syscfg/lock-obj-pub.armv6-unknown-linux-musleabihf.h: Remove. * src/Makefile.am (lock_obj_pub): Remove them. * src/mkheader.c (canon_host_triplet): Add removed as aliases. Addn alias for armv7-unknown-linux-gnueabihf. -- Info provided by Marvin Schmidt <[email protected]> via [email protected] on Tue, 14 Feb 2017 15:00:15 +0100 Consilidated arm syscfg file by aliasing them. Signed-off-by: Werner Koch <[email protected]>
* New public header gpgrt.h as alias for gpg-error.hWerner Koch2017-02-282-4/+10
| | | | | | | | | | * src/gpg-error.h.in (GPGRT_H): New double include protection. * src/Makefile.am (nodist_include_HEADERS): Add gpgrt.h. (BUILT_SOURCES): Ditto. (CLEANFILES): Ditto. (gpgrt.h): New rule. Signed-off-by: Werner Koch <[email protected]>
* Improve tracing of estream.Werner Koch2017-02-284-94/+191
| | | | | | | | | | | | * src/gpgrt-int.h (trace_errno): Add new parameter. Adjust all users. * src/init.c (trace_fp, trace_with_errno, trace_missing_lf) (trace_prefix_done): New vars. (_gpgrt_internal_trace_begin): Add arg WITH_ERRNO. Open a trace file on first use. Init new vars. (print_internal_trace_prefix): New. * src/estream.c, src/w32-estream.c: Improve tracing. Signed-off-by: Werner Koch <[email protected]>
* w32: Fix gpgrt_poll for Windows.Werner Koch2017-02-281-6/+0
| | | | | | | | | | | | * src/estream.c (_gpgrt_poll) [W32]: Do not call the syscall clamp. -- The system call clamp may only be used directloy around system calls. We don't need them here because we use independent threads to implement non-blocking behaviour. In fact the clamp may lead to a deadlock. Signed-off-by: Werner Koch <[email protected]>
* Use the new tracing ramework for estream.Werner Koch2017-02-262-103/+159
| | | | | | | | | * src/estream.c: Add trace calls to some functions. * src/w32-estream.c: Replace existing trace calls by the new framework. -- Signed-off-by: Werner Koch <[email protected]>
* Add a tracing framework.Werner Koch2017-02-262-0/+121
| | | | | | | | | | | | | | | | | | | | * src/init.c (trace_save_errno, trace_arg_module) (trace_arg_file, trace_arg_line): New module vars. (do_internal_trace): New. (_gpgrt_internal_trace_printf): New. (_gpgrt_internal_trace): New. (_gpgrt_internal_trace_errno): New. (_gpgrt_internal_trace_end): New. * src/gpgrt-int.h (trace): New macro. (trace_errno): New macro. (trace_start): New macro. (trace_append): New macro. (trace_finish): New macro. -- We want to be abale to use libgpg-error also with pre-c99 compilers and thus we can use the __VA_ARGS__ but resort to the common macro trick.