flat assembler
Message board for the users of flat assembler.
Index
> Main > Fasm Standard Library concept by vid Goto page Previous 1, 2 |
Do you accept my concept for library? | ||||||||||||||
|
||||||||||||||
Total Votes : 12 |
Author |
|
f0dder 20 Jun 2005, 11:32
Quote:
...except when these are badly designed. Printf isn't too nice (it's often designed with a limited output format buffer, and often doesn't have buffer overflow checking), and the C standard library string functions are awful. |
|||
20 Jun 2005, 11:32 |
|
Octavio 20 Jun 2005, 13:07
f0dder wrote: ...except when these are badly designed. Printf isn't too nice and the C standard library string functions are awful. Yes, some libraries are useless because don´t do error checking,and i like more pascal style,when i talk about 'printf' i don´t mean to do exactly the C implementation, but some generic output routine , if you know something better post it. |
|||
20 Jun 2005, 13:07 |
|
decard 20 Jun 2005, 14:31
But you can't negate that printf (and especially sprintf) functions are very usefull sometimes, when you have to format complex message:
Code: invoke sprintf, buf,format,[packets],[bytes],[seconds] buf rb 100h format db 'Status: %d packets recived (total %d bytes) in %d seconds.', 0 |
|||
20 Jun 2005, 14:31 |
|
f0dder 20 Jun 2005, 15:28
Octavio: exactly - don't use the "printf" name if it doesn't do exactly the same, though, or people will be confused.
decard: (s)printf is indeed useful, but it needs either an argument that specifies how large the buffer is, or the standard library should be written to use dynamic length strings (which, IMHO, would be a very good idea). |
|||
20 Jun 2005, 15:28 |
|
vid 21 Jun 2005, 10:47
I have an idea about problem if module should include stuff it needs itself or leave it on user. I think this might be solved by letting user decide, by defining or not defining some constant (let's call it "fasmlib_auto_include", all names here are temporary of course).
Every module will have list of macros and modules it uses, like Code: uses_macropacks proc, import uses_modules winapi, opengl Macros "uses_macropacks" and "uses_modules" will then decide whether to include file (if "fasmlib_auto_include" was defined and file isn't included already), or warn user if file isn't already included. This requires each module and macropack to have kind-of header which defines equate ("__included_#name-of-module"), that will be checked in "uses_" stuff. Code: macro header module { match =__included_#module,YES ;is module already included { preprocessor_time_error 'Module '#`module#' included twice' } __included_#module equ YES restore __current_module __current_module equ module } macro uses [module] {forward match =__included_#module,__included_#module ;if file isn't included already (if it is we don't bother) { local DONE DONE equ NO match =fasmlib_auto_include,fasmlib_auto_include ;if auto including isn't enabled { preprocessor_time_error 'Module '#`module#' must be included for module '#__current_module DONE equ YES } match =NO,DONE ;if autoincluding is enabled { include `module#'.inc' ;include module } } } Only problems is with the "preprocessor_time_error" thing. Any idea how to do this? |
|||
21 Jun 2005, 10:47 |
|
decard 07 Jul 2005, 17:11
hey... no more comments?
|
|||
07 Jul 2005, 17:11 |
|
Goto page Previous 1, 2 < Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.