~noskcaj/ubuntu/trusty/gpgme1.0/1.4.3

« back to all changes in this revision

Viewing changes to gpgme/version.c

  • Committer: Bazaar Package Importer
  • Author(s): Jose Carlos Garcia Sogo
  • Date: 2008-03-08 14:06:34 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20080308140634-dom8okim5mdkz22o
Tags: 1.1.6-2
* Bump shlibs info, as this version added some new symbols (Closes: #469534)
* Urgency set to medium, as this package has yet transitioned to lenny.
* debian/control: add Vcs-Browser info 

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* version.c - Version check routines.
2
2
   Copyright (C) 2000 Werner Koch (dd9jn)
3
 
   Copyright (C) 2001, 2002, 2003, 2004, 2005 g10 Code GmbH
 
3
   Copyright (C) 2001, 2002, 2003, 2004, 2005, 2007 g10 Code GmbH
4
4
 
5
5
   This file is part of GPGME.
6
6
 
25
25
#include <string.h>
26
26
#include <limits.h>
27
27
#include <ctype.h>
 
28
#ifdef HAVE_W32_SYSTEM
 
29
#include <winsock2.h>
 
30
#endif
28
31
 
29
32
#include "gpgme.h"
30
33
#include "priv-io.h"
 
34
#include "debug.h"
31
35
 
32
36
/* For _gpgme_sema_subsystem_init ().  */
33
37
#include "sema.h"
34
38
 
 
39
#ifdef HAVE_ASSUAN_H
 
40
#include "assuan.h"
 
41
#endif
 
42
 
35
43
 
36
44
/* Bootstrap the subsystems needed for concurrent operation.  This
37
45
   must be done once at startup.  We can not guarantee this using a
38
46
   lock, though, because the semaphore subsystem needs to be
39
47
   initialized itself before it can be used.  So we expect that the
40
 
   user performs the necessary syncrhonization.  */
 
48
   user performs the necessary synchronization.  */
41
49
static void
42
50
do_subsystem_inits (void)
43
51
{
47
55
    return;
48
56
 
49
57
  _gpgme_sema_subsystem_init ();
 
58
#ifdef HAVE_ASSUAN_H
 
59
  assuan_set_assuan_log_level (0);
 
60
  assuan_set_assuan_err_source (GPG_ERR_SOURCE_GPGME);
 
61
#endif /*HAVE_ASSUAN_H*/
 
62
  _gpgme_debug_subsystem_init ();
 
63
#if defined(HAVE_W32_SYSTEM) && defined(HAVE_ASSUAN_H)
50
64
  _gpgme_io_subsystem_init ();
 
65
  /* We need to make sure that the sockets are initialized.  */
 
66
  {
 
67
    WSADATA wsadat;
 
68
    
 
69
    WSAStartup (0x202, &wsadat);
 
70
  }
 
71
#endif /*HAVE_W32_SYSTEM && HAVE_ASSUAN_H*/
51
72
 
52
73
  done = 1;
53
74
}
152
173
gpgme_check_version (const char *req_version)
153
174
{
154
175
  do_subsystem_inits ();
 
176
 
 
177
  /* Catch-22: We need to get at least the debug subsystem ready
 
178
     before using the tarce facility.  If we won't the tarce would
 
179
     automagically initialize the debug system with out the locks
 
180
     being initialized and missing the assuan log level setting. */
 
181
  TRACE2 (DEBUG_INIT, "gpgme_check_version: ", 0,
 
182
          "req_version=%s, VERSION=%s", req_version, VERSION);
 
183
 
155
184
  return _gpgme_compare_versions (VERSION, req_version) ? VERSION : NULL;
156
185
}
157
186
 
200
229
          mark = strchr (&line[linelen], '\n');
201
230
          if (mark)
202
231
            {
 
232
              if (mark > &line[0] && *mark == '\r')
 
233
                mark--;
203
234
              *mark = '\0';
204
235
              break;
205
236
            }