![]() |
Mapper
0.9.0
API documentation
|
Functions | |
char * | my_strdup (const char *s) |
int | my_round (double x) |
const s32 * | ocad_point (s32 *buf, const OCADPoint *pt) |
Converts an OCAD point into a triplet of signed integers. More... | |
const s32 * | ocad_point2 (s32 **pbuf, const OCADPoint *pt) |
Converts an OCAD point into a triplet of signed integers like ocad_point(), but advances the buffer pointer by three elements. More... | |
const char * | ocad_str (char *buf, const str *ostr) |
Converts an OCAD string (0-255 characters) to a zero-terminated string in the given buffer. More... | |
const char * | ocad_str2 (char **pbuf, const str *ostr) |
Converts an OCAD string (0-255 characters) to a zero-terminated string in the given buffer, returns a pointer to the zero-terminated string, and advances the buffer point just beyond the zero byte. More... | |
void | ocad_to_real (s32 *from, double *to, u32 count) |
void | dump_bytes (u8 *base, u32 size) |
int my_round | ( | double | x | ) |
char* my_strdup | ( | const char * | s | ) |
Converts an OCAD point into a triplet of signed integers.
The first value is the x-coordinate, second is the y-coordinate, and the third is a set of flags. The buffer should have at least three elements (3 * sizeof(s32)), or 12 bytes. A pointer to the beginning of the buffer is returned.
Converts an OCAD point into a triplet of signed integers like ocad_point(), but advances the buffer pointer by three elements.
This allows the caller to accumulate a list of points in a single buffer.
const char* ocad_str | ( | char * | buf, |
const str * | ostr | ||
) |
Converts an OCAD string (0-255 characters) to a zero-terminated string in the given buffer.
The buffer must be at least 256 bytes long. A pointer to the zero-terminated string is returned.
const char* ocad_str2 | ( | char ** | buf, |
const str * | ostr | ||
) |
Converts an OCAD string (0-255 characters) to a zero-terminated string in the given buffer, returns a pointer to the zero-terminated string, and advances the buffer point just beyond the zero byte.
Subsequent calls to this function can be made to build up a list of zero- terminated strings. This is useful, for example, in printf statements.
Both OCAD strings will be appended to the buffer and separate pointers will be passed to printf. Note that the buffer size must be at least 256 times the number of strings to be converted before ptmp is reset, to prevent the potential for buffer overflow.