>E-Library  3 Created by asmtobasic (c) 2002 Zap Developers ( 2D Defines the variables needed for writing Zap extension modes. e_* The entry point variables (see E-Entry) x> r_* The redraw block variables (see Redraw) 8 Zap_* The zap routines (see E-ZapCalls)    define_zap_variables  pass%, P%, O%, L%, code%  code% 2048 L% = code% + 2048  pass% = %1100 %1110 2 P% = 0 : O% = code% [ OPT pass%  E.f_ptr EQUD 4 ; pointer to file buffer / -1 ?.f_bufl EQUD 4 ; length of file buffer 8.f_len EQUD 4 ; length of file =.f_name EQUD 4 ; pointer to filename ">.f_load EQUD 4 ; load address of file ,>.f_exec EQUD 4 ; exec address of file 64.f_flags EQUD 4 ; file flags @@.f_uptr EQUD 4 ; pointer to undo buffer J?.f_ubufl EQUD 4 ; length of undo buffer TG.f_ulen EQUD 4 ; length of data in undo buffer ^E.f_undo EQUD 4 ; offset of main undo pointer hJ.f_undop EQUD 4 ; offset of undo block sub-pointer rK.f_blklen EQUD 4 ; total length of file block + undo |J.f_splito EQUD 4 ; offset in file of start of split G.f_splite EQUD 4 ; offset in buf of end of split F.f_splits EQUD 4 ; size of split=splite-splito B.f_mptr EQUD 4 ; pointer to marker buffer A.f_mbufl EQUD 4 ; length of marker buffer I.f_mlen EQUD 4 ; length of data in marker buffer I.f_mark EQUD 4 ; current offset in marker buffer G.f_docom EQUD 4 ; current command being 'done'. F.f_source EQUD 4 ; word for use of f_cmode mode F.f_dolen EQUD 4 ; length of insertion/deletion K.f_dodata EQUD 4 ; data to be inserted/replace with. J.f_altered EQUD 4 ; first altered offset in file /-1 L.f_shiftable EQUD 4 ; first shiftable offset in file /-1 K.f_change EQUD 4 ; signed change of shiftable offset F.f_depth EQUD 4 ; multiple operation depth / 0 @.f_links EQUD 4 ; v links to other files E.f_cmode EQUD 4 ; mode which 'owns' file / -1 &9.f_attr EQUD 4 ; file attributes 08.f_chklen EQUD 4 ; initial length ::.f_chksum EQUD 4 ; initial checksum DL.f_oflags EQUD 4 ; old flags (used by startop/stopop) N<.f_proposed_name EQUD 4 ; proposed file name XB.f_tag EQUD 4 ; tag number for this file b<.f_end_mark EQUD 4 ; end of list marker l v ]:  pass% = %1100 %1110 2 P% = 0 : O% = code% [ OPT pass%  G.w_handle EQUD 4 ; window handle / -1 if deleted 3.w_minx EQUD 4 ; min scn x 3.w_miny EQUD 4 ; min scn y 3.w_maxx EQUD 4 ; max scn x 3.w_maxy EQUD 4 ; max scn y 2.w_scrollx EQUD 4 ; x scroll 2.w_scrolly EQUD 4 ; y scroll J.w_infront EQUD 4 ; window handle of window in front ;.w_windowflags EQUD 4 ; wimp window flags  @.w_file EQUD 4 ; offset of file showing 8.w_format EQUD 4 ; display format  E.w_width EQUD 4 ; width of work area in chars *F.w_height EQUD 4 ; height of work area in chars 4G.w_txt EQUD 4 ; pointer to cached text buffer >K.w_txth EQUD 4 ; height of cached txt buf in lines HL.w_txtw EQUD 4 ; char width of cached line (mult 8) R@.w_txtn EQUD 4 ; number of lines cached \J.w_coff EQUD 4 ; off in text of first cached line fJ.w_cline EQUD 4 ; line number of first cached line pK.w_clogl EQUD 4 ; log line num of first cached line z6.w_tab EQUD 4 ; coltab width H.w_tabc EQUD 4 ; actual tab character code (x4) B.w_cr EQUD 4 ; code of return/line feed ;.w_flags EQUD 4 ; (my) window flags H.w_title EQUD 4 ; pointer to window title buffer H.w_bpl EQUD 4 ; bytes per line / width of text H.w_margin EQUD 4 ; width of margin (inc line nos) K.w_rl EQUD 4 ; height in lines of each character K.w_rw EQUD 4 ; width in pixels of each character L.w_rh EQUD 4 ; text height in pixels (no spacing) J.w_addr EQUD 4 ; address of first byte in display K.w_stline EQUD 4 ; line number of first line in disp D.w_titlelen EQUD 4 ; title length (excluding 0) I.w_titbuf EQUD 4 ; address of title showing buffer H.w_titlen EQUD 4 ; length of title showing string D.w_mwidth EQUD 4 ; user required margin width J.w_tabchar EQUD 4 ; user required tab char code (x4) $D.w_linesp EQUD 4 ; user required line spacing .K.w_savedo EQUD 4 ; fixed off / fixed line off before 8I.w_savedl EQUD 4 ; pixs from top / phy line of off BJ.w_savedc EQUD 4 ; change in phy line for shiftable LC.w_savedh EQUD 4 ; w_height at multiop start VF.w_savedlc EQUD 4 ; phy line of fixed for one op `8.w_wrapwidth EQUD 4 ; wordwrap width j;.w_togminx EQUD 4 ; toggle size min x t;.w_togminy EQUD 4 ; toggle size min y ~;.w_togmaxx EQUD 4 ; toggle size max x ;.w_togmaxy EQUD 4 ; toggle size max y J.w_txtlen EQUD 4 ; size of cache line inc col masks >.w_palette EQUD 4 ; current palette data F.w_pwind EQUD 4 ; point (=this!) window offset =.w_pline EQUD 4 ; point row (y coord) @.w_pcol EQUD 4 ; point column (x coord) 6.w_poff EQUD 4 ; point offset ;.w_ploff EQUD 4 ; point line offset 5.w_pwidth EQUD 4 ; point width H.w_saveds EQUD 4 ; start of area to redraw offset E.w_modedata EQUD 4 ; zap handled mode data block <.w_basemap EQUD 1 ; base keymap number ?.w_currentmap EQUD 1 ; current keymap number  N.w_helpmap EQUD 1 ; previous keymap number (for HELPKEY) ?.w_defaultmap EQUD 1 ; default keymap number <.w_font EQUD 4 ; font block pointer (R.w_savedscy EQUD 4 ; saved scrolly (s_txt_stat) ; (was RW 12) 2;.w_info EQUD 4 ; w_info (was RW13) .c_loff EQUD 4 ; start of line offset B.c_width EQUD 4 ; width of cursor in chars &A.c_owind EQUD 4 ; old window / -1 if none 0:.c_oline EQUD 4 ; old plotted line :9.c_ocol EQUD 4 ; old plotted col DQ.c_owidth EQUD 4 ; old width / offset for selected regions NA.c_charoff EQUD 4 ; offset within character XB.cusr_blk EQUD 4 ; length of a cursor block b l v]:  pass% = %1100 %1110 2 P% = 0 : O% = code% [ OPT pass%  H.e_module EQUD 4 ; table offset from module start ?.e_title EQUD 4 ; title offset (max 10) 7.e_author EQUD 4 ; author offset D.e_basemode EQUD 4 ; mode to call for 0 offsets C.e_mode EQUD 4 ; mode you would like to be 6.e_init EQUD 4 ; startup code 8.e_menu EQUD 4 ; extension menu >.e_len EQUD 4 ; length of this table K.e_postload EQUD 4 ; called after being loaded/created C.e_presave EQUD 4 ; called before being saved  C.e_loading EQUD 4 ; file being loaded/created C.e_start EQUD 4 ; window entering this mode  B.e_end EQUD 4 ; window leaving this mode *>.e_width EQUD 4 ; find work area width 4F.e_linecol EQUD 4 ; column offset to file offset >F.e_lineoff EQUD 4 ; file offset to column offset H9.e_clnlog EQUD 4 ; log to file off R9.e_clnphy EQUD 4 ; phy to file off \=.e_clnoff EQUD 4 ; file off to phy/log fR.e_nextline EQUD 4 ; find next line which can be shifted down p=.e_minus EQUD 4 ; perform cursor left z>.e_plus EQUD 4 ; perform cursor right <.e_sminus EQUD 4 ; perform shift left =.e_splus EQUD 4 ; perform shift right <.e_cminus EQUD 4 ; perform ctrl minus ;.e_cplus EQUD 4 ; perform ctrl plus F.e_redrawline EQUD 4 ; redraw a line of the display B.e_redrawlnum EQUD 4 ; find logical line number G.e_char EQUD 4 ; insert characters as if typed E.e_delete EQUD 4 ; delete characters from text 9.e_tab EQUD 4 ; tab key pressed <.e_return EQUD 4 ; return key pressed 9.e_renumber EQUD 4 ; please renumber C.e_saveandrun EQUD 4 ; save file and run/compile <.e_linestart EQUD 4 ; find start of line :.e_lineend EQUD 4 ; find end of line A.e_linenext EQUD 4 ; find actual end of line C.e_lineprev EQUD 4 ; find actual start of line $7.e_copy EQUD 4 ; copy key data .F.e_joinline EQUD 4 ; join this line with the next 8G.e_splitline EQUD 4 ; split this line at the cursor BS.e_aligncaret EQUD 4 ; put caret in sensible posn before command LI.e_command EQUD 4 ; someone wants to alter the text VF.e_compile EQUD 4 ; compile / run and don't exit `I.e_formattext EQUD 4 ; format the text from this point jF.e_run EQUD 4 ; run the program being edited tA.e_runandquit EQUD 4 ; as above but then quits ~H.e_basic EQUD 4 ; drops into basic (or language) @.e_search EQUD 4 ; called before a search :.e_replace EQUD 4 ; replace a string ?.e_selection EQUD 4 ; start/end a selection A.e_click EQUD 4 ; double/treble click etc D.e_message EQUD 4 ; unrecognised wimp messages ?.e_setwidth EQUD 4 ; changing window width C.e_listfns EQUD 4 ; provide list of functions E.e_prevline EQUD 4 ; find start of update region H.e_openwindow EQUD 4 ; window changing size or moving F.e_interrogate EQUD 4 ; Information request from Zap I.e_returnword EQUD 4 ; return bounds of word at cursor G.e_help EQUD 4 ; return possible help keywords G.e_stripspaces EQUD 4 ; space-stripping help requests   ]: ( pass% = %1100 %1110 2 2P% = 0 : O% = code% <[ OPT pass% F P=.Zap_AddMode EQUD 4 ; add new mode to zap Z:.Zap_Claim EQUD 4 ; claim heap block d;.Zap_Ensure EQUD 4 ; ensure heap block n9.Zap_Free EQUD 4 ; free heap block x3.Zap_MoveBytes EQUD 4 ; move data J.Zap_SplitBuffer EQUD 4 ; split text buffer at given point K.Zap_NewTxtStatus EQUD 4 ; refresh screen after file changed G.Zap_SaveTxtStatus EQUD 4 ; save info before file changed G.Zap_Command EQUD 4 ; execute insert/delete command F.Zap_NewWinStatus EQUD 4 ; recreate window after change J.Zap_SaveWinStatus EQUD 4 ; save window status before change G.Zap_ReplaceArea EQUD 4 ; replace one string by another F.Zap_PlotCaret EQUD 4 ; plot caret at given position M.Zap_ReflectCaret EQUD 4 ; plot caret at posn only using c_off 4.Zap_SetCaret EQUD 4 ; draw caret P.Zap_ClearCaret EQUD 4 ; draw old caret position (remove caret) =.Zap_DoCommand EQUD 4 ; perform the command K.Zap_ShowCursor EQUD 4 ; make sure given cursor is visible =.Zap_ReadVar EQUD 4 ; read a zap variable >.Zap_WriteVar EQUD 4 ; write a zap variable =.Zap_SaveFile EQUD 4 ; save a file to disc "E.Zap_FillWords EQUD 4 ; fill a given area of memory ,D.Zap_UpdateLns EQUD 4 ; update line numbers column 6J.Zap_EachWindow EQUD 4 ; call sub for each window on file @H.Zap_UpdateCaret EQUD 4 ; updates caret posn from offset JH.Zap_GetWindState EQUD 4 ; update R8 block with wind posn T7.Zap_StartOp EQUD 4 ; start multiop ^6.Zap_StopOp EQUD 4 ; stop multiop hJ.Zap_CallMode EQUD 4 ; call a mode entry point using R8 r:.Zap_CallGivenMode EQUD 4 ; call mode in R10 |=.Zap_ReadMode EQUD 4 ; read info on a mode J.Zap_FindFile EQUD 4 ; find window on a given file name F.Zap_FindWindow EQUD 4 ; find window on a loaded file G.Zap_ConvWindOff EQUD 4 ; convert window off to blk ptr E.Zap_ConvFileOff EQUD 4 ; convert file off to blk ptr G.Zap_GetWindOff EQUD 4 ; convert window blk ptr to off E.Zap_GetFileOff EQUD 4 ; convert file blk ptr to off J.Zap_GotoOffset EQUD 4 ; move cursor to given posn + mark J.Zap_JumptoOffset EQUD 4 ; move cursor to given posn nomark I.Zap_FindOffset EQUD 4 ; find file offset from x,y coord D.Zap_NewFileTitle EQUD 4 ; update titlebars on a file A.Zap_InsertString EQUD 4 ; insert string into file >.Zap_CreateFile EQUD 4 ; create an empty file I.Zap_NewLinkEntry EQUD 4 ; add an entry to the links table F.Zap_DefaultClick EQUD 4 ; default mouse click handling ?.Zap_PutCaret EQUD 4 ; put new caret in file 3.Zap_DiscardFile EQUD 4 ; kill file &:.Zap_DeleteFile EQUD 4 ; propmt then kill 05.Zap_DiscardWindow EQUD 4 ; kill window :A.Zap_DeleteWindow EQUD 4 ; prompt then kill window DG.Zap_BuildMenu EQUD 4 ; create a variable length menu N=.Zap_ClearSel EQUD 4 ; clear selected area XG.Zap_CreateFileBlk EQUD 4 ; create a new file block in R9 bI.Zap_CreateWindBlk EQUD 4 ; create a new window block in R8 lE.Zap_GetSel EQUD 4 ; get info on selected region vG.Zap_InsertMark EQUD 4 ; insert marker at given offset >.Zap_InstallFile EQUD 4 ; load a file into Zap ?.Zap_NewMode EQUD 4 ; change mode of a file F.Zap_NewTitle EQUD 4 ; update the title of a window D.Zap_CallBaseMode EQUD 4 ; call base mode entry point E.Zap_NewView EQUD 4 ; open a new window on a file B.Zap_ReadSel EQUD 4 ; read the selected region F.Zap_Replace EQUD 4 ; perform a search and replace ?.Zap_Search EQUD 4 ; perform a file search 9.Zap_Select EQUD 4 ; select a region ?.Zap_AlterSel EQUD 4 ; alter selected region D.Zap_OffLineCol EQUD 4 ; convert file offset to X,Y =.Zap_AddCommands EQUD 4 ; add a command table D.Zap_MiniWrite EQUD 4 ; insert chars in minibuffer J.Zap_MiniPrompt EQUD 4 ; set/change the minibuffer prompt E.Zap_MiniUpdate EQUD 4 ; update minibuffer on screen C.Zap_AddYankRegion EQUD 4 ; add a region to kill ring I.Zap_FindCommand EQUD 4 ; convert command name to address *<.Zap_ProcessCommand EQUD 4 ; call a Zap command 4=.Zap_FindKeyEntry EQUD 4 ; read a keymap entry >F.Zap_FindLeafName EQUD 4 ; find leaf part of a filename HC.Zap_NewFileName EQUD 4 ; change the name of a file RE.Zap_CheckFileName EQUD 4 ; see if file contains a path \I.Zap_GetCurrDir EQUD 4 ; find the current directory name fI.Zap_MiniWriteC EQUD 4 ; write a character to minibuffer p:.Zap_MiniClear EQUD 4 ; clear minibuffer zC.Zap_MiniStart EQUD 4 ; start up a new minibuffer A.Zap_MiniEval EQUD 4 ; turn string into number B.Zap_CommandString EQUD 4 ; execute a string command @.Zap_ProcessKeys EQUD 4 ; process a list of keys J.Zap_ProcessAKey EQUD 4 ; process a single key as if typed ;.Zap_OpenWindow EQUD 4 ; open a Zap window I.Zap_RestoreModeWord EQUD 4 ; restore mode options on e_start D.Zap_SaveModeWord EQUD 4 ; save mode options on e_end <.Zap_GetModeWord EQUD 4 ; read the mode word =.Zap_PutModeWord EQUD 4 ; write the mode word <.Zap_BaseMode EQUD 4 ; call the base mode J.Zap_ReadWord EQUD 4 ; read a word from the file buffer K.Zap_ReplaceWord EQUD 4 ; replace a word in the file buffer A.Zap_ModeColour EQUD 4 ; Read colour definitions =.Zap_FindInput EQUD 4 ; Find input position I.Zap_ClipCache EQUD 4 ; Move the cache reference point. I.Zap_ModeData EQUD 4 ; Read/write Zap data mode words. $I.Zap_WhichMode EQUD 4 ; Which mode to load a file into. .F.Zap_ModeNumber EQUD 4 ; Convert mode name to number. 8J.Zap_SendDataSave EQUD 4 ; Initiate data transfer protocol. B?.Zap_Warning EQUD 4 ; Show warning message. LF.Zap_AllWindow EQUD 4 ; Examine each window in turn. VC.Zap_ReadMenu EQUD 4 ; Create text menu to data. `@.Zap_LoadMenu EQUD 4 ; Load a text menu file. jD.Zap_OpenMenu EQUD 4 ; Open a menu on the screen. tB.Zap_CallBack EQUD 4 ; Call back at given time. ~D.Zap_DragBox EQUD 4 ; Perform your own drag box. A.Zap_SendMessage EQUD 4 ; Send a message via Zap. E.Zap_Reply EQUD 4 ; Reply to a message via Zap. >.Zap_Extend EQUD 4 ; Extend a heap block. A.Zap_ModeColourNum EQUD 4 ; Change size of palette. B.Zap_CreateThrowback EQUD 4 ; Create a throwback file. B.Zap_Throwback EQUD 4 ; Insert a throwback line. C.Zap_TestModeName EQUD 4 ; Find if a mode is loaded. =.Zap_UpdateArea EQUD 4 ; Force window redraw =.Zap_UpdateWindow EQUD 4 ; Force window redraw =.Zap_UpdateWholeWindow EQUD 4 ; Force window redraw =.Zap_AllFiles EQUD 4 ; Force window redraw A.Zap_ReadValidateCommand EQUD 4 ; String -> command block G.Zap_ProcessKeyCommand EQUD 4 ; Execute a given command block  I.Zap_ReturnWord EQUD 4 ; Return delimited word at cursor I.Zap_DoReplaceArea EQUD 4 ; Calls Zap_ReplaceArea with R8=0 D.Zap_LogicalLine EQUD 4 ; Calls base mode's e_clnlog (D.Zap_PhysicalLine EQUD 4 ; Calls base mode's e_clnphy 2D.Zap_OffsetLine EQUD 4 ; Calls base mode's e_clnoff .r_workarea EQUD 4 ; address of work area H.r_magx EQUD 4 ; log 2 of num of x os per pixel H.r_magy EQUD 4 ; log 2 of num of y os per pixel @.r_xsize EQUD 4 ; screen width in pixels &A.r_ysize EQUD 4 ; screen height in pixels 05.r_mode EQUD 4 ; screen mode :>; the rest of this block is optional (depending on r_flags DF.r_length EQUD 4 ; total length of redraw block N>.r_lmargin EQUD 4 ; left margin (pixels) X=.r_tmargin EQUD 4 ; top margin (pixels) bN.r_end EQUD 4 ; end of longest possible redraw block l v]: