mirror of
https://github.com/uffejakobsen/acme.git
synced 2024-11-25 07:31:52 +00:00
aec6f8e99d
git-svn-id: https://svn.code.sf.net/p/acme-crossass/code-0/trunk@328 4df02467-bbd4-4a76-a152-e7ce94205b78
52 lines
1.1 KiB
C
52 lines
1.1 KiB
C
// ACME - a crossassembler for producing 6502/65c02/65816/65ce02 code.
|
|
// Copyright (C) 1998-2024 Marco Baye
|
|
// Have a look at "acme.c" for further info
|
|
//
|
|
// Platform specific stuff (in this case, for DOS, OS/2 and Windows)
|
|
#ifndef platform_C
|
|
#define platform_C
|
|
|
|
|
|
#include <stdlib.h>
|
|
#include "dynabuf.h"
|
|
|
|
|
|
// variables
|
|
char *DOS_lib_prefix = NULL; // header string of library tree
|
|
|
|
|
|
// used as PLATFORM_INIT: reads "ACME" environment variable
|
|
void DOS_entry(void)
|
|
{
|
|
char *env_var;
|
|
|
|
// Find out the path of ACME's library
|
|
env_var = getenv("ACME");
|
|
// if environment variable was found, make a copy
|
|
if (env_var) {
|
|
dynabuf_clear(GlobalDynaBuf);
|
|
// copy environment variable to global dynamic buffer
|
|
dynabuf_add_string(GlobalDynaBuf, env_var);
|
|
dynabuf_append(GlobalDynaBuf, '\\'); // add dir separator
|
|
dynabuf_append(GlobalDynaBuf, '\0'); // add terminator
|
|
DOS_lib_prefix = dynabuf_get_copy(GlobalDynaBuf);
|
|
}
|
|
}
|
|
|
|
|
|
// convert UNIX-style pathname to DOS-style pathname
|
|
void DOS_convert_path(char *p)
|
|
{
|
|
while (*p) {
|
|
if (*p == '/') {
|
|
*p = '\\';
|
|
} else if (*p == '\\') {
|
|
*p = '/';
|
|
}
|
|
++p;
|
|
}
|
|
}
|
|
|
|
|
|
#endif
|