Gamestudio Links
Zorro Links
Newest Posts
Blobsculptor tools and objects download here
by NeoDumont. 03/28/24 03:01
Issue with Multi-Core WFO Training
by aliswee. 03/24/24 20:20
Why Zorro supports up to 72 cores?
by Edgar_Herrera. 03/23/24 21:41
Zorro Trader GPT
by TipmyPip. 03/06/24 09:27
VSCode instead of SED
by 3run. 03/01/24 19:06
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (degenerate_762), 1,114 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
sakolin, rajesh7827, juergen_wue, NITRO_FOREVER, jack0roses
19043 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
msvcrt DLL #116009
03/08/07 13:36
03/08/07 13:36
Joined: Jul 2006
Posts: 783
London, UK
sheefo Offline OP
User
sheefo  Offline OP
User

Joined: Jul 2006
Posts: 783
London, UK
I have look at adding API function to lite-C and I have come up with this list of API function from the msvcrt DLL.

Of course you can use this code free of charge. I do not know if this is the best way to do it, but it works for me. I have noticed that so many people asked for functions like 'sprintf' and FILE commands like 'fopen' to 'fclose'.

This is all (compatable) functions from the DLL which should be in the Windows System32 folder.

People, please reply if you use it. I will like to know if you find this useful. I would like to know how to improve it!

... So do I get Lite-C free now...? lol!

Code:

/*
MSVCRT DLL - API Functions
By Sheefo :)
*/
#ifndef MSVCRT_LIB
#define MSVCRT_LIB

#define EOF (-1)
#define RAND_MAX 65535

/* Seek method constants */
#define SEEK_CUR 1
#define SEEK_END 2
#define SEEK_SET 0

typedef long size_t;
typedef int fpos_t;

typedef struct {
char *_ptr;
int _cnt;
char *_base;
int _flag;
int _file;
int _charbuf;
int _bufsiz;
char *_tmpfname;
} FILE;
FILE *stderr, *stdin, *stdout;

typedef struct {
int quot, rem;
} div_t;
typedef struct {
long quot, rem;
} ldiv_t;

