Index: EcnlProtoTool/trunk/ntshell/src/shellif.h
===================================================================
--- EcnlProtoTool/trunk/ntshell/src/shellif.h	(revision 439)
+++ EcnlProtoTool/trunk/ntshell/src/shellif.h	(revision 441)
@@ -50,9 +50,9 @@
  *  @(#) $Id$
  */
-#ifndef SHELLIF_H
-#define SHELLIF_H
+#ifndef _SHELLIF_H_
+#define _SHELLIF_H_
 
 #ifdef _MSC_VER
-#include <time.h>
+#undef NULL
 #endif
 
@@ -92,7 +92,5 @@
 #include "../musl-1.1.18/include/bits/stat.h"
 #include "../musl-1.1.18/include/sys/select.h"
-#ifndef _MSC_VER
 #include "../musl-1.1.18/include/time.h"
-#endif
 #include "../musl-1.1.18/include/signal.h"
 #include "../musl-1.1.18/include/stdio.h"
@@ -107,6 +105,13 @@
 #include <stdarg.h>
 
+#define DebugBreak()	asm("bkpt #0")
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 // time.h
 #define CLOCK_REALTIME 0
+int shell_nanosleep(const struct timespec *req, struct timespec *rem);
 
 // dirent.h
@@ -154,27 +159,29 @@
 // signal.h
 int shell_sigprocmask(int how, const sigset_t *restrict set, sigset_t *restrict old);
-int shell_sigaction(int sig, const struct sigaction *restrict sa, struct sigaction *restrict old);
+struct k_sigaction;
+int shell_sigaction(int sig, const struct k_sigaction *restrict sa,
+	struct k_sigaction *restrict old, size_t size);
 // socket.h
 int shell_socket(int, int, int);
 int shell_connect(int, const struct sockaddr *, socklen_t);
-ssize_t shell_send(int, const void *, size_t, int);
 ssize_t shell_sendto(int, const void *, size_t, int, const struct sockaddr *, socklen_t);
 ssize_t shell_sendmsg(int, const struct msghdr *, int);
 int shell_bind(int, const struct sockaddr *, socklen_t);
 int shell_listen(int, int);
-int shell_accept(int, struct sockaddr *__restrict, socklen_t *__restrict);
-ssize_t shell_recv(int, void *, size_t, int);
-ssize_t shell_recvfrom(int, void *__restrict, size_t, int, struct sockaddr *__restrict, socklen_t *__restrict);
+int shell_accept(int, struct sockaddr *restrict, socklen_t *restrict);
+ssize_t shell_recvfrom(int, void *restrict, size_t, int, struct sockaddr *restrict, socklen_t *restrict);
 ssize_t shell_recvmsg(int, struct msghdr *, int);
-int shell_getsockopt(int, int, int, void *__restrict, socklen_t *__restrict);
+int shell_getsockopt(int, int, int, void *restrict, socklen_t *restrict);
 int shell_setsockopt(int, int, int, const void *, socklen_t);
 int shell_shutdown(int, int);
+int shell_getpeername(int fd, struct sockaddr *restrict addr, socklen_t *restrict len);
+int shell_getsockname(int fd, struct sockaddr *restrict addr, socklen_t *restrict len);
 // select.h
-int shell_select(int, fd_set *__restrict, fd_set *__restrict, fd_set *__restrict, struct timeval *__restrict);
+int shell_select(int, fd_set *restrict, fd_set *restrict, fd_set *restrict, struct timeval *restrict);
 // syslog.h
 void vsyslog (int, const char *, va_list);
 // termios.h
-int sio_tcgetattr (int, struct termios *);
-int sio_tcsetattr(int, int, const struct termios *);
+int tcgetattr (int, struct termios *);
+int tcsetattr(int, int, const struct termios *);
 // fcntl.h
 int shell_open(const char *, int, void *arg);
@@ -196,7 +203,7 @@
 int shell_chmod(const char *, mode_t);
 int shell_mkdir(const char *, mode_t);
-int shell_stat(const char *__restrict, struct stat *__restrict);
+int shell_stat(const char *restrict, struct stat *restrict);
 int shell_fstat(int, struct stat *);
-int shell_lstat(const char *__restrict, struct stat *__restrict);
+int shell_lstat(const char *restrict, struct stat *restrict);
 
 int shell_clock_getres(clockid_t clk_id, struct timespec *res);
@@ -215,6 +222,38 @@
 int shell_mprotect(void *addr, size_t len, int prot);
 // TODO
+int shell_clone(int, int);
+int shell_dup2(int, int);
+int shell_execve(const char *, char *const [], char *const []);
+int shell_faccessat(int, const char *, int, int);
+int shell_fchmodat(int, const char *, mode_t, int);
+int shell_flock(int, int);
+int shell_fork();
+int shell_futex(volatile int *, int, int, void *);
+int shell_futimesat(int, const char *, struct timeval *);
+int shell_getegid();
+int shell_geteuid();
+int shell_getgid();
+int shell_gettid();
+int shell_getuid();
 int shell_madvise(void *, size_t, int);
+int shell_mremap(void *, size_t, size_t, int, void *);
+int shell_munmap(void *, size_t);
+int shell_pipe(int [2]);
+int shell_pipe2(int [2], int);
+int shell_ppoll(struct pollfd *, nfds_t, const struct timespec *,const sigset_t *);
+int shell_pselect6(int, fd_set *restrict, fd_set *restrict,
+	fd_set *restrict, const struct timespec *restrict, const sigset_t *restrict);
+int shell_setpgid(pid_t, pid_t);
+int shell_setsid();
+int shell_symlink(const char *, const char *);
+int shell_tkill(int, int);
+int shell_umask(mode_t);
 int shell_uname(struct utsname *);
+int shell_utimensat(int, const char *, const struct timespec [2], int);
+int shell_utimes(const char *, struct timeval *);
+// sys/resource.h
+struct rusage;
+int shell_wait4(pid_t, int *, int, struct rusage *);
+ssize_t shell_getrandom(void *buf, size_t buflen, unsigned int flags);
 // âââmusl
 
@@ -239,11 +278,24 @@
 void __mbedcall_cp_asm();
 
+#include "ff.h"
+WCHAR Utf8_to_Utf16(const char *, int *); /* in ff.c */
+void Utf16_to_Utf8(unsigned char *, int *, UINT); /* in ff.c */
+
 #ifdef __cplusplus
 extern "C" {
 #endif
-void Kernel_StartExternal(int argc, char **argv);
+int Kernel_StartExternal(int argc, char **argv);
 #ifdef __cplusplus
 }
 #endif
 
-#endif /* SHELLIF_H */
+void *malloc(size_t size);
+void *calloc(size_t size, size_t count);
+void *realloc(void *ptr, size_t size);
+void free(void *ptr);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _SHELLIF_H_ */
