home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
AmigActive 20
/
AACD20.BIN
/
AACD
/
Utilities
/
MultiRen
/
Developers
/
Template.mrp.e
< prev
next >
Wrap
Text File
|
2000-07-03
|
2KB
|
104 lines
/* Template for making plugins for MultiRen in E.
Please use this template and change NOTHING in main() except
for the $VERsion-string!
By Deniil 715! 2000-07-04, rev #2.
*/
CONST NUMSTRINGS_FOR_THIS_PLUGIN=1, -> Change this if you return more than 1 string
FILE_NAME_LENGTH=512,
COM_ASK=1,
COM_EXTRACT=2,
COM_CONFIGURE=3,
COM_ABOUT=4,
COM_QUIT=5,
ERR_OK=0,
ERR_NOMEM=1,
ERR_NOFILE=2,
ERR_NOSIG=3,
ERR_NOTIMPL=4,
ERR_UNKNOWN=5,
ERR_OTHER=6,
ERR_WRONGFORMAT=7,
ERR_NOINFO=8,
ERR_FATAL=20
OBJECT multiren_plugin
id:LONG
task:LONG
sig:LONG
return:INT
command:CHAR
numstrings:CHAR -> You will
stringlist[256]:ARRAY OF LONG -> only use
name:PTR TO CHAR -> these 4
newname:CHAR -> elements
ENDOBJECT
DEF mrp:PTR TO multiren_plugin
PROC main()
DEF sel, sigbit, sig, mtask, msig
'$VER: Template v1.1 rev.#2 by Deniil 715! (2000-07-04)'
IF arg
IF mrp:=Val(arg)
IF mrp.id="MRPO"
IF (sigbit:=AllocSignal(-1))>=0
sig:=Shl(1,sigbit)
LOOP
sel:=mrp.command
SELECT sel
CASE COM_ASK
mtask:=mrp.task
msig:=mrp.sig
mrp.return:=ask()
SetProgramName(mrp.name)
mrp.task:=FindTask(NIL)
mrp.sig:=sig
CASE COM_EXTRACT ; mrp.return:=extract()
CASE COM_CONFIGURE ; mrp.return:=config()
CASE COM_ABOUT ; mrp.return:=about()
CASE COM_QUIT
FreeSignal(sigbit)
mrp.return:=cleanup()
Signal(mtask,msig)
RETURN
DEFAULT ; mrp.return:=ERR_UNKNOWN
ENDSELECT
Signal(mtask,msig)
Wait(sig)
ENDLOOP
ELSE
mrp.return:=ERR_NOSIG
Signal(mrp.task,mrp.sig)
RETURN
ENDIF
ENDIF
ENDIF
ENDIF
WriteF('This is a plugin for MultiRen!\n' +
'It is not supposed to be executed stand alone!\n' +
'Use it through the Renplacer tool in MultiRen instead!\n')
ENDPROC ERR_FATAL
PROC ask()
mrp.numstrings:=NUMSTRINGS_FOR_THIS_PLUGIN
mrp.stringlist[0]:='<template>'
mrp.name:='<template>'
mrp.newname:=0 -> 0 = Request Old name, 1 = Request New name
ENDPROC ERR_OK
PROC extract()
mrp.stringlist[0]:='<template>'
ENDPROC ERR_OK
PROC config() IS ERR_NOTIMPL
PROC about()
req('About template..')
ENDPROC ERR_OK
PROC cleanup() IS ERR_OK
PROC req(body,gads=NIL) IS EasyRequestArgs(NIL,
[20,0,'Template',body,IF gads THEN gads ELSE 'OK'],NIL,NIL)