Blame src/internal/ptycon_driver_impl.h

0efa8c
#ifndef PTYCON_DRIVER_IMPL_H
0efa8c
#define PTYCON_DRIVER_IMPL_H
0efa8c
0efa8c
#include <ntapi/ntapi.h>
cfc59b
#include <ntcon/ntcon.h>
74eafc
#include <gdi/gdi.h>
cfc59b
0efa8c
#include <stdint.h>
0efa8c
#include <stdio.h>
0efa8c
0efa8c
#include <ptycon/ptycon.h>
f26f14
#include "ptycon_bridge_impl.h"
0efa8c
#include "argv/argv.h"
0efa8c
0efa8c
extern   const struct argv_option ptyc_default_options[];
0efa8c
extern   const ntapi_vtbl * ptyc_ntapi;
cfc59b
extern   const ntcon_vtbl * const ptyc_ntcon;
74eafc
extern   const gdi_vtbl *   const ptyc_gdi;
0efa8c
0efa8c
#define  ntapi ptyc_ntapi
cfc59b
#define  ntcon ptyc_ntcon
74eafc
#define  gdi   ptyc_gdi
0efa8c
0efa8c
enum app_tags {
0efa8c
	TAG_HELP,
0efa8c
	TAG_VERSION,
f67c20
	TAG_DAEMON,
64c887
	TAG_DEBUG,
d881b6
	TAG_SYSROOT,
fd0f9b
	TAG_BELL,
2de078
	TAG_CAT,
cc22da
	TAG_EXEC,
e9e742
	TAG_WAIT,
0efa8c
};
0efa8c
1bab02
struct ptyc_loop_ctx {
1bab02
	nt_thread_params	treader;
1bab02
	nt_thread_params	twriter;
1bab02
	nt_thread_params	tpoller;
1bab02
	nt_thread_params	tdbgevent;
1bab02
	nt_thread_params	tdbgoven;
1bab02
	nt_thread_params	tdbgraw;
1bab02
	int32_t			ficonic;
1bab02
	int32_t			fwinsize;
1bab02
};
1bab02
d918be
struct ptyc_client_ctx {
d918be
	void *			hprocess;
d918be
	void *			hthread;
d918be
	nt_cid			cid;
d918be
	nt_pty_client_info	clinfo;
d918be
};
d918be
0efa8c
struct ptyc_driver_ctx_impl {
c26174
	nt_rtdata *		rtdata;
d918be
	struct ptyc_client_ctx	clctx;
1bab02
	struct ptyc_term_ctx	tctx;
1bab02
	struct ptyc_loop_ctx	lctx;
0efa8c
	struct ptyc_common_ctx	cctx;
0efa8c
	struct ptyc_driver_ctx	ctx;
0efa8c
};
0efa8c
9b8e64
static inline struct ptyc_driver_ctx_impl * ptyc_get_driver_ictx(struct ptyc_driver_ctx * dctx)
9b8e64
{
9b8e64
	uintptr_t addr;
9b8e64
9b8e64
	if (dctx) {
9b8e64
		addr = (uintptr_t)dctx - offsetof(struct ptyc_driver_ctx_impl,ctx);
9b8e64
		return (struct ptyc_driver_ctx_impl *)addr;
9b8e64
	}
9b8e64
9b8e64
	return 0;
9b8e64
}
9b8e64
acafe9
int32_t ptyc_open_file(void ** hfile, void * hat, const char * arg, bool fprivate);
acafe9
int32_t ptyc_open_dir(void ** hfile, void * hat, const char * arg, bool fprivate);
acafe9
0efa8c
#endif