Does anyone know how to convert this simple line to Aurora ?
s_bitmap * loadbitmap(char *filename, char *packfile);
I may be wrong,
but what i understand is that a pointer "s_bitmap"
is passed to the loadbitmap() function.
But i also think that s_bitmap is the type that must be returned by the function
So to Aurora,
assuming that a char type can easily be replaced by a string type (not really sure though >:()
we may have :
Declare loadbitmap(char *filename, char *packfile),s_bitmap;
But if my suggestion is correct, What happened to the pointer that was passed to the function ???
I need a few explanations please :-\
thanks!
Simpler than you think. A pointer is returned from the function, and two pointers are passed. In reality two strings are passed.
declare loadbitmap(string filename, string packfile),pointer;
Thank you Paul!
But i am still a bit head ache ;D since i wonder why in C it is needed to pass the pointers to the strings and to the function,
I mean does the string type have a native pointer while the char type not ?
(weird question ) :-\
Edit : Also ,let's say that the declaration was : s_bitmap loadbitmap(char *filename, char *packfile);
Would it be this in Aurora ? : declare loadbitmap(string filename, string packfile),s_bitmap;
I am pretty sure of the answer but ,better searching for light by asking instead of remaining in doubt ;D
C doesn't have a native string type. It is handled by an array of CHAR and a pointer to that array is used.
Quote
Edit : Also ,let's say that the declaration was : s_bitmap loadbitmap(char *filename, char *packfile);
Then you would have to have the definition of the stucture s_bitmap. and it would be:
declare loadbitmap(string filename, string packfile),s_bitmap
QuoteThen you would have to have the definition of the stucture s_bitmap. and it would be:
declare loadbitmap(string filename, string packfile),s_bitmap
Yes , it is exacly what i have. :)
Thanks again!
I got One more troublesome line.This one is the kind of very troublesome LOL :
extern int __near joy_init(void);
What i understand is that there is a function which is "joy_init(void)" . ::)
Probably declared to return a data of int type .
But what "the hell" is " __near " ? :D
A variable , a structure , another type ???
And finally, what would be an equivalent for Aurora since i don't see anything by myself :-\
Thanks!
I think you can just leave it out. There's no Aurora equivalent, and I think that __near has to do with what kind of jump statements are emitted by the compiler.
LOL !!!
Thanks Parker!
There must be a way! :-\
__near is ignored in most modern C compilers. It has to to with memory segments and 16 bit code.
thanks Paul!
Things are clearer now!