- Timestamp:
- Jun 30, 2010 5:29:59 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/branches/projects/cli/pjlib-util/include/pjlib-util/cli.h
r3211 r3231 38 38 39 39 /** 40 * Maximum length of command buffer.41 */42 #ifndef PJ_CLI_MAX_CMDBUF43 # define PJ_CLI_MAX_CMDBUF 12044 #endif45 46 /**47 * Maximum command arguments.48 */49 #ifndef PJ_CLI_MAX_ARGS50 # define PJ_CLI_MAX_ARGS 851 #endif52 53 /**54 * Maximum short name version (shortcuts) for a command.55 */56 #ifndef PJ_CLI_MAX_SHORTCUTS57 # define PJ_CLI_MAX_SHORTCUTS 458 #endif59 60 /*61 * New error constants (note: to be placed in errno.h with new values)62 */63 /**64 * @hideinitializer65 * End the current session. This is a special error code returned by66 * pj_cli_exec() to indicate that "exit" or equivalent command has been67 * called to end the current session.68 */69 #define PJ_CLI_EEXIT -10170 /**71 * @hideinitializer72 * A required CLI argument is not specified.73 */74 #define PJ_CLI_EMISSINGARG -10475 /**76 * @hideinitializer77 * Too many CLI arguments.78 */79 #define PJ_CLI_ETOOMANYARGS -10580 /**81 * @hideinitializer82 * Invalid CLI argument. Typically this is caused by extra characters83 * specified in the command line which does not match any arguments.84 */85 #define PJ_CLI_EINVARG -10686 /**87 * @hideinitializer88 * CLI command with the specified name already exist.89 */90 #define PJ_CLI_EBADNAME -10791 92 /**93 40 * This opaque structure represents a CLI application. A CLI application is 94 41 * the root placeholder of other CLI objects. In an application, one (and … … 146 93 */ 147 94 pj_pool_factory *pf; 148 149 /**150 * Specify whether only exact matching command will be executed. If151 * PJ_FALSE, the framework will accept any unique abbreviations of152 * the command. Please see the description of pj_cli_parse() function153 * for more info.154 *155 * Default: PJ_FALSE156 */157 pj_bool_t exact_cmd;158 95 159 96 } pj_cli_cfg; … … 383 320 */ 384 321 PJ_DECL(void) pj_cli_exec_info_default(pj_cli_exec_info *param); 322 323 /** 324 * Write a log message to the CLI application. The CLI application 325 * will send the log message to all the registered front-ends. 326 * 327 * @param cli The CLI application instance. 328 * @param level Verbosity level of this message message. 329 * @param buffer The message itself. 330 * @param len Length of this message. 331 */ 332 PJ_DECL(void) pj_cli_write_log(pj_cli_t *cli, 333 int level, 334 const char *buffer, 335 int len); 385 336 386 337 /** … … 498 449 * registered in the CLI application. 499 450 * 500 * By default, a command may be matched by any shorter abbreviations of the501 * command that uniquely identify the command. For example, suppose two502 * commands "help" and "hold" are currently the only commands registered in503 * the CLI application. In this case, specifying "he" and "hel" would also504 * match "help" command, and similarly "ho" and "hol" would also match "hold"505 * command, but specifying "h" only would yield an error as it would match506 * more than one commands. This matching behavior can be turned off by507 * setting \a pj_cli_cfg.exact_cmd to PJ_TRUE.508 *509 451 * Zero or more arguments follow the command name. Arguments are separated by 510 452 * one or more whitespaces. Argument may be placed inside a pair of quotes, … … 517 459 * 518 460 * The cmdline may be followed by an extra newline (LF or CR-LF characters), 519 * which simply will be ignored. However any more characters following this520 * newline will cause an error to be returned.461 * which will be removed by the function. However any more characters 462 * following this newline will cause an error to be returned. 521 463 * 522 464 * @param sess The CLI session.
Note: See TracChangeset
for help on using the changeset viewer.