For each platform exists a seperate adsrx library optionally containing improved versions or several stdlib functions. Some functions are only available in the adsrx library, but the number is kept minimal, workarounds in pain autolisp are provided as much as possible.
Every module provides its version variable and pushes its name into the *MODULES* list.
STDLIB-ADS - Module support
(STDLIB-ADS-PATH)
(STDLIB-ADS-DIRECTORY)
(STD-PRINT-ERRNO [errno])
FILEEXT - External OS, Directory and Filename Support Functions
This is the only required external module for the STDLIB.
Filenames:
(STD-%FILE-DIRECTORY-P fname) ; => T/nil
(STD-%FILE-READABLE-P fname) ; => T/nil
File attributes:
(STD-%FILE-SYSTIME fname) ; last modification time in CDATE format or nil
(STD-%FILE-MODTIME fname) ; in internal format (longint or real) or nil
(STD-%FILE-SIZE fname) ; => size in bytes, (int or real) or nil
(STD-%FILE-ATTRIB fname) ; => flag (integer) or nil
Directory and OS funcs:
(STD-%MKDIR fname) ; => T/nil
(STD-%RMDIR fname) ; => T/nil
(STD-%FULLPATH fname) ; => absolute long filename
(STD-%DOS-FILENAME fname) ; => short 8.3 fname
(STD-%GET-DRIVES-STRING) ; all logical drives as upcase string
; => "ACDE"
(STD-%CURRENT-PATH) ; => "C:\\test"
(STD-%DIRECTORY-FILES dir fspec flag)
(STD-FILE-DELETE fname) ; v0.7
User interactive:
! (STD-SELECT-FOLDER [def [msg]]) ; select directory,
; similar to acet-ui-pickdir or dos_getdir
Time/Date functions:
(STD-%INTERNAL-TIME->CDATE modtime)
; modtime: the number of non-leap seconds since 00:00:00 UTC,
; January 1, 1970, modtime is the same as the clib localtime (time_t)
; eg: 852559628 => 19970106.1513 (="6.1.97 15:13")
(STD-%GET-INTERNAL-RUN-TIME) ; => milliseconds as long
Miscellaneous functions:
(STD-%ACAD-CONNECTION-P) ; => always T
(STD-%PROTECTEDP symb) ; => always nil or maybe don't define it at all?
(STD-%OPEN-FILE-P file) ; is the binio file open?
; nil if closed, T if open, error if no file
(STD-SYS-VERSION) ; => list
BINIO - I/O, binary file support
Note:
The object returned by binio-fopen cannot NOT be used with plain
AutoLISP functions! Only with the functions below.
Well, with the BINIO.FAS version you may use it, but not with other
ARX or ADS extensions.
(BINIO-FOPEN fname mode)
modes: "r" "w" "a" "r+" "w+", => f
since v2.26, 2000-06-13:
simple encoding type support:
Macintosh modes start with "Mac" ("\r" only)
"Macr" "Macw" "Maca" ...
unix style "\n" are read correctly but written is always "\r\n"
(BINIO-FCLOSE file)
(BINIO-FSEEK file position [start-from])
start-from is 0, 1 or 2
Note that BINIO.FAS supported symbol names here also ,
but this adsrx cannot do this.
(BINIO-FTELL file)
(BINIO-REWIND file)
Reader support
(BINIO-READ-CHAR [file [eof-error-p [eof-value [recursive-p]]]])
=> char
(BINIO-UNREAD-CHAR char-code [file]) => ??
(BINIO-PEEK-CHAR [peek-type [file [eof-error-p [eof-value [recursive-p]]]]])
=> char
All PUT funcs accept either the single type or a list of those.
(BINIO-FPUTC file byte|list-of-bytes)
(BINIO-FPUTINT file shortint |list-of-int)
(BINIO-FPUTLONG file long|list-of-long) ;long
(BINIO-FPUTREAL file real|list-of-real) ;double
(BINIO-FPUTS file str [size]) ;ASCIIZ string (0 terminated)
(BINIO-FPUTSTRING file str |list-of-str) ;string \r\n terminated
(BINIO-FGETC file) ;#\0 too
(BINIO-FGETINT file)
(BINIO-FGETREAL file) ;double
(BINIO-FGETLONG file) ;long
(BINIO-FGETS file) ;ASCIIZ string ;ASCIIZ string (0 terminated)
(BINIO-FGETSTRING file) ;string \r\n terminated
REGISTRY - Registry API
(REGISTRY-READ path key) ; get value
(REGISTRY-WRITE path key value) ; change value
(REGISTRY-DELETE key) ; cannot delete if subkeys
(REGISTRY-DESCENDENTS key) ; string-list of subkeys
INIFILE - Get/WritePrivateProfileString API
(INIFILE-GET section entry filename)
(INIFILE-SET section entry string filename)
STDLOCAL-ADS Locale and codepage support
(STD-%SYS-CODEPAGE) => current ANSI codepage
not yet implemented for non WIN32 platforms
(STD-%SYS-LOCALE) => current country lcid number
(STD-%USER-LOCALE) => user-specific current country lcid number
We don't define bitcodes (2^18) to access the structure members,
instead we use strings to maintain readability.
For now this function is defined only for Windows.
ARXSTUFF - ARX only