ithewei 5 سال پیش
والد
کامیت
67feb2397a
6فایلهای تغییر یافته به همراه21 افزوده شده و 12 حذف شده
  1. 3 0
      Makefile
  2. 2 0
      Makefile.vars
  3. 0 4
      base/hbase.h
  4. 3 3
      base/hsysinfo.h
  5. 9 1
      docs/apis.md
  6. 4 4
      event/hevent.h

+ 3 - 0
Makefile

@@ -18,11 +18,14 @@ ifeq ($(WITH_HTTP), yes)
 LIBHV_HEADERS += $(HTTP_HEADERS)
 LIBHV_SRCDIRS += http
 ifeq ($(WITH_HTTP_SERVER), yes)
+LIBHV_HEADERS += $(HTTP_SERVER_HEADERS)
 LIBHV_SRCDIRS += http/server
 endif
 ifeq ($(WITH_HTTP_CLIENT), yes)
+LIBHV_HEADERS += $(HTTP_CLIENT_HEADERS)
 LIBHV_SRCDIRS += http/client
 ifeq ($(WITH_CONSUL), yes)
+LIBHV_HEADERS += $(CONSUL_HEADERS)
 LIBHV_SRCDIRS += consul
 endif
 endif

+ 2 - 0
Makefile.vars

@@ -60,3 +60,5 @@ HTTP_HEADERS =  http/httpdef.h\
 HTTP_CLIENT_HEADERS = http/client/http_client.h
 
 HTTP_SERVER_HEADERS = http/server/HttpService.h http/server/HttpServer.h
+
+CONSUL_HEADERS = consul/consul.h

+ 0 - 4
base/hbase.h

@@ -1,10 +1,6 @@
 #ifndef HV_BASE_H_
 #define HV_BASE_H_
 
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
 #include "hdef.h"
 
 #ifdef __cplusplus

+ 3 - 3
base/hsysinfo.h

@@ -1,5 +1,5 @@
-#ifndef H_SYS_INFO_H_
-#define H_SYS_INFO_H_
+#ifndef HV_SYS_INFO_H_
+#define HV_SYS_INFO_H_
 
 #include "hplatform.h"
 
@@ -47,4 +47,4 @@ static inline int get_meminfo(meminfo_t* mem) {
 #endif
 }
 
-#endif // H_SYS_INFO_H_
+#endif // HV_SYS_INFO_H_

+ 9 - 1
docs/apis.md

@@ -37,6 +37,7 @@
 - gethrtime
 - sleep
 - msleep
+- usleep
 - hv_compile_datetime
 - days_of_month
 - month_atoi
@@ -316,6 +317,7 @@
 - HSize
 - HRect
 - `hv::MutexLock`
+- `hv::SpinLock`
 - `hv::RWLock`
 
 # marcos
@@ -410,14 +412,20 @@
 - htimed_mutex_init
 - htimed_mutex_destroy
 - htimed_mutex_lock
-- htimed_mutex_unlock
 - htimed_mutex_lock_for
+- htimed_mutex_unlock
 - hcondvar_t
 - hcondvar_init
 - hcondvar_destroy
 - hcondvar_wait
+- hcondvar_wait_for
 - hcondvar_signal
 - hcondvar_broadcast
+- hsem_init
+- hsem_destroy
+- hsem_wait
+- hsem_post
+- hsem_timedwait
 - honce_t
 - HONCE_INIT
 - honce

+ 4 - 4
event/hevent.h

@@ -1,15 +1,15 @@
 #ifndef HV_EVENT_H_
 #define HV_EVENT_H_
 
+#include "hloop.h"
+#include "hbuf.h"
+#include "hmutex.h"
+
 #include "array.h"
 #include "list.h"
 #include "heap.h"
 #include "queue.h"
 
-#include "hloop.h"
-#include "hbuf.h"
-#include "hmutex.h"
-
 #define HLOOP_READ_BUFSIZE  8192
 
 typedef enum {