home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 9 / 09.iso / l / l217 / 2.ddi / INCLUDE / EDITHOOK.PRE < prev    next >
Encoding:
Text File  |  1990-03-26  |  1.7 KB  |  43 lines

  1. /***************************************************************************
  2.  
  3.           Editor extensions with the EditHook Predicate
  4.           =============================================
  5.  
  6. In the editor the user has a choice of eight special keys which he can
  7. define the fuunction of himself. When one of these keys are pressed the
  8. editor calls the C routine:
  9.  
  10. void ED_EditHook(
  11.     INT KeyNo,            /* from 1 to 8 depending of key */
  12.     CHAR *EditText,            /* Whole editor text */
  13.     INT Currentpos,            /* Current cursor position in text */
  14.     INT BeginBlock, INT BlockLen,    /* If <> 0; a marked block */
  15.     INT BlockMarkingMode,        /* 0 if in markingmode, 1 if not */
  16.     INT *NewCurPos,            /* If <>0; new position after return */
  17.     INT *NewBlockStart, INT *NewBlockLen, /* If <>0; new marked block */
  18.     INT *NewBlockMarkingMode,    /* 0 if in markingmode, 1 if not */
  19.     INT *DeleteFrom, INT *DeleteLen,/* If <>0; block to delete */
  20.     INT *PastePos)            /* If <>0; place  to insert paste buf */
  21. { /* Default definition */
  22.   *NewCurPos=0;
  23.   *NewBlockStart=0;
  24.   *NewBlockLen=0;
  25.   *DeleteFrom=0;
  26.   *DeleteLen=0;
  27.   *PastePos=0;
  28. }
  29.  
  30. You can only use this facility if you are linking your program to an .EXE
  31. file. If you define clauses for the ED_ApplicationFunction routine in you
  32. prolog program, the linker will use this instead of the default definition
  33. from the library.
  34.  
  35. ***************************************************************************/
  36.  
  37. GLOBAL PREDICATES
  38.   /* Define the predicate as a C routine */
  39.   ED_AppFunc(INTEGER,STRING,INTEGER,INTEGER,INTEGER,INTEGER,INTEGER,INTEGER,
  40.                       INTEGER,INTEGER,INTEGER,INTEGER,INTEGER) 
  41.      - (i,i,i,i,i,i,o,o,o,o,o,o,o) language c as "_ED_EditHook"
  42.  
  43.