Synchronet now requires the libarchive development package (e.g. libarchive-dev on Debian-based Linux distros, libarchive.org for more info) to build successfully.

ODUtil.h 2.75 KB
Newer Older
rswindell's avatar
rswindell committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
/* OpenDoors Online Software Programming Toolkit
 * (C) Copyright 1991 - 1999 by Brian Pirie.
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
Deucе's avatar
Deucе committed
16
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
rswindell's avatar
rswindell committed
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66
 *
 *
 *        File: ODUtil.h
 *
 * Description: Contains prototypes and definitions for use by non-platform
 *              specific utility functions. These functions are implemented in
 *              odutil.c. Platform-specific utility functions are defined in
 *              odplat.h, and implemented in odplat.c.
 *
 *   Revisions: Date          Ver   Who  Change
 *              ---------------------------------------------------------------
 *              Nov 01, 1994  6.00  BP   Created.
 *              Dec 31, 1994  6.00  BP   Added ODMakeFilename().
 *              Nov 13, 1995  6.00  BP   32-bit portability.
 *              Nov 23, 1995  6.00  BP   Added ODDWordDivide().
 *              Nov 23, 1995  6.00  BP   Added ODDStringHasTail().
 *              Nov 23, 1995  6.00  BP   Added ODFileSize().
 *              Feb 19, 1996  6.00  BP   Changed version number to 6.00.
 *              Mar 03, 1996  6.10  BP   Begin version 6.10.
 *              Mar 06, 1996  6.10  BP   Added ODDWordMultiply().
 */

#ifndef _INC_ODUTIL
#define _INC_ODUTIL

#include "ODGen.h"
#include "ODTypes.h"
#include "OpenDoor.h"

/* General string manipulation functions. */
void ODStringCopy(char *pszDest, CONST char *pszSource, INT nSizeofDest);
char *ODStringCToPascal(char *psPascalString, BYTE btMaxPascalLength,
   char *pszCString);
char *ODStringPascalToC(char *pszCString, char *psPascalString,
   BYTE btMaxLength);
BOOL ODStringHasTail(char *pszFullString, char *pszTail);

/* File-related functions. */
tODResult ODMakeFilename(char *pszOut, CONST char *pszPath,
   CONST char *pszFilename, INT nMaxOutSize);
DWORD ODFileSize(FILE *pfFile);

/* DWORD math functions. */
DWORD ODDWordShiftLeft(DWORD dwValue, BYTE btDistance);
DWORD ODDWordShiftRight(DWORD dwValue, BYTE btDistance);
BOOL ODDWordDivide(DWORD *pdwQuotient, DWORD *pdwRemainder,
   DWORD dwDividend, DWORD dwDivisor);
DWORD ODDWordMultiply(DWORD dwMultiplicand, DWORD dwMultiplier);

#endif /* !_INC_ODUTIL */