1 /****************************************************************************
5 * Purpose: Helper functions for common interfaces using UFFI
6 * Programmer: Kevin M. Rosenberg
7 * Date Started: Mar 2002
9 * $Id: clsql-uffi.c,v 1.1 2002/08/01 03:06:27 kevin Exp $
11 * This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg
13 * CLSQL users are granted the rights to distribute and use this software
14 * as governed by the terms of the Lisp Lesser GNU Public License
15 * (http://opensource.franz.com/preamble.html), also known as the LLGPL.
16 ***************************************************************************/
21 BOOL WINAPI DllEntryPoint(HINSTANCE hinstdll, DWORD fdwReason,
27 #define DLLEXPORT __declspec(dllexport)
34 const unsigned int bitmask_32bits = 0xFFFFFFFF;
35 #define lower_32bits(int64) ((unsigned int) int64 & bitmask_32bits)
36 #define upper_32bits(int64) ((unsigned int) (int64 >> 32))
38 /* Reads a 64-bit integer string, returns result as two 32-bit integers */
42 atol64 (const unsigned char* str, int* pHigh32)
50 int first_char = *str;
51 if (first_char == '+')
53 else if (first_char == '-') {
60 if (i < 0 || i > 9) /* Non-numeric character -- quit */
62 result = i + (10 * result);
68 *pHigh32 = upper_32bits(result);
69 return lower_32bits(result);