-
-
Notifications
You must be signed in to change notification settings - Fork 589
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Yuxuan Shui <[email protected]>
- Loading branch information
Showing
6 changed files
with
59 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,13 +3,11 @@ | |
// Copyright (c) 2013 Richard Grenville <[email protected]> | ||
|
||
#include <ctype.h> | ||
#include <errno.h> | ||
#include <dlfcn.h> | ||
#include <fcntl.h> | ||
#include <limits.h> | ||
#include <math.h> | ||
#include <stdbool.h> | ||
#include <stddef.h> | ||
#include <stdint.h> | ||
#include <stdio.h> | ||
#include <stdlib.h> | ||
#include <string.h> | ||
|
@@ -20,16 +18,11 @@ | |
|
||
#include <test.h> | ||
|
||
#include "c2.h" | ||
#include "common.h" | ||
#include "compiler.h" | ||
#include "kernel.h" | ||
#include "log.h" | ||
#include "region.h" | ||
#include "string_utils.h" | ||
#include "types.h" | ||
#include "utils.h" | ||
#include "win.h" | ||
|
||
#include "config.h" | ||
|
||
|
@@ -632,6 +625,18 @@ void *parse_window_shader_prefix_with_cwd(const char *src, const char **end, voi | |
return parse_window_shader_prefix(src, end, cwd); | ||
} | ||
|
||
bool load_plugin(const char *name, const char *include_dir) { | ||
scoped_charp path = locate_auxiliary_file("plugins", optarg, include_dir); | ||
void *handle = NULL; | ||
if (!path) { | ||
handle = dlopen(name, RTLD_LAZY); | ||
} else { | ||
log_debug("Plugin %s resolved to %s", name, path); | ||
handle = dlopen(path, RTLD_LAZY); | ||
} | ||
return handle != NULL; | ||
} | ||
|
||
bool parse_config(options_t *opt, const char *config_file) { | ||
// clang-format off | ||
*opt = (struct options){ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters