Register | Login
Forum Index > Source Help > assignment detecting
Author Message
Pages: 1 2 3 4
Emil_halim
Ziron Beta Tester

avatar

(send private message)

Posts: 639
Topics: 104

Location:
Alex, Egypt
[1061] assignment detecting - posted: 2012-05-11 19:54:44

Hi Mr Colin.

i made this to detecting assignment but seems that it does not work?
Code:
plugins off;

program WIN32DLL 'test PLUGIN';

#include 'zirplug/framework.zir';
#include 'zirutils.zir';
#include 'strings.zir';
//////////////////////////////

const strLoaded = 'dummy plugin has loaded!';

function token_Assign()
{
  char  line[2048];
  int32 linelen;
  linelen = Ziron_ExtractLine(@line, 2048);
  Ziron_ShowMessage(@line);
  return false; // let Ziron handle the line  
}

function InitPlugin(pointer pGetF) 
{
  Ziron_LoadAll(pGetF); //use framework utility function to load all

     //register token
     //Ziron_RegisterUserToken('=', @token_Assign);
  
    //register our keyword
    Ziron_RegisterKeyword('=', @token_Assign);
    
  return strLoaded;
}


have tried both Ziron_RegisterUserToken & Ziron_RegisterKeyword but no detecting.

any help please?

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

avatar

(send private message)

Posts: 933
Topics: 55

Location:
OverHertz Studio
[1062] - posted: 2012-05-11 20:01:53
from plugin_interface.rtf:


1.6. function Ziron_RegisterKeyword(char* name; pointer callback): DWord; stdcall;

Parameter 1: The keyword for the token, should not contain any special characters.
usable letters: a-z, _, 0-9, note the keyword must start with a letter from a-z.

Parameter 2: A pointer to the callback function.
The callback function is declared with no parameters and stdcall.
e.g.

function myCallback() {

Result is a reference ID to the keyword.


because the internal text processor works on byte to byte basis, it would be very slow to have a callback and keyword events based on characters.

This sort of thing would be best to be pre-processed by the plugin using the event "ProgramEntry", Ziron_Execute can be called from this event, but note that you must manually process all of the buffer and then execute it:


3.4. procedure ProgramEntry(char* apptype); stdcall;

This procedure is called if exported when the program has passed declaration type. e.g. "program WIN32DLL 'name';" and Ziron system files.
The parameter is a pointer to a null terminated string containing the app type "WIN32DLL" or such.

Note: that the system.zir file will take priority and be included before this event is called.


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
[1063] - posted: 2012-05-11 20:12:09

BTW , what is the deference between the ProgramBegin and ProgramEntry function.

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

avatar

(send private message)

Posts: 933
Topics: 55

Location:
OverHertz Studio
[1064] - posted: 2012-05-11 20:18:34
There is no ProgramBegin... where do you see this?

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
[1065] - posted: 2012-05-11 20:28:14

oh , sorry , it was my mistake.

so i will try the programEntry ,and see the results.

BTW, i was trying to detect assignment to allow this in plugin

Code:
qword[edi] = mm0;


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

avatar

(send private message)

Posts: 933
Topics: 55

Location:
OverHertz Studio
[1066] - posted: 2012-05-11 20:41:42
not to worry, some of the mmx high level stuff will be added shortly, the problem is that by adding high level for movq and movd is people may forget to call emms before fpu instructions.

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
[1067] - posted: 2012-05-11 20:49:49

ok , no problem.

please can you give a working example of using programEntry.

i have tryied that but no successful.
Code:
procedure ProgramEntry(char* apptype) 
{
   char tmp[2048];
 
   edi = strGetLine(apptype, @tmp);
   while(edi <> 0) {
      Ziron_ShowMessage(@tmp);
      eax = Ziron_Exec(@tmp);
        if (eax == false) {
          Ziron_FatalError('Dim plugin is not compatible with this version of Ziron');
          return true;
        }       
      edi = strGetLine(edi, @tmp);
   }  
 
}


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

avatar

(send private message)

Posts: 933
Topics: 55

Location:
OverHertz Studio
[1068] - posted: 2012-05-11 21:24:40
apptype is just the "WIN32CUI" you would need to use Ziron_ExtractLine

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


Quick reply:

Message:



Currently Active Users:
There are currently 6 user(s) online. 0 member(s) and 6 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