From 2ddfecbc5164ca5189dbab8c79ae84e96f3c3ac2 Mon Sep 17 00:00:00 2001 From: Stef Walter Date: Mon, 28 May 2007 19:24:02 +0000 Subject: Use 'Stef' instead of 'Nate' --- AUTHORS | 2 +- COPYING | 2 +- ChangeLog | 8 +++++++- configure.in | 4 +--- module/cryptoki-constants.c | 4 ++-- module/cryptoki-log.c | 32 ++++++++++++++++++++------------ pkcs11/Makefile.am | 3 ++- 7 files changed, 34 insertions(+), 21 deletions(-) diff --git a/AUTHORS b/AUTHORS index d2c98a6..b716995 100644 --- a/AUTHORS +++ b/AUTHORS @@ -1,2 +1,2 @@ -Nate Nielsen +Stefan Walter diff --git a/COPYING b/COPYING index 763af15..63bdb16 100644 --- a/COPYING +++ b/COPYING @@ -1,5 +1,5 @@ -Copyright (c) 2004, Nate Nielsen +Copyright (c) 2004, Stefan Walter All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/ChangeLog b/ChangeLog index b5e5541..d3935b6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1 +1,7 @@ -0.1 - Initial Release +0.2 + - Works on Win32 + - Use my real name 'Stef Walter' + See: http://memberwebs.com/nielsen/ + +0.1 + - Initial Release diff --git a/configure.in b/configure.in index 5950e91..7b9f3b0 100644 --- a/configure.in +++ b/configure.in @@ -1,7 +1,5 @@ - -/* TODO: Replace with our own header */ AC_INIT(module/cryptoki-log.c) -AM_INIT_AUTOMAKE(cryptoki-log, 0.1) +AM_INIT_AUTOMAKE(cryptoki-log, 0.2) AC_CONFIG_HEADERS(config.h) AM_PROG_LIBTOOL diff --git a/module/cryptoki-constants.c b/module/cryptoki-constants.c index 8085421..d13488f 100644 --- a/module/cryptoki-constants.c +++ b/module/cryptoki-constants.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Nate Nielsen + * Copyright (c) 2007, Stefan Walter * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -32,7 +32,7 @@ * * * CONTRIBUTORS - * Nate Nielsen + * Stef Walter * */ diff --git a/module/cryptoki-log.c b/module/cryptoki-log.c index 7084ae8..f6555f5 100644 --- a/module/cryptoki-log.c +++ b/module/cryptoki-log.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Nate Nielsen + * Copyright (c) 2007, Stefan Walter * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -32,7 +32,7 @@ * * * CONTRIBUTORS - * Nate Nielsen + * Stef Walter * */ @@ -96,8 +96,8 @@ static FILE* output_file = NULL; #define PREFIX "PKCS11: " #define PREFIX_LEN (sizeof(PREFIX) - 1) -static char win32_line_buf_full[LINE_BUF_LEN + PREFIX_LEN] = { 0, }; -static char* win32_line_buf = win32_line_buf_full + PREFIX_LEN; +static char the_line_buf_full[LINE_BUF_LEN + PREFIX_LEN] = { 0, }; +static char* the_line_buf = the_line_buf_full + PREFIX_LEN; static void cklog_line(const char* line) @@ -127,29 +127,33 @@ cklog(const char* msg, ...) va_start (va, msg); /* Fill in the prefix if necessary */ - if(!win32_line_buf_full[0]) - memcpy(win32_line_buf_full, PREFIX, PREFIX_LEN); + if(!the_line_buf_full[0]) + memcpy(the_line_buf_full, PREFIX, PREFIX_LEN); /* Length of data already present */ - l = strlen(win32_line_buf); + l = strlen(the_line_buf); /* Line is just too long? */ if(l >= 2048) l = 0; /* Print into the buffer */ - _vsnprintf(win32_line_buf + l, LINE_BUF_LEN - l, msg, va); - win32_line_buf[LINE_BUF_LEN - 1] = 0; +#ifdef _WIN32 + _vsnprintf(the_line_buf + l, LINE_BUF_LEN - l, msg, va); +#else + snprintf(the_line_buf + l, LINE_BUF_LEN - l, msg, va); +#endif + the_line_buf[LINE_BUF_LEN - 1] = 0; va_end (va); /* Now send out all lines from the buffer */ - while((p = strchr(win32_line_buf, '\n')) != NULL) { + while((p = strchr(the_line_buf, '\n')) != NULL) { ch = p[1]; p[1] = 0; - cklog_line(win32_line_buf_full); + cklog_line(the_line_buf_full); p[1] = ch; - memmove(win32_line_buf, p + 1, LINE_BUF_LEN - ((p + 1) - win32_line_buf)); + memmove(the_line_buf, p + 1, LINE_BUF_LEN - ((p + 1) - the_line_buf)); } } @@ -1660,7 +1664,11 @@ static struct CK_FUNCTION_LIST functionList = { CL_C_WaitForSlotEvent }; +#ifdef _WIN32 __declspec(dllexport) CK_RV +#else +CK_RV +#endif C_GetFunctionList (CK_FUNCTION_LIST_PTR_PTR list) { if (!list) diff --git a/pkcs11/Makefile.am b/pkcs11/Makefile.am index b3598ba..a96c5db 100644 --- a/pkcs11/Makefile.am +++ b/pkcs11/Makefile.am @@ -1,6 +1,7 @@ EXTRA_DIST = \ - cryptoki.h \ + cryptoki-win32.h \ + cryptoki-unix.h \ pkcs11.h \ pkcs11f.h \ pkcs11t.h \ -- cgit v1.2.3