mirror of
https://github.com/clearlinux/linux-steam-integration.git
synced 2026-10-04 16:08:24 +00:00
redirect: Start designing the generic ops table
Signed-off-by: Ikey Doherty <ikey@solus-project.com>
This commit is contained in:
@@ -23,6 +23,8 @@
|
||||
|
||||
#include "nica/util.h"
|
||||
|
||||
#include "redirect.h"
|
||||
|
||||
/**
|
||||
* Whether we've initialised yet or not.
|
||||
*/
|
||||
|
||||
@@ -0,0 +1,67 @@
|
||||
/*
|
||||
* This file is part of linux-steam-integration.
|
||||
*
|
||||
* Copyright © 2017 Ikey Doherty <ikey@solus-project.com>
|
||||
*
|
||||
* linux-steam-integration is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public License as
|
||||
* published by the Free Software Foundation; either version 2.1
|
||||
* of the License, or (at your option) any later version.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
/**
|
||||
* The type of redirect required
|
||||
*/
|
||||
typedef enum {
|
||||
LSI_REDIRECT_MIN = 1,
|
||||
LSI_REDIRECT_PATH,
|
||||
} LsiRedirectType;
|
||||
|
||||
/**
|
||||
* LsiRedirect describes the configuration required for each operation.
|
||||
*/
|
||||
typedef struct LsiRedirect {
|
||||
LsiRedirectType type;
|
||||
union {
|
||||
/* Path replacement */
|
||||
struct {
|
||||
const char *path_source;
|
||||
const char *path_target;
|
||||
bool path_relative;
|
||||
};
|
||||
};
|
||||
struct LsiRedirect *next;
|
||||
} LsiRedirect;
|
||||
|
||||
/**
|
||||
* LsiRedirectOperation specifies the syscall we're intended for.
|
||||
*/
|
||||
typedef enum { LSI_OPERATION_OPEN = 0, LSI_NUM_OPERATIONS } LsiRedirectOperation;
|
||||
|
||||
/**
|
||||
* We build an LsiRedirectProfile to match the current process.
|
||||
* It contains a table of LsiRedirect members corresponding to a given
|
||||
* op, i.e:
|
||||
*
|
||||
* op_table[LSI_OPERATION_OPEN]
|
||||
*/
|
||||
typedef struct LsiRedirectProfile {
|
||||
const char *name; /**< Name for this profile */
|
||||
|
||||
LsiRedirect op_table[LSI_NUM_OPERATIONS]; /* vtable information */
|
||||
} LsiRedirectProfile;
|
||||
|
||||
/*
|
||||
* Editor modelines - https://www.wireshark.org/tools/modelines.html
|
||||
*
|
||||
* Local variables:
|
||||
* c-basic-offset: 8
|
||||
* tab-width: 8
|
||||
* indent-tabs-mode: nil
|
||||
* End:
|
||||
*
|
||||
* vi: set shiftwidth=8 tabstop=8 expandtab:
|
||||
* :indentSize=8:tabSize=8:noTabs=true:
|
||||
*/
|
||||
Reference in New Issue
Block a user