2010-11-03 Werner Koch <wk@g10code.com>
+ * debug.c (_gpgme_debug) [W32CE]: Replace locatime by GetLocalTime.
+
+ * signers.c (gpgme_signers_clear): Remove useless return.
+ Reported by Patrick Spendrin.
+
+ * w32-util.c: s/__inline__/GPG_ERR_INLINE/
+
* setenv.c: Include string.h due to our strerror replacement.
- * w32-ce.h (access): New macro.
+ * w32-ce.h (access, bsearch): New macros.
* w32-ce.c (_gpgme_wince_access): New.
(RegQueryValueExA): Change DATA to a void*.
+ (_gpgme_wince_bsearch): New. Taken from glibc 2.6.
Guard include of sys/stat.h and sys/types.h.
va_start (arg_ptr, format);
LOCK (debug_lock);
{
+#ifdef HAVE_W32CE_SYSTEM
+ SYSTEMTIME t;
+
+ GetLocalTime (&t);
+ fprintf (errfp, "GPGME %04d-%02d-%02d %02d:%02d:%02d <0x%04llx> ",
+ t.wYear, t.wMonth, t.wDay,
+ t.wHour, t.wMinute, t.wSecond,
+ (unsigned long long) ath_self ());
+#else
struct tm *tp;
time_t atime = time (NULL);
1900+tp->tm_year, tp->tm_mon+1, tp->tm_mday,
tp->tm_hour, tp->tm_min, tp->tm_sec,
(unsigned long long) ath_self ());
+#endif
}
#ifdef FRAME_NR
{
gpgme_signers_clear (gpgme_ctx_t ctx)
{
TRACE (DEBUG_CTX, "gpgme_signers_clear", ctx);
- return _gpgme_signers_clear (ctx);
+ _gpgme_signers_clear (ctx);
}
/* w32-ce.h
Copyright (C) 2010 g10 Code GmbH
+ Copyright (C) 1991,92,97,2000,02 Free Software Foundation, Inc.
This file is part of GPGME.
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
- License along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- 02111-1307, USA. */
+ License along with this program; if not, see <http://www.gnu.org/licenses/>.
+ */
#ifdef HAVE_CONFIG_H
#include <config.h>
}
return 0;
}
+
+
+/* Perform a binary search for KEY in BASE which has NMEMB elements
+ of SIZE bytes each. The comparisons are done by (*COMPAR)().
+ Code taken from glibc-2.6. */
+void *
+_gpgme_wince_bsearch (const void *key, const void *base,
+ size_t nmemb, size_t size,
+ int (*compar) (const void *, const void *))
+{
+ size_t l, u, idx;
+ const void *p;
+ int comparison;
+
+ l = 0;
+ u = nmemb;
+ while (l < u)
+ {
+ idx = (l + u) / 2;
+ p = (void *) (((const char *) base) + (idx * size));
+ comparison = (*compar) (key, p);
+ if (comparison < 0)
+ u = idx;
+ else if (comparison > 0)
+ l = idx + 1;
+ else
+ return (void *) p;
+ }
+
+ return NULL;
+}
+
int _gpgme_wince_access (const char *fname, int mode);
#define access(a,b) _gpgme_wince_access ((a), (b))
+void *_gpgme_wince_bsearch (const void *key, const void *base,
+ size_t nmemb, size_t size,
+ int (*compar) (const void *, const void *));
+#define bsearch(a,b,c,d,e) _gpgme_wince_bsearch ((a),(b),(c),(d),(e))
+
#endif /* GPGME_W32_CE_H */
#define RTLD_LAZY 0
-static __inline__ void *
+static GPG_ERR_INLINE void *
dlopen (const char * name, int flag)
{
void * hd = LoadLibrary (name);
return hd;
}
-static __inline__ void *
+static GPG_ERR_INLINE void *
dlsym (void * hd, const char * sym)
{
if (hd && sym)
return NULL;
}
-static __inline__ int
+static GPG_ERR_INLINE int
dlclose (void * hd)
{
if (hd)