-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Increments-major-version-of: ttyr-api Increments-minor-version-of: other
- Loading branch information
Showing
8 changed files
with
154 additions
and
32 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
Submodule Netzhaut
updated
17 files
+3 −0 | .gitmodules | |
+3 −4 | build/automation/Makefile | |
+46 −0 | build/automation/Makefile2 | |
+1 −0 | external/TTyr | |
+26 −42 | src/bin/nhhtml/Main.c | |
+24 −29 | src/lib/nhapi/nhcore.c | |
+8 −7 | src/lib/nhapi/nhcore.h | |
+1 −1 | src/lib/nhcore/Common/Initialize.c | |
+1 −1 | src/lib/nhcore/Common/Initialize.h | |
+40 −76 | src/lib/nhcore/Loader/Library.c | |
+3 −3 | src/lib/nhcore/Loader/Library.h | |
+24 −23 | src/lib/nhcore/Loader/Loader.c | |
+5 −5 | src/lib/nhcore/Loader/Loader.h | |
+21 −21 | src/lib/nhcore/System/Logger.c | |
+7 −7 | src/lib/nhcore/System/Logger.h | |
+218 −244 | src/lib/nhcore/System/Monitor.c | |
+0 −53 | src/lib/nhcore/System/Monitor.h |
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 |
---|---|---|
@@ -0,0 +1,55 @@ | ||
// LICENSE NOTICE ================================================================================== | ||
|
||
/** | ||
* TTýr - Terminal Emulator | ||
* Copyright (C) 2022 Dajo Frey | ||
* Published under GNU LGPL. See TTyr/LICENSE.LGPL file. | ||
*/ | ||
|
||
// INCLUDES ======================================================================================== | ||
|
||
#include "ttyr-api.h" | ||
|
||
#include <stdio.h> | ||
#include <stdlib.h> | ||
#include <assert.h> | ||
#include <elf.h> | ||
#include <link.h> | ||
#include <string.h> | ||
|
||
// FUNCTIONS ======================================================================================= | ||
|
||
char TTYR_API_PATH_P[255] = {NULL}; | ||
|
||
void ttyr_api_initialize() | ||
{ | ||
const ElfW(Dyn) *dyn = _DYNAMIC; | ||
const ElfW(Dyn) *rpath = NULL; | ||
const ElfW(Dyn) *runpath = NULL; | ||
const char *strtab = NULL; | ||
|
||
for (; dyn->d_tag != DT_NULL; ++dyn) { | ||
if (dyn->d_tag == DT_RPATH) { | ||
rpath = dyn; | ||
} else if (dyn->d_tag == DT_RUNPATH) { | ||
runpath = dyn; | ||
} else if (dyn->d_tag == DT_STRTAB) { | ||
strtab = (const char *)dyn->d_un.d_val; | ||
} | ||
} | ||
|
||
assert(strtab != NULL); | ||
|
||
if (rpath != NULL) { | ||
sprintf(TTYR_API_PATH_P, strtab + rpath->d_un.d_val); | ||
} else if (runpath != NULL) { | ||
sprintf(TTYR_API_PATH_P, strtab + runpath->d_un.d_val); | ||
} | ||
|
||
for (int i = 0; i < strlen(TTYR_API_PATH_P); ++i) { | ||
if (TTYR_API_PATH_P[i] == ':') { | ||
TTYR_API_PATH_P[i] = 0; | ||
break; | ||
} | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#ifndef TTYR_API_H | ||
#define TTYR_API_H | ||
|
||
#ifndef DOXYGEN_SHOULD_SKIP_THIS | ||
|
||
/** | ||
* TTýr - Terminal Emulator | ||
* Copyright (C) 2022 Dajo Frey | ||
* Published under GNU LGPL. See TTyr/LICENSE.LGPL file. | ||
*/ | ||
|
||
#include "ttyr-tty.h" | ||
#include "ttyr-terminal.h" | ||
|
||
#endif | ||
|
||
/** @defgroup api_nhtty nhtty | ||
* @brief Environment for running text based programs. | ||
* | ||
* In this API, TTY stands for TeleType and provides an interface for | ||
* writing text based programs. Using these programs, it processes input streams from either | ||
* standard input or \ref ttyr_tty_sendInput and sends the result to either standard | ||
* output or a \ref ttyr_terminal_Terminal. Text based programs can be either added | ||
* by using \ref ttyr_tty_addDefaultProgram or \ref ttyr_tty_addCustomProgram. | ||
*/ | ||
|
||
/** @addtogroup api_nhtty | ||
* @{ | ||
*/ | ||
|
||
extern char TTYR_API_PATH_P[255]; | ||
|
||
void ttyr_api_initialize( | ||
); | ||
|
||
/** @} */ | ||
|
||
#endif // TTYR_API_H |
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