Sfoglia il codice sorgente

refactor: sig设置为私有模块

SongZihuan 3 anni fa
parent
commit
93e3e03c03
7 ha cambiato i file con 25 aggiunte e 24 eliminazioni
  1. 0 1
      include/core/aFunCore.h
  2. 0 21
      include/core/sig.h
  3. 21 0
      src/core/__sig.h
  4. 1 1
      src/core/core_init.c
  5. 1 0
      src/core/env.c
  6. 1 1
      src/core/run.c
  7. 1 0
      src/core/sig.c

+ 0 - 1
include/core/aFunCore.h

@@ -11,7 +11,6 @@
 #include "runtime_error.h"
 
 #include "core_init.h"
-#include "sig.h"
 #include "run.h"
 #include "code.h"
 #include "bytecode.h"

+ 0 - 21
include/core/sig.h

@@ -1,21 +0,0 @@
-#ifndef AFUN_SIG_H
-#define AFUN_SIG_H
-#include <signal.h>
-#include "aFunCoreExport.h"
-
-struct af_SignalInfo {
-    void *sig_int;
-    void *sig_term;
-#if (defined SIGUSR1 && defined SIGUSR2)
-    void *sig_u1;
-    void *sig_u2;
-#endif
-};
-
-typedef struct af_SignalInfo af_SignalInfo;
-
-AFUN_CORE_EXPORT void aFunSignalInit(af_SignalInfo *sig_info);
-AFUN_CORE_EXPORT void aFunSignalRecover(af_SignalInfo *sig_info);
-AFUN_CORE_EXPORT bool aFunGetSignal(int signum);
-
-#endif //AFUN_SIG_H

+ 21 - 0
src/core/__sig.h

@@ -0,0 +1,21 @@
+#ifndef AFUN___SIG_H_
+#define AFUN___SIG_H_
+#include <signal.h>
+#include "aFunCoreExport.h"
+
+struct af_SignalInfo {
+    void *sig_int;
+    void *sig_term;
+#if (defined SIGUSR1 && defined SIGUSR2)
+    void *sig_u1;
+    void *sig_u2;
+#endif
+};
+
+typedef struct af_SignalInfo af_SignalInfo;
+
+AFUN_CORE_NO_EXPORT void aFunSignalInit(af_SignalInfo *sig_info);
+AFUN_CORE_NO_EXPORT void aFunSignalRecover(af_SignalInfo *sig_info);
+AFUN_CORE_NO_EXPORT bool aFunGetSignal(int signum);
+
+#endif //AFUN___SIG_H_

+ 1 - 1
src/core/core_init.c

@@ -4,7 +4,7 @@
  */
 
 #include "core_init.h"
-#include "sig.h"
+#include "__sig.h"
 #include "tool.h"
 #include <locale.h>
 

+ 1 - 0
src/core/env.c

@@ -2,6 +2,7 @@
 #include "__env.h"
 #include "__global_obj.h"
 #include "__run.h"
+#include "__sig.h"
 
 /* Core 创建和释放 */
 static af_Core *makeCore(enum GcRunTime grt, af_Environment *env);

+ 1 - 1
src/core/run.c

@@ -1,5 +1,5 @@
 #include "aFunCore.h"
-
+#include "__sig.h"
 #include "__run.h"
 #include "__env.h"
 

+ 1 - 0
src/core/sig.c

@@ -1,4 +1,5 @@
 #include "aFunCore.h"
+#include "__sig.h"
 
 static volatile sig_atomic_t sig_int = 0;  // SIGINT (Windows & *nix)
 static volatile sig_atomic_t sig_term = 0;  // SIGTERM (*nix)