2003-08-12 13:51:11 +00:00
|
|
|
;
|
2005-04-16 14:43:22 +00:00
|
|
|
; Ullrich von Bassewitz, 2003-08-12, 2005-04-16
|
2003-08-12 13:51:11 +00:00
|
|
|
;
|
|
|
|
; Place to store the current working directory.
|
2005-04-16 14:43:22 +00:00
|
|
|
;
|
|
|
|
; __cwd is initialized by a platform specific function named "initcwd" called
|
|
|
|
; by the constructor defined in this module.
|
|
|
|
;
|
2003-08-12 13:51:11 +00:00
|
|
|
|
2013-05-09 11:56:54 +00:00
|
|
|
.export __cwd
|
2005-04-19 11:48:05 +00:00
|
|
|
.export __cwd_buf_size
|
2005-04-16 14:43:22 +00:00
|
|
|
.constructor cwd_init
|
|
|
|
|
|
|
|
.import initcwd
|
2003-08-12 13:51:11 +00:00
|
|
|
|
2005-04-19 11:28:11 +00:00
|
|
|
.include "stdio.inc"
|
2015-10-14 20:52:09 +00:00
|
|
|
|
2005-04-19 11:48:05 +00:00
|
|
|
__cwd_buf_size = FILENAME_MAX
|
2005-04-19 11:28:11 +00:00
|
|
|
|
2005-04-16 14:43:22 +00:00
|
|
|
cwd_init := initcwd
|
2003-08-12 13:51:11 +00:00
|
|
|
|
2015-10-14 20:52:09 +00:00
|
|
|
.segment "INITBSS"
|
2003-08-12 13:51:11 +00:00
|
|
|
|
2013-05-09 11:56:54 +00:00
|
|
|
__cwd: .res __cwd_buf_size
|
2005-04-19 11:28:11 +00:00
|
|
|
|
|
|
|
|
|
|
|
; NOTE: Some of the code working with directories is not able to handle
|
|
|
|
; strings longer than 255 chars, so don't make __cwd larger than 256 without
|
|
|
|
; checking the other sources.
|
2003-08-12 13:51:11 +00:00
|
|
|
|
2005-04-19 11:48:05 +00:00
|
|
|
.assert __cwd_buf_size < 256, error, "__cwd_buf_size must not be > 255"
|