~ubuntu-branches/ubuntu/saucy/gnutls28/saucy

« back to all changes in this revision

Viewing changes to lib/system.h

  • Committer: Package Import Robot
  • Author(s): Jeremy Bicha
  • Date: 2013-07-30 21:40:07 UTC
  • mfrom: (14.1.9 saucy-proposed)
  • Revision ID: package-import@ubuntu.com-20130730214007-9mrd08xo61kla008
Tags: 3.2.3-1ubuntu1
* Sync with Debian (LP: #1068029). Remaining change:
  - Drop gnutls-bin and -doc since we want to use the versions
    in gnutls26 as the defaults instead

Show diffs side-by-side

added added

removed removed

Lines of Context:
7
7
 *
8
8
 * The GnuTLS is free software; you can redistribute it and/or
9
9
 * modify it under the terms of the GNU Lesser General Public License
10
 
 * as published by the Free Software Foundation; either version 3 of
 
10
 * as published by the Free Software Foundation; either version 2.1 of
11
11
 * the License, or (at your option) any later version.
12
12
 *
13
13
 * This library is distributed in the hope that it will be useful, but
24
24
#define SYSTEM_H
25
25
 
26
26
#include <gnutls_int.h>
 
27
#include <time.h>
 
28
#include <sys/time.h>
27
29
 
28
30
#ifndef _WIN32
29
31
# include <sys/uio.h>            /* for writev */
61
63
#ifdef _WIN32
62
64
  Sleep(ms);
63
65
#else
64
 
struct timespec ts;
 
66
  struct timespec ts;
 
67
 
65
68
  ts.tv_sec = 0;
66
69
  ts.tv_nsec = ms*1000*1000;
67
70
  
69
72
#endif
70
73
}
71
74
 
 
75
/* emulate gnulib's gettime using gettimeofday to avoid linking to
 
76
 * librt */
 
77
inline static void
 
78
gettime (struct timespec *t)
 
79
{
 
80
#if defined(HAVE_CLOCK_GETTIME) && defined(CLOCK_REALTIME)
 
81
  clock_gettime (CLOCK_REALTIME, t);
 
82
#else
 
83
struct timeval tv;
 
84
  gettimeofday (&tv, NULL);
 
85
  t->tv_sec = tv.tv_sec;
 
86
  t->tv_nsec = tv.tv_usec * 1000;
 
87
#endif
 
88
}
 
89
 
72
90
int _gnutls_find_config_path(char* path, size_t max_size);
 
91
int _gnutls_ucs2_to_utf8(const void* data, size_t size, gnutls_datum_t *output);
 
92
 
 
93
int gnutls_system_global_init (void);
 
94
void gnutls_system_global_deinit (void);
73
95
 
74
96
#endif /* SYSTEM_H */