華為云計算 云知識 什么是libfastcommon
什么是libfastcommon

簡介

libfastcommon是在github開源的一個C基礎庫。它提供了ini文件解析、logger、64位唯一整數(shù)生成器、字符串處理、socket封裝、對象池、skiplist、定時任務調(diào)度器、時間輪等等。

配置安裝流程

1.配置編譯環(huán)境

安裝wget工具。

yum install wget -y

2.獲取源碼

獲取“libfastcommon-1.0.38”源碼包。

cd /usr/local/src

wget https://github.com/happyfish100/libfastcommon/archive/V1.0.38.tar.gz

3.編譯和安裝

1)解壓軟件包。

tar -zxvf V1.0.38.tar.gz

2)進入libfastcommon的安裝目錄。

cd libfastcommon-1.0.38/

3)編譯安裝libfastcommon。

./make.sh

./make.sh install

----結(jié)束

4.運行和驗證

直接用源碼中自帶的test程序進行驗證。

cd /usr/local/src/libfastcommon-1.0.38/src/tests

make

./test_ini_parser

系統(tǒng)回顯如下,則表示安裝成功,可以正常運行。

global section, item count: 3

1. bind_ip=192.168.0.162

2. host=ecs

3. thread_count=26

 

section: AccessLogSpaceCharConvert, item count: 8

1. \0="\0"

2. \\="\

3. \f="\f"

4. \n="\n"

5. \r="\r"

6. \s="\s"

7. \t="\t"

8. \v="\v"