VirtualBox

Changeset 41561 in vbox for trunk/include


Ignore:
Timestamp:
Jun 4, 2012 12:10:19 PM (13 years ago)
Author:
vboxsync
Message:

DBGC: Made the parse cope with functions.

Location:
trunk/include/VBox
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/dbg.h

    r41558 r41561  
    365365
    366366
    367 /** Pointer to command descriptor. */
     367/** Pointer to a command descriptor. */
    368368typedef struct DBGCCMD *PDBGCCMD;
    369 /** Pointer to const command descriptor. */
     369/** Pointer to a const command descriptor. */
    370370typedef const struct DBGCCMD *PCDBGCCMD;
     371
     372/** Pointer to a function descriptor. */
     373typedef struct DBGCFUNC *PDBGCFUNC;
     374/** Pointer to a const function descriptor. */
     375typedef const struct DBGCFUNC *PCDBGCFUNC;
    371376
    372377/** Pointer to helper functions for commands. */
     
    887892/**
    888893 * DBGC command descriptor.
    889  *
    890  * If a pResultDesc is specified the command can be called and used
    891  * as a function too. If it's a pure function, set fFlags to
    892  * DBGCCMD_FLAGS_FUNCTION.
    893894 */
    894895typedef struct DBGCCMD
     
    920921
    921922
     923/**
     924 * Function handler.
     925 *
     926 * The console will call the handler for a command once it's finished
     927 * parsing the user input.  The command handler function is responsible
     928 * for executing the command itself.
     929 *
     930 * @returns VBox status.
     931 * @param   pCmd        Pointer to the command descriptor (as registered).
     932 * @param   pCmdHlp     Pointer to command helper functions.
     933 * @param   pVM         Pointer to the current VM (if any).
     934 * @param   paArgs      Pointer to (readonly) array of arguments.
     935 * @param   cArgs       Number of arguments in the array.
     936 * @param   pResult     Where to return the result.
     937 */
     938typedef DECLCALLBACK(int) FNDBGCFUNC(PCDBGCFUNC pFunc, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs,
     939                                     PDBGCVAR pResult);
     940/** Pointer to a FNDBGCFUNC() function. */
     941typedef FNDBGCFUNC *PFNDBGCFUNC;
     942
     943/**
     944 * DBGC function descriptor.
     945 */
     946typedef struct DBGCFUNC
     947{
     948    /** Command string. */
     949    const char     *pszFuncNm;
     950    /** Minimum number of arguments. */
     951    unsigned        cArgsMin;
     952    /** Max number of arguments. */
     953    unsigned        cArgsMax;
     954    /** Argument descriptors (array). */
     955    PCDBGCVARDESC   paArgDescs;
     956    /** Number of argument descriptors. */
     957    unsigned        cArgDescs;
     958    /** flags. (reserved for now) */
     959    unsigned        fFlags;
     960    /** Handler function. */
     961    PFNDBGCFUNC     pfnHandler;
     962    /** Function syntax. */
     963    const char     *pszSyntax;
     964    /** Function description. */
     965    const char     *pszDescription;
     966} DBGCFUNC;
     967
     968
    922969
    923970/** Pointer to a DBGC backend. */
  • trunk/include/VBox/err.h

    r41559 r41561  
    21662166/** Syntax error - Command not found. */
    21672167#define VERR_DBGC_PARSE_COMMAND_NOT_FOUND           (VERR_DBGC_PARSE_LOWEST + 24)
     2168/** Syntax error - buggy parser. */
     2169#define VERR_DBGC_PARSE_BUG                         (VERR_DBGC_PARSE_LOWEST + 25)
    21682170
    21692171
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette