Register | Login
Forum Index > Requests and Feedback > plugin for Ziron
Author Message
Pages: 1 2
Admin
Site Admin

avatar

(send private message)

Posts: 933
Topics: 55

Location:
OverHertz Studio
[123] - posted: 2011-10-25 20:41:18
Then rather than save-reload file it will be better as so:

1. Ziron loads file for plugin X:
2. Ziron passes a pointer of the internal buffer per each file that is included.
3. Plugin sets the internal buffer with the new file code, by calling a specified function.
4. Go to step 1 for each plugin.

no need to save or re-load the file since this would be extremely slow.

Later on development it will be possible to register a keyword with the compiler, allowing to have a callback function to create complex functionality.

Download Ziron
Get free hosting for Ziron related fan-sites and Ziron projects, contact me in private message.
Emil_halim
Ziron Beta Tester

avatar

(send private message)

Posts: 639
Topics: 104

Location:
Alex, Egypt
[127] - posted: 2011-10-25 20:58:47

ok for looping , but i how plugin will change the source code buffer , inserting source code in buffer will be so hard, so i think first solution is good here.

So Ziorn will pass filename to plugin , so plug in will read line by line and changes it the
save it back , and so on with the flowing plugins.




http://www.freewebs.com/ogremagic/index.htm
Admin
Site Admin

avatar

(send private message)

Posts: 933
Topics: 55

Location:
OverHertz Studio
[128] - posted: 2011-10-25 21:03:09
it will not be difficult to insert the buffer at all.

Code:
Ziron_SetFileBuffer(fileHandle, 'your changed code');


Download Ziron
Get free hosting for Ziron related fan-sites and Ziron projects, contact me in private message.
Emil_halim
Ziron Beta Tester

avatar

(send private message)

Posts: 639
Topics: 104

Location:
Alex, Egypt
[130] - posted: 2011-10-25 21:08:08
ok

first plugin will begin scan the buffer , so you have to make function to read each line
form buffer then plugin will see if this line need to be change , it will send the changes
at this buffer position then will begin scan again from where we stop the scan for our changing , so we have to keep track of this operation.

http://www.freewebs.com/ogremagic/index.htm
Admin
Site Admin

avatar

(send private message)

Posts: 933
Topics: 55

Location:
OverHertz Studio
[131] - posted: 2011-10-25 21:09:29
here is a pseudo example

Code:
function FileEntry(DWord handle; char* strCode) {
  const maxLen = 1024;

  //create a buffer
  char myBuffer[maxLen]

  //go thorough each line of strCode and update myBuffer
  strlcpy(@myBuffer, ....

  //set the buffer
  Ziron_SetFileBuffer(handle, @myBuffer, maxLen);
}


each plugin will receive the updated internal buffer,

Download Ziron
Get free hosting for Ziron related fan-sites and Ziron projects, contact me in private message.
Emil_halim
Ziron Beta Tester

avatar

(send private message)

Posts: 639
Topics: 104

Location:
Alex, Egypt
[132] - posted: 2011-10-25 21:13:10

ok

this will be handy and easy system that extend Ziron.

go ahead , waiting to test it smile

http://www.freewebs.com/ogremagic/index.htm
Emil_halim
Ziron Beta Tester

avatar

(send private message)

Posts: 639
Topics: 104

Location:
Alex, Egypt
[139] - posted: 2011-10-26 18:41:19

BTW

each plugin must has it's own ID ,such as it's name , so that if some code need a certain
one Ziron will start compiling that code or it will fire a request showing that the code
need a plugin name.

http://www.freewebs.com/ogremagic/index.htm
Admin
Site Admin

avatar

(send private message)

Posts: 933
Topics: 55

Location:
OverHertz Studio
[142] - posted: 2011-10-26 19:26:08
yes, a good point, i will bare this in mind, the writer of the code would need to add a #require plugin clause.

Download Ziron
Get free hosting for Ziron related fan-sites and Ziron projects, contact me in private message.
Pages: 1 2
create new reply


Quick reply:

Message:



Currently Active Users:
There are currently 2 user(s) online. 0 member(s) and 2 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
const Copyright = '2011-2024 © OverHertz Ltd. All rights reserved.';
Web development by OverHertz Ltd