Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
阿啄debugIT
libfastcommon
提交
e610e8a4
L
libfastcommon
项目概览
阿啄debugIT
/
libfastcommon
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
L
libfastcommon
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
e610e8a4
编写于
7月 15, 2015
作者:
Y
yuqing
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
OS macro defines put in _os_define.h
上级
8045a6fa
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
61 addition
and
28 deletion
+61
-28
HISTORY
HISTORY
+5
-0
libfastcommon.spec
libfastcommon.spec
+1
-1
make.sh
make.sh
+35
-15
src/Makefile.in
src/Makefile.in
+1
-1
src/_os_bits.h
src/_os_bits.h
+0
-7
src/common_define.h
src/common_define.h
+2
-1
src/ioevent.h
src/ioevent.h
+1
-0
src/sched_thread.c
src/sched_thread.c
+8
-1
src/shared_func.c
src/shared_func.c
+8
-2
未找到文件。
HISTORY
浏览文件 @
e610e8a4
Version 1.18 2015-07-15
* OS macro defines put in _os_define.h
* remove file _os_bits.h
* schedule task support second field
Version 1.17 2015-07-14
* ini_file_reader.c change PJWHash to Time33Hash and increase capacity
* ini_file_reader.c realloc change to malloc and memcpy
...
...
libfastcommon.spec
浏览文件 @
e610e8a4
...
...
@@ -2,7 +2,7 @@
%define LibFastcommonDevel libfastcommon-devel
Name: libfastcommon
Version: 1.0.1
7
Version: 1.0.1
8
Release: 1%{?dist}
Summary: c common functions library extracted from my open source projects FastDFS
License: GPL
...
...
make.sh
浏览文件 @
e610e8a4
...
...
@@ -46,16 +46,6 @@ else
OFF_BITS
=
32
fi
cat
<<
EOF
> src/_os_bits.h
#ifndef _OS_BITS_H
#define _OS_BITS_H
#define OS_BITS
$OS_BITS
#define OFF_BITS
$OFF_BITS
#endif
EOF
DEBUG_FLAG
=
1
CFLAGS
=
'-Wall -D_FILE_OFFSET_BITS=64'
...
...
@@ -67,24 +57,54 @@ fi
LIBS
=
''
uname
=
`
uname
`
if
[
"
$uname
"
=
"Linux"
]
;
then
CFLAGS
=
"
$CFLAGS
-DOS_LINUX -DIOEVENT_USE_EPOLL"
OS_NAME
=
OS_LINUX
IOEVENT_USE
=
IOEVENT_USE_EPOLL
elif
[
"
$uname
"
=
"FreeBSD"
]
||
[
"
$uname
"
=
"Darwin"
]
;
then
CFLAGS
=
"
$CFLAGS
-DOS_FREEBSD -DIOEVENT_USE_KQUEUE"
OS_NAME
=
OS_FREEBSD
IOEVENT_USE
=
IOEVENT_USE_KQUEUE
if
[
"
$uname
"
=
"Darwin"
]
;
then
CFLAGS
=
"
$CFLAGS
-DDARWIN"
fi
elif
[
"
$uname
"
=
"SunOS"
]
;
then
CFLAGS
=
"
$CFLAGS
-DOS_SUNOS -D_THREAD_SAFE -DIOEVENT_USE_PORT"
OS_NAME
=
OS_SUNOS
IOEVENT_USE
=
IOEVENT_USE_PORT
CFLAGS
=
"
$CFLAGS
-D_THREAD_SAFE"
LIBS
=
"
$LIBS
-lsocket -lnsl -lresolv"
export
CC
=
gcc
elif
[
"
$uname
"
=
"AIX"
]
;
then
CFLAGS
=
"
$CFLAGS
-DOS_AIX -D_THREAD_SAFE"
OS_NAME
=
OS_AIX
IOEVENT_USE
=
IOEVENT_USE_NONE
CFLAGS
=
"
$CFLAGS
-D_THREAD_SAFE"
export
CC
=
gcc
elif
[
"
$uname
"
=
"HP-UX"
]
;
then
CFLAGS
=
"
$CFLAGS
-DOS_HPUX"
OS_NAME
=
OS_HPUX
IOEVENT_USE
=
IOEVENT_USE_NONE
else
OS_NAME
=
OS_UNKOWN
IOEVENT_USE
=
IOEVENT_USE_NONE
fi
cat
<<
EOF
> src/_os_define.h
#ifndef _OS_DEFINE_H
#define _OS_DEFINE_H
#define OS_BITS
$OS_BITS
#define OFF_BITS
$OFF_BITS
#ifndef
$OS_NAME
#define
$OS_NAME
1
#endif
#ifndef
$IOEVENT_USE
#define
$IOEVENT_USE
1
#endif
#endif
EOF
if
[
-f
/usr/lib/libpthread.so
]
||
[
-f
/usr/local/lib/libpthread.so
]
||
[
-f
/usr/lib64/libpthread.so
]
||
[
-f
/usr/lib/libpthread.a
]
||
[
-f
/usr/local/lib/libpthread.a
]
||
[
-f
/usr/lib64/libpthread.a
]
;
then
LIBS
=
"
$LIBS
-lpthread"
elif
[
-f
/usr/lib/libc_r.so
]
;
then
...
...
src/Makefile.in
浏览文件 @
e610e8a4
...
...
@@ -19,7 +19,7 @@ FAST_STATIC_OBJS = hash.o chain.o shared_func.o ini_file_reader.o \
connection_pool.o fast_mpool.o
HEADER_FILES
=
common_define.h hash.h chain.h logger.h base64.h
\
shared_func.h pthread_func.h ini_file_reader.h _os_
bits
.h
\
shared_func.h pthread_func.h ini_file_reader.h _os_
define
.h
\
sockopt.h sched_thread.h http_func.h md5.h local_ip_func.h
\
avl_tree.h ioevent.h ioevent_loop.h fast_task_queue.h
\
fast_timer.h process_ctrl.h fast_mblock.h
\
...
...
src/_os_bits.h
已删除
100644 → 0
浏览文件 @
8045a6fa
#ifndef _OS_BITS_H
#define _OS_BITS_H
#define OS_BITS 64
#define OFF_BITS 64
#endif
src/common_define.h
浏览文件 @
e610e8a4
...
...
@@ -52,7 +52,7 @@ extern int pthread_mutexattr_settype(pthread_mutexattr_t *attr, int kind);
#define PTHREAD_MUTEX_ERRORCHECK PTHREAD_MUTEX_ERRORCHECK_NP
#endif
#include "_os_
bits
.h"
#include "_os_
define
.h"
#ifdef OS_BITS
#if OS_BITS == 64
...
...
@@ -124,6 +124,7 @@ typedef struct
{
byte
hour
;
byte
minute
;
byte
second
;
}
TimeInfo
;
typedef
struct
...
...
src/ioevent.h
浏览文件 @
e610e8a4
...
...
@@ -4,6 +4,7 @@
#include <stdint.h>
#include <poll.h>
#include <sys/time.h>
#include "_os_define.h"
#define IOEVENT_TIMEOUT 0x8000
...
...
src/sched_thread.c
浏览文件 @
e610e8a4
...
...
@@ -81,7 +81,14 @@ static int sched_init_entries(ScheduleArray *pScheduleArray)
tm_base
.
tm_hour
=
pEntry
->
time_base
.
hour
;
tm_base
.
tm_min
=
pEntry
->
time_base
.
minute
;
tm_base
.
tm_sec
=
0
;
if
(
pEntry
->
time_base
.
second
>=
0
&&
pEntry
->
time_base
.
second
<=
59
)
{
tm_base
.
tm_sec
=
pEntry
->
time_base
.
second
;
}
else
{
tm_base
.
tm_sec
=
0
;
}
time_base
=
mktime
(
&
tm_base
);
pEntry
->
next_call_time
=
g_current_time
+
\
...
...
src/shared_func.c
浏览文件 @
e610e8a4
...
...
@@ -1819,6 +1819,8 @@ int get_time_item_from_conf(IniContext *pIniContext, \
char
*
pValue
;
int
hour
;
int
minute
;
int
second
;
int
count
;
pValue
=
iniGetStrValue
(
NULL
,
item_name
,
pIniContext
);
if
(
pValue
==
NULL
)
...
...
@@ -1828,7 +1830,9 @@ int get_time_item_from_conf(IniContext *pIniContext, \
return
0
;
}
if
(
sscanf
(
pValue
,
"%d:%d"
,
&
hour
,
&
minute
)
!=
2
)
second
=
0
;
count
=
sscanf
(
pValue
,
"%d:%d:%d"
,
&
hour
,
&
minute
,
&
second
);
if
(
count
!=
2
&&
count
!=
3
)
{
logError
(
"file: "
__FILE__
", line: %d, "
\
"item
\"
%s
\"
's value
\"
%s
\"
is not an valid time"
,
\
...
...
@@ -1836,7 +1840,8 @@ int get_time_item_from_conf(IniContext *pIniContext, \
return
EINVAL
;
}
if
((
hour
<
0
||
hour
>
23
)
||
(
minute
<
0
||
minute
>
59
))
if
((
hour
<
0
||
hour
>
23
)
||
(
minute
<
0
||
minute
>
59
)
||
(
second
<
0
||
second
>
59
))
{
logError
(
"file: "
__FILE__
", line: %d, "
\
"item
\"
%s
\"
's value
\"
%s
\"
is not an valid time"
,
\
...
...
@@ -1846,6 +1851,7 @@ int get_time_item_from_conf(IniContext *pIniContext, \
pTimeInfo
->
hour
=
(
byte
)
hour
;
pTimeInfo
->
minute
=
(
byte
)
minute
;
pTimeInfo
->
second
=
(
byte
)
second
;
return
0
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录