An outputhandler must be located in directory prolint/outputhandlers, and has to be listed in
file prolint/outputhandlers/choices.d.
Columns in file prolint/outputhandlers/choices.d:
"GUI" | this outputhandler will only run in a GUI session |
"TTY" | this outputhandler will only run in a ChUI session |
"*" | this outputhandler will run in any window-mode |
"" | this outputhandler will only run in batch-mode |
Each outputhandler is loaded persistently by prolint.p, but prolint will never delete the procedure. The outputhandler has to delete itself when ready,
usually from within the event-procedure for event "Prolint_FinalizeResults".
The outputhandler subscribes to, and responds to (some) of the following published events:
PROCEDURE Prolint_InitializeResults : DEFINE INPUT PARAMETER pClearOutput AS LOGICAL NO-UNDO. END PROCEDURE.
Event Prolint_InitializeResults is published when prolint.p starts.
This is the right moment to create an output stream or XML-document or temp-table, or whatever kind of output you want to create.
pClearOutput=TRUE indicates that the existing output (logfile) needs to be emptied or that a new output stream (logfile) should be started.
pClearOutput=FALSE indicates that new lint-results should be appended to existing output (logfile).
PROCEDURE Prolint_List_Rules : DEFINE INPUT PARAMETER pRuleList AS CHARACTER NO-UNDO. /* comma-separated list of ruleid */ END PROCEDURE.Event Prolint_List_Rules is published to let you know which rules are selected in the current profile. This is a comma-separated list, not including the semi rule-id's used for system warnings like "prolint,proparse,compiler". This event is published once, after InitializeResults and before the first Status_Filestart.
PROCEDURE Prolint_Status_FileStart : DEFINE INPUT PARAMETER pSourceFile AS CHAR NO-UNDO. END PROCEDURE.Event Prolint_Status_FileStart is published to notify you when prolint starts to work on a new sourcefile, or actually on a new compilation-unit.
PROCEDURE Prolint_AddResult : DEFINE INPUT PARAMETER pCompilationUnit AS CHARACTER NO-UNDO. /* the sourcefile we're parsing */ DEFINE INPUT PARAMETER pSourcefile AS CHARACTER NO-UNDO. /* may be an includefile */ DEFINE INPUT PARAMETER pLineNumber AS INTEGER NO-UNDO. /* line number in pSourceFile */ DEFINE INPUT PARAMETER pDescription AS CHARACTER NO-UNDO. /* human-readable hint */ DEFINE INPUT PARAMETER pRuleID AS CHARACTER NO-UNDO. /* defines rule-program and maps to help */ DEFINE INPUT PARAMETER pSeverity AS INTEGER NO-UNDO. /* importance of this rule, scale 0-9 */ END PROCEDURE.Event Prolint_AddResult is published when prolint wants you to add something to the output (logfile).
PROCEDURE Prolint_Status_FileEnd : END PROCEDURE.Event Prolint_Status_FileEnd is published to notify you when prolint is done with the sourcefile that was earlier published in event Prolint_Status_FileStart.
PROCEDURE Prolint_FinalizeResults : END PROCEDURE.Event Prolint_FinalizeResults is published when prolint is ready.
PROCEDURE Prolint_Status_Action : DEFINE INPUT PARAMETER pAction AS CHAR NO-UNDO. END PROCEDURE.Event Prolint_Status_Action is probably only useful for logwin.w; parameter pAction is the text to show in the second panel of the statusbar.
PROCEDURE Prolint_Status_Profile : DEFINE INPUT PARAMETER pProfile AS CHAR NO-UNDO. END PROCEDURE.Event Prolint_Status_Profile sends you the name of the configuration profile that is used by Prolint.
PROCEDURE Prolint_Status_StopTimer : END PROCEDURE. PROCEDURE Prolint_Status_StartTimer : END PROCEDURE.Events Prolint_Status_StopTimer and Prolint_Status_StartTimer are used for finding out how long it takes to run rules: event Prolint_Status_StopTimer is published before compilation and parsing begins, Prolint_Status_StartTimer is published when compilation and parsing are ready which is also the moment that the loop "for each rule: run value(rule)..." begins.