////////////////////////////////////////////////////////////
// Function prototype declarations
////////////////////////////////////////////////////////////
double __cdecl abs (double);
double __cdecl acos (double);
double __cdecl asin (double);
double __cdecl atan (double);
double __cdecl atan2 (double, double);
double __cdecl atof (char *);
int __cdecl atoi (char *);
long __cdecl atol (char *);
void * __cdecl calloc (size_t, size_t);
double __cdecl ceil (double);
void __cdecl clearerr (FILE *);
double __cdecl cos (double);
double __cdecl cosh (double);
div_t __cdecl div (int, int);
double __cdecl exp (double);
double __cdecl fabs (double);
int __cdecl fclose (FILE *);
int __cdecl feof (FILE *);
int __cdecl ferror (FILE *);
int __cdecl fflush (FILE *);
int __cdecl fgetc (FILE *);
int __cdecl fgetpos (FILE *, fpos_t*);
char * __cdecl fgets (char *, int, FILE *);
double __cdecl floor (double);
double __cdecl fmod (double, double);
FILE * __cdecl fopen (char *, char *);
int __cdecl fprintf (FILE *, char *, ...);
int __cdecl fputc (int, FILE *);
int __cdecl fputs (char *, FILE *);
size_t __cdecl fread (void *, size_t, size_t, FILE *);
void __cdecl free (void *);
FILE * __cdecl freopen (char *, char *, FILE *);
double __cdecl frexp (double, int*);
int __cdecl fscanf (FILE *, char *, ...);
int __cdecl fseek (FILE *, long, int);
int __cdecl fsetpos (FILE *, fpos_t*);
long __cdecl ftell (FILE *);
size_t __cdecl fwrite (void *, size_t, size_t, FILE *);
int __cdecl getc (FILE *);
int __cdecl getchar (void);
char * __cdecl getenv (char *);
char * __cdecl gets (char *);
int __cdecl isalnum (int);
int __cdecl isalpha (int);
int __cdecl iscntrl (int);
int __cdecl isdigit (int);
int __cdecl islower (int);
int __cdecl isprint (int);
int __cdecl ispunct (int);
int __cdecl isspace (int);
int __cdecl isupper (int);
long __cdecl labs (long);
double __cdecl ldexp (double, int);
ldiv_t __cdecl ldiv (long, long);
double __cdecl log (double);
double __cdecl log10 (double);
void * __cdecl malloc (size_t);
void * __cdecl memchr (void *, int, size_t);
int __cdecl memcmp (void *, void *, size_t);
void * __cdecl memcpy (void *, void *, size_t);
void * __cdecl memmove (void *, void *, size_t);
void * __cdecl memset (void *, int, size_t);
double __cdecl modf (double, double*);
void __cdecl perror (char *);
double __cdecl pow (double, double);
int __cdecl putc (int, FILE *);
int __cdecl putchar (int);
int __cdecl puts (char *);
int __cdecl rand (void);
void * __cdecl realloc (void *, size_t);
int __cdecl remove (char *);
int __cdecl rename (char *, char *);
void __cdecl rewind (FILE *);
int __cdecl scanf (char *, ...);
void __cdecl setbuf (FILE *, char *);
int __cdecl setvbuf (FILE *, char *, int, size_t);
double __cdecl sin (double);
double __cdecl sinh (double);
int __cdecl sprintf (char *, char *, ...);
double __cdecl sqrt (double);
void __cdecl srand (int);
int __cdecl sscanf (char *, char *, ...);
char * __cdecl strcat (char *, char *);
char * __cdecl strchr (char *, int);
int __cdecl strcmp (char *, char *);
int __cdecl strcoll (char *, char *);
char * __cdecl strcpy (char *, char *);
size_t __cdecl strcspn (char *, char *);
char * __cdecl strerror (int);
size_t __cdecl strlen (char *);
char * __cdecl strncat (char *, char *, size_t);
int __cdecl strncmp (char *, char *, size_t);
char * __cdecl strncpy (char *, char *, size_t);
char * __cdecl strpbrk (char *, char *);
char * __cdecl strrchr (char *, int);
size_t __cdecl strspn (char *, char *);
char * __cdecl strstr (char *, char *);
char * __cdecl strtok (char *, char *);
size_t __cdecl strxfrm (char *, char *, size_t);
double __cdecl strtod (char *, char **);
char * __cdecl strtok (char *, char *);
long __cdecl strtol (char *, char **, int);
double __cdecl tan (double);
double __cdecl tanh (double);
FILE * __cdecl tmpfile (void);
char * __cdecl tmpnam (char *);
int __cdecl tolower (int);
int __cdecl toupper (int);
int __cdecl ungetc (int, FILE *);

