summaryrefslogtreecommitdiffhomepage
path: root/src/internal/ntux_ntaio_impl.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/internal/ntux_ntaio_impl.c')
-rw-r--r--src/internal/ntux_ntaio_impl.c29
1 files changed, 9 insertions, 20 deletions
diff --git a/src/internal/ntux_ntaio_impl.c b/src/internal/ntux_ntaio_impl.c
index 772df64..ec3389d 100644
--- a/src/internal/ntux_ntaio_impl.c
+++ b/src/internal/ntux_ntaio_impl.c
@@ -4,11 +4,15 @@
/* Released under GPLv2 and GPLv3; see COPYING.NTUX. */
/***********************************************************/
-#include <ntapi/ntapi.h>
#include <psxabi/sys_sysapi.h>
#include <psxabi/sys_errno.h>
-extern const ntapi_vtbl * ntux_ntapi;
+#include <psxxfi/xfi_base.h>
+#include <psxxfi/xfi_acl.h>
+
+#include <ntapi/nt_memory.h>
+#include <ntapi/nt_file.h>
+#include <ntapi/nt_process.h>
int ntux_sprintf(char * str, const char * fmt, ...)
{
@@ -16,7 +20,7 @@ int ntux_sprintf(char * str, const char * fmt, ...)
va_list ap;
va_start(ap, fmt);
- ret = ntux_ntapi->vsprintf(str, fmt, ap);
+ ret = __xfi_vsprintf(str, fmt, ap);
va_end(ap);
return ret;
@@ -28,7 +32,7 @@ int ntux_snprintf(char * str, size_t n, const char * fmt, ...)
va_list ap;
va_start(ap, fmt);
- ret = ntux_ntapi->vsnprintf(str, n, fmt, ap);
+ ret = __xfi_vsnprintf(str, n, fmt, ap);
va_end(ap);
return ret;
@@ -36,20 +40,5 @@ int ntux_snprintf(char * str, size_t n, const char * fmt, ...)
int ntux_isatty(int fildes)
{
- nt_runtime_data * rtdata;
-
- if ((ntux_ntapi->tt_get_runtime_data(&rtdata,0)))
- return 0;
-
- if (fildes == 0)
- return (rtdata->stdin_type == NT_FILE_TYPE_PTY);
-
- else if (fildes == 1)
- return (rtdata->stdout_type == NT_FILE_TYPE_PTY);
-
- else if (fildes == 2)
- return (rtdata->stderr_type == NT_FILE_TYPE_PTY);
-
- else
- return 0;
+ return __xfi_get_runtime_data_file_type(fildes) == NT_FILE_TYPE_PTY;
}