dmd.backend.os

Operating system specific routines.

Placed here to avoid cluttering up code with OS files.

Compiler implementation of the D programming language.

Members

Functions

file_8dot3name
char* file_8dot3name(char* filename)

For 16 bit programs, we need the 16 bit filename.

file_createdirs
int file_createdirs(char* name)

Create directories up to filename. Input: name path/filename

file_write
int file_write(char* name, void* buffer, uint len)

Write a file.

os_clock
int os_clock()
os_critsecsize32
int os_critsecsize32()

Return size of OS critical section. NOTE: can't use the sizeof() calls directly since cross compiling is supported and would end up using the host sizes rather than the target sizes.

os_critsecsize64
int os_critsecsize64()

Return size of OS critical section. NOTE: can't use the sizeof() calls directly since cross compiling is supported and would end up using the host sizes rather than the target sizes.

os_error
void os_error(int line)

Called when there is an error returned by the operating system. This function does not return.

os_file_exists
int os_file_exists(char* name)

Return !=0 if file exists. 0: file doesn't exist 1: normal file 2: directory

os_freelibrary
void os_freelibrary()
os_getprocaddress
void* os_getprocaddress(char* funcname)
os_heapinit
void os_heapinit()

Do our own storage allocator (being suspicious of the library one).

os_heapterm
void os_heapterm()

Do our own storage allocator (being suspicious of the library one).

os_term
void os_term()
os_unique
uint os_unique()

///////////////////////////////////////

vmem_baseaddr
void* vmem_baseaddr()

Determine a base address that we can use for mapping files to.

vmem_commit
int vmem_commit(void* ptr, uint size)

Commit memory.

vmem_physmem
uint vmem_physmem()

Return amount of physical memory.

vmem_reserve
void* vmem_reserve(void* ptr, uint size)

Functions to manage allocating a single virtual address space.

vmem_reservesize
void vmem_reservesize(uint* psize)

Calculate the amount of memory to reserve, adjusting *psize downwards.

vmem_setfilesize
void vmem_setfilesize(uint size)

Set size of mapped file.

vmem_unmapfile
void vmem_unmapfile()

Unmap previous file mapping.

Variables

_osfhnd
void*[] _osfhnd;

Get file size of open file. Return -1L on error.

Meta