Author | Message |
Emil_halim Ziron Beta Tester (send private message) Posts: 639 Topics: 104 Location: Alex, Egypt | [282] Ziron_SetFileBuffer function - posted: 2011-11-03 19:02:57 well , could you please provide some example that uses the new function Ziron_SetFileBuffer. http://www.freewebs.com/ogremagic/index.htm |
Admin Site Admin (send private message) Posts: 933 Topics: 55 Location: OverHertz Studio | [283] - posted: 2011-11-03 19:10:52 i have not tested this but a quick example is: Code:
you would then export this function Code:
now basically when this plugin is loaded, it will replace the main file with the above code, basically forcing the application to only compile a small hello world sample. of course since this is static replacement you can just do: Code:
so the idea behind these functions is you are able to preprocess the file, change things (then set the new file buffer) and then ziron will compile/assemble the file as if it is the original Download Ziron Get free hosting for Ziron related fan-sites and Ziron projects, contact me in private message. |
Emil_halim Ziron Beta Tester (send private message) Posts: 639 Topics: 104 Location: Alex, Egypt | [284] - posted: 2011-11-03 19:41:00 very good , thanks. is the second argument of FileEntry is the address of original file buffer ? and is the first argument is not zero , who can we make use of it ? http://www.freewebs.com/ogremagic/index.htm |
Admin Site Admin (send private message) Posts: 933 Topics: 55 Location: OverHertz Studio | [285] - posted: 2011-11-03 19:44:58 the first argument is a ziron handle to the file that is being entered, so for example most likely the first included file will be id 1, and so on.. so for each included file you would preprocess the file and pass it back with the handle that was passed, i just checked for 0 as example of replacing the main file.. the second argument yes is the char pointer to the actually internal buffer and should not be changed directly, you would scan through this code and place your changed version into your own buffer, then pass it via Ziron_SetFileBuffer. hope you understand Download Ziron Get free hosting for Ziron related fan-sites and Ziron projects, contact me in private message. |
Emil_halim Ziron Beta Tester (send private message) Posts: 639 Topics: 104 Location: Alex, Egypt | [290] - posted: 2011-11-03 20:40:52 is that mean , Ziron will call FileEntry function many times ( per included file), and we have to check that by first param? http://www.freewebs.com/ogremagic/index.htm |
Admin Site Admin (send private message) Posts: 933 Topics: 55 Location: OverHertz Studio | [291] - posted: 2011-11-03 21:00:29 it will call it only when a new file is opened and a new internal buffer is being created for the file... so... Code:
in this situation, FileEntry will be called a twice, the first is the actual project file (the code above) and the second will be the entrance to the inclued file 'kernel32.zir' of course if you include 'console.zir' it also has its own included files, so it will also be called when they are entered Code:
this above would still be twice, because the second include is ignored. Download Ziron Get free hosting for Ziron related fan-sites and Ziron projects, contact me in private message. |
Emil_halim Ziron Beta Tester (send private message) Posts: 639 Topics: 104 Location: Alex, Egypt | [299] - posted: 2011-11-03 22:45:34 ok, the next code gives this error List index out of bounds (2) Code:
http://www.freewebs.com/ogremagic/index.htm |
Admin Site Admin (send private message) Posts: 933 Topics: 55 Location: OverHertz Studio | [301] - posted: 2011-11-03 23:11:04 i do not see any problems in this code, the problem must lie in another part of the code EDIT: i see the problem, i will fix this and re-update package shortly - else i tested and have your code compiled and works fine. Download Ziron Get free hosting for Ziron related fan-sites and Ziron projects, contact me in private message. |
Currently Active Users: There are currently 7 user(s) online. 0 member(s) and 7 guest(s) Most users ever online was 1046, January 28, 2022, 2:08 pm. Statistics: Threads: 225 | Posts: 1848 | Members: 51 | Active Members: 51 Welcome to our newest member, yecate |