void msvcrt()
{
abs = DefineApi("msvcrt!abs");
acos = DefineApi("msvcrt!acos");
asin = DefineApi("msvcrt!asin");
atan = DefineApi("msvcrt!atan");
atan2 = DefineApi("msvcrt!atan2");
atof = DefineApi("msvcrt!atof");
atoi = DefineApi("msvcrt!atoi");
atol = DefineApi("msvcrt!atol");
calloc = DefineApi("msvcrt!calloc");
ceil = DefineApi("msvcrt!ceil");
clearerr = DefineApi("msvcrt!clearerr");
cos = DefineApi("msvcrt!cos");
cosh = DefineApi("msvcrt!cosh");
div = DefineApi("msvcrt!div");
exp = DefineApi("msvcrt!exp");
fabs = DefineApi("msvcrt!fabs");
fclose = DefineApi("msvcrt!fclose");
feof = DefineApi("msvcrt!feof");
ferror = DefineApi("msvcrt!ferror");
fflush = DefineApi("msvcrt!fflush");
fgetc = DefineApi("msvcrt!fgetc");
fgetpos = DefineApi("msvcrt!fgetpos");
fgets = DefineApi("msvcrt!fgets");
floor = DefineApi("msvcrt!floor");
fmod = DefineApi("msvcrt!fmod");
fopen = DefineApi("msvcrt!fopen");
fprintf = DefineApi("msvcrt!fprintf");
fputc = DefineApi("msvcrt!fputc");
fputs = DefineApi("msvcrt!fputs");
fread = DefineApi("msvcrt!fread");
free = DefineApi("msvcrt!free");
freopen = DefineApi("msvcrt!freopen");
frexp = DefineApi("msvcrt!frexp");
fscanf = DefineApi("msvcrt!fscanf");
fseek = DefineApi("msvcrt!fseek");
fsetpos = DefineApi("msvcrt!fsetpos");
ftell = DefineApi("msvcrt!ftell");
fwrite = DefineApi("msvcrt!fwrite");
getc = DefineApi("msvcrt!getc");
getchar = DefineApi("msvcrt!getchar");
getenv = DefineApi("msvcrt!getenv");
gets = DefineApi("msvcrt!gets");
isalnum = DefineApi("msvcrt!isalnum");
isalpha = DefineApi("msvcrt!isalpha");
iscntrl = DefineApi("msvcrt!iscntrl");
isdigit = DefineApi("msvcrt!isdigit");
islower = DefineApi("msvcrt!islower");
isprint = DefineApi("msvcrt!isprint");
ispunct = DefineApi("msvcrt!ispunct");
isspace = DefineApi("msvcrt!isspace");
isupper = DefineApi("msvcrt!isupper");
labs = DefineApi("msvcrt!labs");
ldexp = DefineApi("msvcrt!ldexp");
ldiv = DefineApi("msvcrt!ldiv");
log = DefineApi("msvcrt!log");
log10 = DefineApi("msvcrt!log10");
//malloc = DefineApi("msvcrt!malloc");
memchr = DefineApi("msvcrt!memchr");
memcmp = DefineApi("msvcrt!memcmp");
memcpy = DefineApi("msvcrt!memcpy");
memmove = DefineApi("msvcrt!memmove");
memset = DefineApi("msvcrt!memset");
modf = DefineApi("msvcrt!modf");
perror = DefineApi("msvcrt!perror");
pow = DefineApi("msvcrt!pow");
putc = DefineApi("msvcrt!putc");
putchar = DefineApi("msvcrt!putschar");
puts = DefineApi("msvcrt!puts");
rand = DefineApi("msvcrt!rand");
realloc = DefineApi("msvcrt!realloc");
remove = DefineApi("msvcrt!remove");
rename = DefineApi("msvcrt!rename");
rewind = DefineApi("msvcrt!rewind");
scanf = DefineApi("msvcrt!scanf");
setbuf = DefineApi("msvcrt!setbuf");
setvbuf = DefineApi("msvcrt!setvbuf");
sin = DefineApi("msvcrt!sin");
sinh = DefineApi("msvcrt!sinh");
sprintf = DefineApi("msvcrt!sprintf");
sqrt = DefineApi("msvcrt!sqrt");
srand = DefineApi("msvcrt!srand");
sscanf = DefineApi("msvcrt!sscanf");
strcat = DefineApi("msvcrt!strcat");
strchr = DefineApi("msvcrt!strchr");
strcmp = DefineApi("msvcrt!strcmp");
strcoll = DefineApi("msvcrt!strcoll");
strcpy = DefineApi("msvcrt!strcpy");
strcspn = DefineApi("msvcrt!strcspn");
strerror = DefineApi("msvcrt!strerror");
strlen = DefineApi("msvcrt!strlen");
strncat = DefineApi("msvcrt!strncat");
strncmp = DefineApi("msvcrt!strncmp");
strncpy = DefineApi("msvcrt!strncpy");
strpbrk = DefineApi("msvcrt!strpbrk");
strrchr = DefineApi("msvcrt!strrchr");
strspn = DefineApi("msvcrt!strspn");
strstr = DefineApi("msvcrt!strstr");
strtod = DefineApi("msvcrt!strtod");
strtok = DefineApi("msvcrt!strtok");
strtol = DefineApi("msvcrt!strtol");
strxfrm = DefineApi("msvcrt!strxfrm");
tan = DefineApi("msvcrt!tan");
tanh = DefineApi("msvcrt!tanh");
tmpfile = DefineApi("msvcrt!tmpfile");
tmpnam = DefineApi("msvcrt!tmpnam");
tolower = DefineApi("msvcrt!tolower");
toupper = DefineApi("msvcrt!toupper");
ungetc = DefineApi("msvcrt!ungetc");
}
#endif



