summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--include/ptycon/ptycon.h5
-rw-r--r--src/driver/ptyc_driver_ctx.c14
-rw-r--r--src/internal/ptycon_driver_impl.h1
-rw-r--r--src/skin/ptyc_skin_default.c7
4 files changed, 25 insertions, 2 deletions
diff --git a/include/ptycon/ptycon.h b/include/ptycon/ptycon.h
index 6309f27..930dd57 100644
--- a/include/ptycon/ptycon.h
+++ b/include/ptycon/ptycon.h
@@ -34,8 +34,9 @@ extern "C" {
#define PTYC_DRIVER_VERSION 0x0010
#define PTYC_DRIVER_DRY_RUN 0x0020
-#define PTYC_DRIVER_DBG_OVEN 0x0040
-#define PTYC_DRIVER_DBG_RAW 0x0080
+#define PTYC_DRIVER_DBG_EVENT 0x0040
+#define PTYC_DRIVER_DBG_OVEN 0x0080
+#define PTYC_DRIVER_DBG_RAW 0x0100
struct ptyc_source_version {
int major;
diff --git a/src/driver/ptyc_driver_ctx.c b/src/driver/ptyc_driver_ctx.c
index d403a98..e21e7ab 100644
--- a/src/driver/ptyc_driver_ctx.c
+++ b/src/driver/ptyc_driver_ctx.c
@@ -193,6 +193,20 @@ int ptyc_get_driver_ctx(
case TAG_VERSION:
cctx.drvflags |= PTYC_DRIVER_VERSION;
break;
+
+ case TAG_DEBUG:
+ if (!entry->arg)
+ cctx.drvflags |= PTYC_DRIVER_DBG_EVENT;
+
+ else if (!strcmp("event",entry->arg))
+ cctx.drvflags |= PTYC_DRIVER_DBG_EVENT;
+
+ else if (!strcmp("oven",entry->arg))
+ cctx.drvflags |= PTYC_DRIVER_DBG_OVEN;
+
+ else if (!strcmp("raw",entry->arg))
+ cctx.drvflags |= PTYC_DRIVER_DBG_RAW;
+ break;
}
} else
nunits++;
diff --git a/src/internal/ptycon_driver_impl.h b/src/internal/ptycon_driver_impl.h
index 3576cd4..c2a2475 100644
--- a/src/internal/ptycon_driver_impl.h
+++ b/src/internal/ptycon_driver_impl.h
@@ -20,6 +20,7 @@ extern const ntcon_vtbl * const ptyc_ntcon;
enum app_tags {
TAG_HELP,
TAG_VERSION,
+ TAG_DEBUG,
};
struct ptyc_driver_ctx_impl {
diff --git a/src/skin/ptyc_skin_default.c b/src/skin/ptyc_skin_default.c
index 85ce12e..9d710a6 100644
--- a/src/skin/ptyc_skin_default.c
+++ b/src/skin/ptyc_skin_default.c
@@ -8,5 +8,12 @@ const struct argv_option ptyc_default_options[] = {
{"help", 'h',TAG_HELP,ARGV_OPTARG_OPTIONAL,0,"short|long",0,
"show usage information [listing %s options only]"},
+ {"debug", 'd',TAG_DEBUG,ARGV_OPTARG_OPTIONAL,0,
+ "event|oven|raw",0,
+ "start an internal thread for debugging purposes. "
+ "event: display trace information for low-level console "
+ "events; oven|raw: start a pseudo client using a pty handle "
+ "in [cooked|raw] mode. default is 'event'."},
+
{0,0,0,0,0,0,0,0}
};