123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207 |
- #ifndef __PJLIB_UTIL_CLI_IMP_H__
- #define __PJLIB_UTIL_CLI_IMP_H__
- #include <pjlib-util/cli.h>
- PJ_BEGIN_DECL
- #ifndef PJ_CLI_CONSOLE_LOG_LEVEL
- # define PJ_CLI_CONSOLE_LOG_LEVEL PJ_LOG_MAX_LEVEL
- #endif
- #ifndef PJ_CLI_TELNET_LOG_LEVEL
- # define PJ_CLI_TELNET_LOG_LEVEL 4
- #endif
- #ifndef PJ_CLI_TELNET_PORT
- # define PJ_CLI_TELNET_PORT 0
- #endif
- typedef enum pj_cli_front_end_type
- {
- PJ_CLI_CONSOLE_FRONT_END,
- PJ_CLI_TELNET_FRONT_END,
- PJ_CLI_HTTP_FRONT_END,
- PJ_CLI_GUI_FRONT_END
- } pj_cli_front_end_type;
- typedef struct pj_cli_front_end_op
- {
-
- void (*on_write_log)(pj_cli_front_end *fe, int level,
- const char *data, pj_size_t len);
-
- void (*on_quit)(pj_cli_front_end *fe, pj_cli_sess *req);
-
- void (*on_destroy)(pj_cli_front_end *fe);
- } pj_cli_front_end_op;
- struct pj_cli_front_end
- {
-
- PJ_DECL_LIST_MEMBER(struct pj_cli_front_end);
-
- pj_cli_front_end_type type;
-
- pj_cli_t *cli;
-
- pj_cli_front_end_op *op;
- };
- typedef struct pj_cli_sess_op
- {
-
- void (*destroy)(pj_cli_sess *sess);
- } pj_cli_sess_op;
- struct pj_cli_sess
- {
-
- PJ_DECL_LIST_MEMBER(struct pj_cli_sess);
-
- pj_cli_front_end *fe;
-
- pj_cli_sess_op *op;
-
- pj_str_t info;
-
- int log_level;
- };
- PJ_END_DECL
- #endif
|