Skip to content
Low-level programming · Higher-level thinking
Login Register
Forum / Requests and Feedback

plugin for Ziron

A community discussion post from the original code:zIRON forum.

Replies

Colin admin
Posts
928
Threads
49
Location
Bulgaria

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.

Emil_halim member
Posts
639
Threads
104
Location
Alex, Egypt

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

Colin admin
Posts
928
Threads
49
Location
Bulgaria

it will not be difficult to insert the buffer at all.

Ziron_SetFileBuffer(fileHandle, 'your changed code');
Emil_halim member
Posts
639
Threads
104
Location
Alex, Egypt

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

Colin admin
Posts
928
Threads
49
Location
Bulgaria

here is a pseudo example

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,

Emil_halim member
Posts
639
Threads
104
Location
Alex, Egypt

ok

this will be handy and easy system that extend Ziron.

go ahead , waiting to test it :yess:

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

Emil_halim member
Posts
639
Threads
104
Location
Alex, Egypt

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

Colin admin
Posts
928
Threads
49
Location
Bulgaria

yes, a good point, i will bare this in mind, the writer of the code would need to add a #require plugin clause.