Re: msvcrt DLL [Re: sheefo] #116010
03/08/07 16:20
03/08/07 16:20
Joined: Apr 2006
Posts: 1,551
Netherlands
D3D Offline
Serious User
D3D  Offline
Serious User

Joined: Apr 2006
Posts: 1,551
Netherlands
Sheefo:

Why not make a workshop. Learn the newcommer howto do it on his/her own. Now we can use this and its useful too, but have not learned anything. I understand that one could look at the code and interpreted its working.

About getting Lite-C for free. Well i'm not Conitec and I know my words don't count or speak Conitec's mind, but I speak for myself and really think it can be good for educational purpose to learn others howto do these things in the future and make them work with Gamestudio.

Maybe its to much work, but is it possible that you show at least 1 function from whatever API which you like to see in Lite-C and the steps you had to take in order to get the function working?

For instance: If you gave me a model with cool animations and a nice skin it be wonderful. Only after some time the model becomes maybe a little boring and I want to have another, but your not there anymore What if you had not give me the model, instead made a workshop on howto make the model? I could have learned how to create models myself and when one got boring I just create another and another..


smile
Re: msvcrt DLL [Re: D3D] #116011
03/08/07 17:09
03/08/07 17:09
Joined: Jul 2006
Posts: 783
London, UK
sheefo Offline OP
User
sheefo  Offline OP
User

Joined: Jul 2006
Posts: 783
London, UK
I appreciate the idea. I am not an expert on adding API function to Lite-C, I just sort of stumbled across this. I really needed the function like ‘strcpy’ and ‘sprintf’, I have found use for ‘calloc’ and ‘realloc’. I was using these functions and I was happy, until I needed more so I thought why not include the whole DLL.

