Residents
Residents
Purebasic's native and OS constants are stored in a residents file, right? This is a precompiled file with only constants and structures, right? This is for faster compilation, right? So, how does PB know what constants are valid without looking in the residents file, and doesn't that sort of defeat it's purpose?
yes it is a custom format.
but it is 'parsable' so if you know how to read the file, you know how to generate a new resident file.
there are on this forum, examples on how to parse it.
at the moment, there are 2 formats : RES3 and RES4 chunks.
one which store constants, structures and interfaces
and the other, since PB4, which store also macros and prototypes...
i will send you a custom parser i made month ago.
but it is 'parsable' so if you know how to read the file, you know how to generate a new resident file.
there are on this forum, examples on how to parse it.
at the moment, there are 2 formats : RES3 and RES4 chunks.
one which store constants, structures and interfaces
and the other, since PB4, which store also macros and prototypes...
i will send you a custom parser i made month ago.
No programming language is perfect. There is not even a single best language.
There are only languages well suited or perhaps poorly suited for particular purposes. Herbert Mayer
There are only languages well suited or perhaps poorly suited for particular purposes. Herbert Mayer
here is a project i was working on - for fun - some months ago.
it works (not completely) and there's a GUI but no time to finish it.
if you want you can grab it here and have a look at it.
just one note :
the parser is Event-Based and the programmer use callbacks to catch each elements (structs, consts, macros, ...).
have fun
http://www.penguinbyte.com/apps/pbwebst ... Parser.zip
just load and run the ResidentExplorer.pb file which need the ResidentParser.pbi include. Or you can also try the ResidentParser_EXAMPLE.pb test-file.
use it at your own risk.
[EDIT]
But without any documentation (not explained in the PureBasic SDK)
it's not an easy work to decrypt all these chunks...
i know this is purebasic private's stuff but the SDK might explain the structure of the residents files - for making third-party tools.
it works (not completely) and there's a GUI but no time to finish it.
if you want you can grab it here and have a look at it.
just one note :
the parser is Event-Based and the programmer use callbacks to catch each elements (structs, consts, macros, ...).
have fun
http://www.penguinbyte.com/apps/pbwebst ... Parser.zip
just load and run the ResidentExplorer.pb file which need the ResidentParser.pbi include. Or you can also try the ResidentParser_EXAMPLE.pb test-file.
use it at your own risk.
[EDIT]
But without any documentation (not explained in the PureBasic SDK)
it's not an easy work to decrypt all these chunks...
i know this is purebasic private's stuff but the SDK might explain the structure of the residents files - for making third-party tools.
Last edited by Flype on Mon Nov 06, 2006 7:40 pm, edited 2 times in total.
No programming language is perfect. There is not even a single best language.
There are only languages well suited or perhaps poorly suited for particular purposes. Herbert Mayer
There are only languages well suited or perhaps poorly suited for particular purposes. Herbert Mayer
> And is it possible to store function declaration and external variable definitions in these files also?
Not functions, but you can definitely create your own custom residents file
with constants and so on... see my post here:
http://www.purebasic.fr/english/viewtopic.php?t=18820
Not functions, but you can definitely create your own custom residents file
with constants and so on... see my post here:
http://www.purebasic.fr/english/viewtopic.php?t=18820
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
"PureBasic won't be object oriented, period" - Fred.



