home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 1997 January
/
Chip_1997-01_cd.bin
/
ms95
/
disk22
/
dir04
/
f012850.re_
/
f012850.re
Wrap
Text File
|
1996-04-02
|
6KB
|
198 lines
/*----------------------------------------------------------------------+
| |
| Copyright (1992) Bentley Systems, Inc., All rights reserved. |
| |
| "MicroStation", "MDL", and "MicroCSL" are trademarks of Bentley |
| Systems, Inc. |
| |
| Limited permission is hereby granted to reproduce and modify this |
| copyrighted material provided that the resulting code is used only |
| in conjunction with Bentley Systems products under the terms of the |
| license agreement provided therein, and that this notice is retained |
| in its entirety in any such reproduction or modification. |
| |
+----------------------------------------------------------------------*/
/*----------------------------------------------------------------------+
| |
| Current Revision: |
| $Workfile: stdlib.h $
| $Revision: 6.3 $ $Date: 07 Mar 1995 12:22:02 $
| |
+----------------------------------------------------------------------*/
#if !defined (mdl)
#error This file is intended for MDL only
#endif
#if !defined (__stdlibH__)
#define __stdlibH__
#include "widechar.h"
/*----------------------------------------------------------------------+
| |
| Defines |
| |
+----------------------------------------------------------------------*/
/* const and volatile are not supported by the MDL compiler */
#if !defined (const)
# define const
# define volatile
#endif
/* The function call "exit (EXIT_FAILURE)" causes MicroStation to
unload the MDL program and display a message. The function call
"exit (EXIT_SUCCESS)" causes MicroStation to unload the MDL program
without displaying a message.
*/
#define EXIT_FAILURE 1
#define EXIT_SUCCESS 0
/*----------------------------------------------------------------------+
| |
| Typedefs |
| |
+----------------------------------------------------------------------*/
#if !defined (__SIZE_T)
# define __SIZE_T
typedef unsigned int size_t;
#endif
#if !defined (__DIV_T)
# define __DIV_T
typedef struct
{
int quot; /* quotient */
int rem; /* remainder */
} div_t;
typedef struct
{
long quot; /* quotient */
long rem; /* remainder */
} ldiv_t;
#endif
#if !defined (RAND_MAX)
# if defined (hp700) || defined (sparc) || defined (macintosh) || \
defined (winNT) || defined (rs6000) || defined (sgimips) || \
defined(SolarisX86) || defined (os2)
# define RAND_MAX 32767
# elif defined (clipper)
# define RAND_MAX (2029052025-1)
# elif defined (pm386) || defined (vax)
# define RAND_MAX 2147483647
# else
# error RAND_MAX is not defined for this platform
# endif
#endif
/*----------------------------------------------------------------------+
| |
| Functions |
| |
+----------------------------------------------------------------------*/
double atof (const char *);
int atoi (const char *);
long int atol (const char *);
double strtod (const char *, char **);
long int strtol (const char *, char **, int);
unsigned long strtoul(const char *, char **, int);
int rand (void);
void srand (unsigned int);
void *calloc(size_t, size_t);
void *malloc(size_t);
void *realloc(void *, size_t);
void free (void *);
void abort (void);
void exit (int);
/* atexit is not currently supported by MDL. See the function
mdlSystem_setFunction for information on setting up
an UNLOAD user hook.
*/
char *getenv(const char *);
/* putenv is only available on systems where the underlying
operating system supports it. It is not an ANSI-standard
function. MDL programs should use mdlSystem_putenv or one of
the mdlSystem_ cfgVar symbols.
*/
int putenv (char *);
/* The function "system" is not available.
The function system was added in MicroStation release 4.2.
See mdlExternal_startProgram and mdlExternal_wait for equivalent
functionality for starting external programs. See the
mdlSystem_start... functions for starting ther MDL programs.
*/
/* The function qsort was added in MicroStation release 4.2.
See the functions mdlUtil_quickSort, mdlUtil_sortDoubles,
mdlUtil_sortLongs, and mdlUtil_sortStrings for replacements for
qsort. mdlUtil_sortDoubles, mdlUtil_sortLongs, mdlUtil_sortStrings
are all faster the qsort since they do not use any MDL code to
perform the sort.
*/
void qsort (void *baseP, size_t members, size_t sizeMember,
int (*compareFunc)(void *, void *));
/* The function bsearch was added in MicroStation release 4.2 */
void *bsearch (void *key, void *base, size_t members,
size_t sizeMember, int (*compareFunc)(void *, void *));
int abs (int);
/* div and ldiv are not supported because MDL does not support returning
structures. */
#if 0
div_t div (int, int);
ldiv_t ldiv (long int, long int);
#endif
long int labs(long int);
/* Common extensions */
char *getcwd (char *bufP, size_t size);
int access (char *pathP, int mode);
int mblen(const char *, size_t);
int mbtowc /* <= # of bytes converted, -1 means error */
(
MSWideChar *wchar, /* <= ptr to wide char */
char *mbchar, /* => ptr to mb char to convert */
size_t maxLen /* => max bytes of multibyte char */
);
int wctomb /* <= # of bytes stored, -1 means error */
(
char *mbchar, /* <= buffer to store converted mb char */
int wchar /* => wide char to convert */
);
size_t mbstowcs /* <= # of wide characters stored in wcs */
(
MSWideChar *wcs, /* <= converted wide character string */
char *mbs, /* => multibyte character string to convert */
size_t n /* => number of characters in wcs */
);
size_t wcstombs /* <= # of bytes stored in mbs */
(
char *mbs, /* <= converted multibyte character string */
MSWideChar *wcs, /* => wide character string to convert */
size_t n /* => number of bytes in mbs */
);
#endif