I guess your right. I think I will write a small “tutorial” on how to include your own API functions. I used the manual to get very limited information, I use the program it recommended to read all function from the DLL, and with that list I looked at a C++ reference (http://www.cplusplus.com/) for the arguments and structures needed for passing to functions. That’s about it actually, no need for a workshop

BTW, I would like to know how to submit a project to Conitec to get Lite-C for free. I don’t know how though. To be honest, I don’t have my own credit card, so I will have to beg my older brother (who I hardly see) to use it. I already did that to buy 3D GameStudio A6 Commercial a few months ago.

PS: I have used these API function to read/write bitmap files, my own file formats and even make debug logs. These function, I find are more than useful.

Re: msvcrt DLL [Re: sheefo] #116012
03/09/07 12:54
03/09/07 12:54
Joined: Jul 2000
Posts: 27,977
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,977
Frankfurt
Sheefo: Thanks for your contribution! You can submit a project by just posting a download link here. Lite-C for free was meant as a reward for demos, but of course you can also get it for good tutorials or other substantial lite-C contributions to the community. Merely adding standard DLL functions probably won't suffice, but a good tutorial in combination with adding a library that is useful but not-so-standard could get you a free version.

I also suggest to wait until the next lite-C update that supports the API() macro and won't need a starter function anymore for adding DLL functions. A definition in a .h file will suffice. This is the new lite-C stdio header:

Code:

///////////////////////////////////////////////////////////////////////
// lite-C header file for standard file / directory functions
//////////////////////////////////////////////////////////////////////
#ifndef stdio_h
#define stdio_h

// stdio.h //////////////////////////

typedef char* va_list;
typedef long fpos_t;
typedef long size_t;

struct _iobuf {
char *_ptr;
int _cnt;
char *_base;
int _flag;
int _file;
int _charbuf;
int _bufsiz;
char *_tmpfname;
};
typedef struct _iobuf FILE;

/* Seek method constants */

#define SEEK_CUR 1
#define SEEK_END 2
#define SEEK_SET 0

/* Declare _iob[] array */
FILE _iob[3];

#define stdin (&_iob[0])
#define stdout (&_iob[1])
#define stderr (&_iob[2])

#define _IOREAD 0x0001
#define _IOWRT 0x0002

#define _IOFBF 0x0000
#define _IOLBF 0x0040
#define _IONBF 0x0004

#define _IOMYBUF 0x0008
#define _IOEOF 0x0010
#define _IOERR 0x0020
#define _IOSTRG 0x0040
#define _IORW 0x0080
#define _IOAPPEND 0x0200


/* Function prototypes */

int __cdecl _filbuf(FILE *);
int __cdecl _flsbuf(int, FILE *);

FILE * __cdecl _fsopen(const char *, const char *, int);
void __cdecl clearerr(FILE *);

int __cdecl fclose(FILE *);
int __cdecl _fcloseall(void);

FILE * __cdecl _fdopen(int, const char *);

int __cdecl feof(FILE *);
int __cdecl ferror(FILE *);
int __cdecl fflush(FILE *);
int __cdecl fgetc(FILE *);
int __cdecl _fgetchar(void);
int __cdecl fgetpos(FILE *, fpos_t *);
char * __cdecl fgets(char *, int, FILE *);

int __cdecl _fileno(FILE *);
int __cdecl _flushall(void);

FILE * __cdecl fopen(const char *, const char *);
int __cdecl fprintf(FILE *, const char *, ...);
int __cdecl fputc(int, FILE *);
int __cdecl _fputchar(int);
int __cdecl fputs(const char *, FILE *);
size_t __cdecl fread(void *, size_t, size_t, FILE *);
FILE * __cdecl freopen(const char *, const char *, FILE *);
int __cdecl fscanf(FILE *, const char *, ...);
int __cdecl fsetpos(FILE *, const fpos_t *);
int __cdecl fseek(FILE *, long, int);
long __cdecl ftell(FILE *);
size_t __cdecl fwrite(const void *, size_t, size_t, FILE *);
int __cdecl getc(FILE *);
int __cdecl getchar(void);
int __cdecl _getmaxstdio(void);
char * __cdecl gets(char *);
int __cdecl _getw(FILE *);
void __cdecl perror(const char *);
int __cdecl _pclose(FILE *);
FILE * __cdecl _popen(const char *, const char *);
int __cdecl printf(const char *, ...);
int __cdecl putc(int, FILE *);
int __cdecl putchar(int);
int __cdecl puts(const char *);
int __cdecl _putw(int, FILE *);
int __cdecl remove(const char *);
int __cdecl rename(const char *, const char *);
void __cdecl rewind(FILE *);
int __cdecl _rmtmp(void);
int __cdecl scanf(const char *, ...);
void __cdecl setbuf(FILE *, char *);
int __cdecl _setmaxstdio(int);
int __cdecl setvbuf(FILE *, char *, int, size_t);
int __cdecl _snprintf(char *, size_t, const char *, ...);
int __cdecl sprintf(char *, const char *, ...);
int __cdecl _scprintf(const char *, ...);
int __cdecl sscanf(const char *, const char *, ...);
int __cdecl _snscanf(const char *, size_t, const char *, ...);
char * __cdecl _tempnam(const char *, const char *);
FILE * __cdecl tmpfile(void);
char * __cdecl tmpnam(char *);
int __cdecl ungetc(int, FILE *);
int __cdecl _unlink(const char *);
int __cdecl vfprintf(FILE *, const char *, va_list);
int __cdecl vprintf(const char *, va_list);
int __cdecl _vsnprintf(char *, size_t, const char *, va_list);
int __cdecl vsprintf(char *, const char *, va_list);
int __cdecl _vscprintf(const char *, va_list);


/* Macro definitions */

#define feof(_stream) ((_stream)->_flag & _IOEOF)
#define ferror(_stream) ((_stream)->_flag & _IOERR)
#define _fileno(_stream) ((_stream)->_file)

// io.h /////////////////////////////////////////

typedef long time_t; /* time value */
typedef long intptr_t;
typedef long _fsize_t;

typedef struct _finddata_t {
long attrib;
time_t time_create; /* -1 for FAT file systems */
time_t time_access; /* -1 for FAT file systems */
time_t time_write;
_fsize_t size;
char name[260];
} _finddata_t;

/* File attribute constants for _findfirst() */

#define _A_NORMAL 0x00 /* Normal file - No read/write restrictions */
#define _A_RDONLY 0x01 /* Read only file */
#define _A_HIDDEN 0x02 /* Hidden file */
#define _A_SYSTEM 0x04 /* System file */
#define _A_SUBDIR 0x10 /* Subdirectory */
#define _A_ARCH 0x20 /* Archive file */

/* function prototypes */

int __cdecl _access(const char *, int);
int __cdecl _chmod(const char *, int);
int __cdecl _chsize(int, long);
int __cdecl _close(int);
int __cdecl _commit(int);
int __cdecl _creat(const char *, int);
int __cdecl _dup(int);
int __cdecl _dup2(int, int);
int __cdecl _eof(int);
long __cdecl _filelength(int);
intptr_t __cdecl _findfirst(const char *, _finddata_t *);
int __cdecl _findnext(intptr_t, _finddata_t *);
int __cdecl _findclose(intptr_t);
int __cdecl _isatty(int);
int __cdecl _locking(int, int, long);
long __cdecl _lseek(int, long, int);
char * __cdecl _mktemp(char *);
int __cdecl _open(const char *, int, ...);
int __cdecl _pipe(int *, unsigned int, int);
int __cdecl _read(int, void *, unsigned int);
int __cdecl remove(const char *);
int __cdecl rename(const char *, const char *);
int __cdecl _setmode(int, int);
int __cdecl _sopen(const char *, int, int, ...);
long __cdecl _tell(int);
int __cdecl _umask(int);
int __cdecl _unlink(const char *);
int __cdecl _write(int, const void *, unsigned int);

// direct.h //////////////////////////////////////////////

typedef struct _diskfree_t {
long total_clusters;
long avail_clusters;
long sectors_per_cluster;
long bytes_per_sector;
} _diskfree_t;

/* function prototypes */

int __cdecl _chdir(const char *);
char * __cdecl _getcwd(char *, int);
int __cdecl _mkdir(const char *);
int __cdecl _rmdir(const char *);

int __cdecl _chdrive(int);
char * __cdecl _getdcwd(int, char *, int);
int __cdecl _getdrive(void);
long __cdecl _getdrives(void);
long __cdecl _getdiskfree(long, _diskfree_t *);

// Selected API functions ////////////////////////////////

API(_fsopen,msvcrt)
API(clearerr,msvcrt)
API(fclose,msvcrt)
API(_fcloseall,msvcrt)
API(_fdopen,msvcrt)
API(feof,msvcrt)
API(ferror,msvcrt)
API(fflush,msvcrt)
API(fgetc,msvcrt)
API(_fgetchar,msvcrt)
API(fgetpos,msvcrt)
API(fgets,msvcrt)
API(_fileno,msvcrt)
API(_flushall,msvcrt)
API(fopen,msvcrt)
API(fprintf,msvcrt)
API(fputc,msvcrt)
API(_fputchar,msvcrt)
API(fputs,msvcrt)
API(fread,msvcrt)
API(freopen,msvcrt)
API(fscanf,msvcrt)
API(fsetpos,msvcrt)
API(fseek,msvcrt)
API(ftell,msvcrt)
API(fwrite,msvcrt)
API(getc,msvcrt)
API(getchar,msvcrt)
API(_getmaxstdio,msvcrt)
API(gets,msvcrt)
API(_getw,msvcrt)
API(perror,msvcrt)
API(_pclose,msvcrt)
API(_popen,msvcrt)
API(printf,msvcrt)
API(putc,msvcrt)
API(putchar,msvcrt)
API(puts,msvcrt)
API(_putw,msvcrt)
API(remove,msvcrt)
API(rename,msvcrt)
API(rewind,msvcrt)
API(_rmtmp,msvcrt)
API(scanf,msvcrt)
API(setbuf,msvcrt)
API(_setmaxstdio,msvcrt)
API(setvbuf,msvcrt)
API(_snprintf,msvcrt)
API(sprintf,msvcrt)
API(_scprintf,msvcrt)
API(sscanf,msvcrt)
API(_snscanf,msvcrt)
API(_tempnam,msvcrt)
API(tmpfile,msvcrt)
API(tmpnam,msvcrt)
API(ungetc,msvcrt)
API(_unlink,msvcrt)
API(vfprintf,msvcrt)
API(vprintf,msvcrt)
API(_vsnprintf,msvcrt)
API(vsprintf,msvcrt)
API(_vscprintf,msvcrt)

API(_access,msvcrt)
API(_chmod,msvcrt)
API(_chsize,msvcrt)
API(_close,msvcrt)
API(_commit,msvcrt)
API(_creat,msvcrt)
API(_dup,msvcrt)
API(_dup2,msvcrt)
API(_eof,msvcrt)
API(_filelength,msvcrt)
API(_findfirst,msvcrt)
API(_findnext,msvcrt)
API(_findclose,msvcrt)
API(_isatty,msvcrt)
API(_locking,msvcrt)
API(_lseek,msvcrt)
API(_mktemp,msvcrt)
API(_open,msvcrt)
API(_pipe,msvcrt)
API(_read,msvcrt)
API(remove,msvcrt)
API(rename,msvcrt)
API(_setmode,msvcrt)
API(_sopen,msvcrt)
API(_tell,msvcrt)
API(_umask,msvcrt)
API(_unlink,msvcrt)
API(_write,msvcrt)

API(_chdir,msvcrt)
API(_getcwd,msvcrt)
API(_mkdir,msvcrt)
API(_rmdir,msvcrt)
API(_chdrive,msvcrt)
API(_getdcwd,msvcrt)
API(_getdrive,msvcrt)
API(_getdrives,msvcrt)
API(_getdiskfree,msvcrt)

#endif /* STDIO_H */



Re: msvcrt DLL [Re: jcl] #116013
03/09/07 18:35
03/09/07 18:35
Joined: Jul 2006
Posts: 783
London, UK
sheefo Offline OP
User
sheefo  Offline OP
User

Joined: Jul 2006
Posts: 783
London, UK
You’re amazing jcl, thank you. I really cannot wait until the next Lite-C release.

Perhaps I will work on making some form of tutorial, accompanied by some code. I find that the FILE struct functions (or whatever you call the I/O functions using the FILE struct) are very useful. I use them in my RTS to read all level data from my own filetype. I have a WMB with just a skycube, and the terrain and all entities are created in runtime, with their data attributes like health, attack and so on, are read byte by byte from the file.
I have even done the same thing using the bitmap file format.

PS: Looking at your code, does this mean that the next Lite-C release will contain the ‘const’ keyword? I need that so much.

Re: msvcrt DLL [Re: sheefo] #116014
03/24/07 02:07
03/24/07 02:07
Joined: Nov 2005
Posts: 94
Texas
3
3Dski Offline
Junior Member
3Dski  Offline
Junior Member
3

Joined: Nov 2005
Posts: 94
Texas
Sounds like you have a great little framework started... I'm impressed!

The const modifier is helpful as a reminder of what you don't want changed in LiteC, but I'm not sure what kind of checks LiteC would do. I've not tied const in 0.7, but now I think I will, just for my own curiousity.

I like the API() that will be incorporated. Sometimes the small things mean a lot!

Re: msvcrt DLL [Re: jcl] #116015
05/21/07 07:01
05/21/07 07:01
Joined: May 2002
Posts: 7,441
ventilator Offline
Senior Expert
ventilator  Offline
Senior Expert

Joined: May 2002
Posts: 7,441
Quote:

Merely adding standard DLL functions probably won't suffice, but a good tutorial in combination with adding a library that is useful but not-so-standard could get you a free version.


how about my newton example if i clean it up a bit? it shows how to use the newton.dll, how to use d3d matrices and how to convert between them and 3dgs eulers, how to use direct3d buffers and a few other things...


Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1