1. 14 Nov, 2016 4 commits
  2. 12 Nov, 2016 6 commits
    • Werner Koch's avatar
      estream: Minor portability fix. · c26117b2
      Werner Koch authored
      
      
      --
      
      A trailing comma in an enum is not groked by all compilers.
      Binary operation should have their own parentheses to make it clear
      that a binary operator was meant.
      
      Signed-off-by: default avatarWerner Koch <wk@gnupg.org>
      c26117b2
    • Justus Winter's avatar
      estream: Support 'es_poll' on Windows. · 40e5ff0a
      Justus Winter authored
      
      
      * src/Makefile.am (arch_sources): Add new file.
      * src/estream.c (O_NONBLOCK): Move to 'gpgrt-int.h'.
      (BUFFER_BLOCK_SIZE): Likewise.
      (BUFFER_UNREAD_SIZE): Likewise.
      (struct notify_list_s, notify_list_t): Likewise.
      (struct _gpgrt_stream_internal, estream_internal_t): Likewise.
      (X_POLLABLE): New macro.
      (parse_mode): Parse keyword 'pollable', emulate O_NONBLOCK using the
      same mechanism on Windows.
      (_gpgrt_poll): Use the new '_gpgrt_w32_poll' on Windows.
      * src/gpgrt-int.h (_gpgrt_functions_w32_pollable): New declaration.
      (_gpgrt_w32_pollable_create): New prototype.
      (_gpgrt_w32_poll): Likewise.
      * src/w32-estream.c: New file.  This code is adapted from GPGME.
      * tests/t-poll.c (create_pipe): Create pollable streams.
      
      GnuPG-bug-id: 2731
      Signed-off-by: default avatarJustus Winter <justus@g10code.com>
      40e5ff0a
    • Justus Winter's avatar
      estream: Track the kind of backend used. · e15416d3
      Justus Winter authored
      
      
      * src/estream.c (struct _gpgrt_stream_internal): Add 'kind'.
      (init_stream_obj): New parameter 'kind', initialize field.
      (es_create): New parameter 'kind'.  Update all callers.
      * src/gpgrt-int.h (gpgrt_stream_backend_kind_t): New type.
      
      Signed-off-by: default avatarJustus Winter <justus@g10code.com>
      e15416d3
    • Justus Winter's avatar
      estream: Rework how the cookie functions are handled. · a0651e91
      Justus Winter authored
      
      
      * src/estream.c (cookie_ioctl_function_t): Move to 'gpgrt-int.h',
      along with the macros for the IOCTL numbers.
      (estream_functions_mem): Use the new type and add the ioctl function.
      (estream_functions_fd): Likewise.
      (estream_functions_w32): Likewise.
      (estream_functions_fp): Likewise.
      (init_stream_object): Use the new type, and also initialize
      'func_ioctl'.
      (es_create): Use the new type.
      (_gpgrt_fopen): Adapt.
      (_gpgrt_mopen): Likewise.
      (_gpgrt_fopenmem): Likewise.
      (_gpgrt_fopencookie): Likewise.
      (_gpgrt_fdopen): Likewise.
      (_gpgrt_fpopen): Likewise.
      (do_w32open): Likewise.
      * src/gpgrt-int.h (struct cookie_io_functions_s): New type.
      
      Signed-off-by: default avatarJustus Winter <justus@g10code.com>
      a0651e91
    • Justus Winter's avatar
      estream: Rework modestring handling. · 135319b5
      Justus Winter authored
      
      
      * src/estream.c (X_SAMETHREAD, X_SYSOPEN): New macros.
      (parse_mode): Rework how information flows from here to 'es_create'.
      Instead of using an integer flag per mode, use flags.
      (init_stream_obj): Adapt accordingly.
      (es_create): Likewise.
      (_gpgrt_fopen): Likewise.
      (_gpgrt_mopen): Likewise.
      (_gpgrt_fopenmem): Likewise.
      (_gpgrt_fopencookie): Likewise.
      (_gpgrt_fdopen): Likewise.
      (_gpgrt_fpopen): Likewise.
      (do_w32open): Likewise.
      (_gpgrt_freopen): Likewise.
      
      Signed-off-by: default avatarJustus Winter <justus@g10code.com>
      135319b5
    • Werner Koch's avatar
      Add new interface gpgrt_get_syscall_clamp. · b7972767
      Werner Koch authored
      
      
      * src/visibility.c (gpgrt_get_syscall_clamp): New.
      * src/gpg-error.vers, src/gpg-error.def.in: Add function.
      * src/gpg-error.h.in: Ditto.
      * src/estream.c (_gpgrt_get_syscall_clamp): New.
      --
      
      This function can be used by other libraries to set their own system
      clamp functions.
      
      Signed-off-by: default avatarWerner Koch <wk@gnupg.org>
      b7972767
  3. 11 Nov, 2016 2 commits
    • Werner Koch's avatar
      Use the syscall clamp functions also for lock functions · 25d463c6
      Werner Koch authored
      
      
      * src/posix-lock.c (pre_lock_func, post_lock_func): New.
      (_gpgrt_lock_set_lock_clamp): New.
      (_gpgrt_lock_lock): Use clamp functions.
      * src/w32-lock.c (pre_lock_func, post_lock_func): New.
      (_gpgrt_lock_set_lock_clamp): New.
      (_gpgrt_lock_lock): Use clamp functions.
      * src/posix-lock.c (pre_syscall_func, post_syscall_func): New.
      (_gpgrt_thread_set_syscall_clamp): New.
      (_gpgrt_yield): Use clamp functions.
      * src/w32-lock.c (pre_syscall_func, post_syscall_func): New.
      (_gpgrt_thread_set_syscall_clamp): New.
      (_gpgrt_yield): Use clamp functions.
      * src/estream.c: Include lock.h and thread.h.
      (do_deinit): Call _gpgrt_lock_set_lock_clamp.
      (_gpgrt_set_syscall_clamp): Ditto.
      
      Signed-off-by: default avatarWerner Koch <wk@gnupg.org>
      25d463c6
    • Andre Heinecke's avatar
      w32: Fix lock c++ narrowing conversion warning · b1ccab5b
      Andre Heinecke authored
      * src/syscfg/lock-obj-pub.mingw32.h (gpgrt_lock_t): Declare priv as
      unsigned char.
      
      --
      This fixes error: narrowing conversion of ‘255’ from ‘int’ to
      ‘volatile char’ inside { } [-Werror=narrowing]
      b1ccab5b
  4. 10 Nov, 2016 1 commit
  5. 02 Nov, 2016 1 commit
  6. 18 Oct, 2016 2 commits
  7. 07 Oct, 2016 2 commits
  8. 01 Sep, 2016 2 commits
  9. 16 Aug, 2016 1 commit
  10. 14 Jul, 2016 2 commits
  11. 13 Jul, 2016 1 commit
  12. 12 Jul, 2016 2 commits
    • Yann E. MORIN's avatar
      Add an option to disable tests · d57a16c3
      Yann E. MORIN authored
      
      
      * configure.ac: add an option to enable/disable building tests
      * Makefile.am: conditionally build tests
      --
      
      On an embeded device, there is no reason to have the tests present in
      a production release build. Add a configure-time option to disable
      them.
      
      Signed-off-by: default avatar"Yann E. MORIN" <yann.morin.1998@free.fr>
      d57a16c3
    • Yann E. MORIN's avatar
      Fix build without threads · abcdfa79
      Yann E. MORIN authored
      
      
      * src/gen-posix-lock-obj.c: properly guard inclusioin of pthread.h
      * tests/t-lock.c: likewise
      * tests/t-poll.c: likewise
      --
      
      Although ./configure checks for thread support, gen-posix-lock-obj and
      two tests still include pthread.h unconditionally.
      
      Guard that inclusion using the same condition as all other uses of
      pthread-related code.
      
      Signed-off-by: default avatar"Yann E. MORIN" <yann.morin.1998@free.fr>
      abcdfa79
  13. 05 Jul, 2016 1 commit
  14. 02 Jul, 2016 1 commit
  15. 27 Jun, 2016 1 commit
  16. 25 Jun, 2016 2 commits
  17. 24 Jun, 2016 1 commit
  18. 15 Jun, 2016 8 commits