Add install

This commit is contained in:
Lamdonn 2024-10-20 20:23:15 +08:00
parent 0c6a112066
commit 81db585502
4 changed files with 228 additions and 130 deletions

View File

@ -12,61 +12,80 @@ It has the characteristics of **simplicity, universality, and efficiency**, with
## Content ## Content
| module | version | usage | path | describe | | module | version | usage | path | describe |
|:-------------|:---------|:-----------------------------|:--------------------------------------|:--------------------------------------| |:-------------|:---------|:-----------------------------|:------------------------------------------|:--------------------------------------|
| overall | 00.02.00 | [link](README.md) | ./ | Overall | overall | 00.02.00 | [link](README.md) | [path](./) | Overall
| init | 01.00.00 | [link](/doc/init.md) | ./source/00_application | Initialize export module | init | 01.00.00 | [link](/doc/init.md) | [path](./source/00_application) | Initialize export module
| console | 01.00.00 | [link](/doc/console.md) | ./source/00_application/console | Console command input, combined with the 'command' module, parsing commands entered in the console | console | 01.00.00 | [link](/doc/console.md) | [path](./source/00_application/console) | Console command input, combined with the 'command' module, parsing commands entered in the console
| arg | 01.00.00 | [link](/doc/arg.md) | ./source/01_general | Indefinite parameters, obtain the number of indefinite parameters and specified parameters | arg | 01.00.00 | [link](/doc/arg.md) | [path](./source/01_general) | Indefinite parameters, obtain the number of indefinite parameters and specified parameters
| calculate | 01.00.00 | [link](/doc/calculate.md) | ./source/01_general | Calculation module, input calculation expression to obtain calculation result | calculate | 01.00.00 | [link](/doc/calculate.md) | [path](./source/01_general) | Calculation module, input calculation expression to obtain calculation result
| command | 01.00.00 | [link](/doc/command.md) | ./source/01_general | Command parsing module, input string commands (similar to shell commands), execute corresponding command functions | command | 01.00.00 | [link](/doc/command.md) | [path](./source/01_general) | Command parsing module, input string commands (similar to shell commands), execute corresponding command functions
| cPatten | 01.00.00 | [link](/doc/cPatten.md) | ./source/01_general | Artistic character patterns | cPatten | 01.00.00 | [link](/doc/cPatten.md) | [path](./source/01_general) | Artistic character patterns
| cQueue | 01.00.00 | [link](/doc/cQueue.md) | ./source/01_general | Universal queue controller | cQueue | 01.00.00 | [link](/doc/cQueue.md) | [path](./source/01_general) | Universal queue controller
| dList | 01.00.00 | [link](/doc/dList.md) | ./source/01_general | Universal double-link list controller | sList | 01.00.01 | [link](/doc/sList.md) | [path](./source/01_general) | Universal single-link list controller
| fsm | 01.00.00 | [link](/doc/fsm.md) | ./source/01_general | Universal finite state machine module | dList | 01.00.01 | [link](/doc/dList.md) | [path](./source/01_general) | Universal double-link list controller
| kern | 01.00.00 | [link](/doc/kern.md) | ./source/01_general | The kernel module for scheduling periodic tasks is mostly used in varch testing | fsm | 01.00.00 | [link](/doc/fsm.md) | [path](./source/01_general) | Universal finite state machine module
| oscp | 01.00.00 | [link](/doc/oscp.md) | ./source/01_general | Analog oscilloscope module, can easily monitor the waveform of variable changes | kern | 01.00.00 | [link](/doc/kern.md) | [path](./source/01_general) | The kernel module for scheduling periodic tasks is mostly used in varch testing
| sList | 01.00.00 | [link](/doc/sList.md) | ./source/01_general | Universal single-link list controller | oscp | 01.00.00 | [link](/doc/oscp.md) | [path](./source/01_general) | Analog oscilloscope module, can easily monitor the waveform of variable changes
| tool | 01.00.00 | [link](/doc/tool.md) | ./source/01_general | General tools code | tool | 01.00.00 | [link](/doc/tool.md) | [path](./source/01_general) | General tools code
| valloc | 01.00.00 | [link](/doc/valloc.md) | ./source/01_general | Dynamic memory usage testing tool | valloc | 01.00.00 | [link](/doc/valloc.md) | [path](./source/01_general) | Dynamic memory usage testing tool
| vlog | 01.01.00 | [link](/doc/vlog.md) | ./source/01_general | Log output module | vlog | 01.01.00 | [link](/doc/vlog.md) | [path](./source/01_general) | Log output module
| intl | 01.00.00 | [link](/doc/intl.md) | ./source/01_general | Large integer arithmetic module | intl | 01.00.00 | [link](/doc/intl.md) | [path](./source/01_general) | Large integer arithmetic module
| vctype | 01.00.00 | [link](/doc/vctype.md) | ./source/02_vstd | Similar to the C standard library ctype | vctype | 01.00.00 | [link](/doc/vctype.md) | [path](./source/02_vstd) | Similar to the C standard library ctype
| vmath | 01.00.00 | [link](/doc/vmath.md) | ./source/02_vstd | Similar to the C standard library math | vmath | 01.00.00 | [link](/doc/vmath.md) | [path](./source/02_vstd) | Similar to the C standard library math
| vmem | 01.00.00 | [link](/doc/vmem.md) | ./source/02_vstd | Simple implementation of memory pool | vmem | 01.00.00 | [link](/doc/vmem.md) | [path](./source/02_vstd) | Simple implementation of memory pool
| vstddef | 01.00.00 | [link](/doc/vstddef.md) | ./source/02_vstd | Similar to the C standard library stddef | vstddef | 01.00.00 | [link](/doc/vstddef.md) | [path](./source/02_vstd) | Similar to the C standard library stddef
| vstdint | 01.00.00 | [link](/doc/vstdint.md) | ./source/02_vstd | Similar to the C standard library stdint | vstdint | 01.00.00 | [link](/doc/vstdint.md) | [path](./source/02_vstd) | Similar to the C standard library stdint
| vstdlib | 01.00.00 | [link](/doc/vstdlib.md) | ./source/02_vstd | Similar to the C standard library stdlib | vstdlib | 01.00.00 | [link](/doc/vstdlib.md) | [path](./source/02_vstd) | Similar to the C standard library stdlib
| vstring | 01.00.00 | [link](/doc/vstring.md) | ./source/02_vstd | Similar to the C standard library string | vstring | 01.00.00 | [link](/doc/vstring.md) | [path](./source/02_vstd) | Similar to the C standard library string
| deque | 01.00.00 | [link](/doc/deque.md) | ./source/03_container | Universal double-end queue container | queue | 01.00.00 | [link](/doc/queue.md) | [path](./source/03_container) | Universal queue container
| dict | 01.00.00 | [link](/doc/dict.md) | ./source/03_container | Universal dictionarie container, implementation based on hash table | stack | 01.00.00 | [link](/doc/stack.md) | [path](./source/03_container) | Universal stack container
| heap | 01.00.00 | [link](/doc/heap.md) | ./source/03_container | Universal heap container | deque | 01.00.00 | [link](/doc/deque.md) | [path](./source/03_container) | Universal double-end queue container
| list | 01.00.00 | [link](/doc/list.md) | ./source/03_container | Universal list container, single-link and internal iteration | list | 01.00.00 | [link](/doc/list.md) | [path](./source/03_container) | Universal list container, single-link and internal iteration
| map | 01.00.00 | [link](/doc/map.md) | ./source/03_container | Universal map container, implementation based on RB-tree | vector | 01.00.00 | [link](/doc/vector.md) | [path](./source/03_container) | Universal vector(array) container
| queue | 01.00.00 | [link](/doc/queue.md) | ./source/03_container | Universal queue container | str | 01.00.00 | [link](/doc/str.md) | [path](./source/03_container) | String class
| set | 01.00.00 | [link](/doc/set.md) | ./source/03_container | Universal set container, implementation based on RB-tree | dict | 01.00.00 | [link](/doc/dict.md) | [path](./source/03_container) | Universal dictionarie container, implementation based on hash table
| stack | 01.00.00 | [link](/doc/stack.md) | ./source/03_container | Universal stack container | heap | 01.00.00 | [link](/doc/heap.md) | [path](./source/03_container) | Universal heap container
| str | 01.00.00 | [link](/doc/str.md) | ./source/03_container | String class | set | 01.00.00 | [link](/doc/set.md) | [path](./source/03_container) | Universal set container, implementation based on RB-tree
| tree | 01.00.00 | [link](/doc/tree.md) | ./source/03_container | Universal tree container | map | 01.00.00 | [link](/doc/map.md) | [path](./source/03_container) | Universal map container, implementation based on RB-tree
| vector | 01.00.00 | [link](/doc/vector.md) | ./source/03_container | Universal vector(array) container | tree | 01.00.00 | [link](/doc/tree.md) | [path](./source/03_container) | Universal tree container
| graph | 01.00.00 | [link](/doc/graph.md) | ./source/03_container | Universal graph container | graph | 01.00.00 | [link](/doc/graph.md) | [path](./source/03_container) | Universal graph container
| check | 01.00.00 | [link](/doc/check.md) | ./source/04_algorithm | Verification algorithm, sum check, parity check, XOR check, LRC check | check | 01.00.00 | [link](/doc/check.md) | [path](./source/04_algorithm) | Verification algorithm, sum check, parity check, XOR check, LRC check
| crc | 01.00.00 | [link](/doc/check.md) | ./source/04_algorithm | Universal and standard CRC algorithms | crc | 01.00.00 | [link](/doc/check.md) | [path](./source/04_algorithm) | Universal and standard CRC algorithms
| encrypt | 01.00.00 | [link](/doc/encrypt.md) | ./source/04_algorithm | Encryption and decryption algorithms | encrypt | 01.00.00 | [link](/doc/encrypt.md) | [path](./source/04_algorithm) | Encryption and decryption algorithms
| filter | 01.00.00 | [link](/doc/filter.md) | ./source/04_algorithm | Filter algorithms, median, kalman, average | filter | 01.00.00 | [link](/doc/filter.md) | [path](./source/04_algorithm) | Filter algorithms, median, kalman, average
| hash | 01.00.00 | [link](/doc/hash.md) | ./source/04_algorithm | Hash algorithms, bkdr, ap, djb, js, rs, sdbm, pjw, elf, dek, bp, fnv, jdk6 | hash | 01.00.00 | [link](/doc/hash.md) | [path](./source/04_algorithm) | Hash algorithms, bkdr, ap, djb, js, rs, sdbm, pjw, elf, dek, bp, fnv, jdk6
| pid | 01.00.00 | [link](/doc/pid.md) | ./source/04_algorithm | PID control algorithm calculator | pid | 01.00.00 | [link](/doc/pid.md) | [path](./source/04_algorithm) | PID control algorithm calculator
| search | 01.00.00 | [link](/doc/search.md) | ./source/04_algorithm | Universal search algorithms, linear, binary | search | 01.00.00 | [link](/doc/search.md) | [path](./source/04_algorithm) | Universal search algorithms, linear, binary
| sort | 01.00.00 | [link](/doc/sort.md) | ./source/04_algorithm | Universal sorting algorithms (various data structures), bubble, select, insert, hill, quick, heap | sort | 01.00.00 | [link](/doc/sort.md) | [path](./source/04_algorithm) | Universal sorting algorithms (various data structures), bubble, select, insert, hill, quick, heap
| csv | 01.00.00 | [link](/doc/csv.md) | ./source/05_parser | CSV file parsing generator | csv | 01.00.00 | [link](/doc/csv.md) | [path](./source/05_parser) | CSV file parsing generator
| ini | 01.00.00 | [link](/doc/ini.md) | ./source/05_parser | INI configuration file parsing generator | ini | 01.00.00 | [link](/doc/ini.md) | [path](./source/05_parser) | INI configuration file parsing generator
| json | 01.00.00 | [link](/doc/json.md) | ./source/05_parser | JSON file parsing generator | json | 01.00.00 | [link](/doc/json.md) | [path](./source/05_parser) | JSON file parsing generator
| txls | 01.00.00 | [link](/doc/txls.md) | ./source/05_parser | TXLS file parsing generator | txls | 01.00.00 | [link](/doc/txls.md) | [path](./source/05_parser) | TXLS file parsing generator
| xml | 01.00.00 | [link](/doc/xml.md) | ./source/05_parser | XML file parsing generator | xml | 01.00.00 | [link](/doc/xml.md) | [path](./source/05_parser) | XML file parsing generator
## Usage ## Usage
The code is compiled and tested in a Linux environment. It can be compiled by configuring the files to be compiled in the `makefile` directory under the `build` directory, or by directly running the `run. sh` file to compile and run. The varch module should be kept as independent as possible, and in order to reduce dependence on other modules, most files can be directly extracted and used separately. If there are dependencies on other modules during compilation to solve dependency problems, but only data type dependencies, you can refer to defining the required types. The code is compiled and tested in a Linux environment. It can be compiled by configuring the files to be compiled in the `makefile` directory under the `build` directory, or by directly running the `run. sh` file to compile and run. The varch module should be kept as independent as possible, and in order to reduce dependence on other modules, most files can be directly extracted and used separately. If there are dependencies on other modules during compilation to solve dependency problems, but only data type dependencies, you can refer to defining the required types.
## Install
* linux
```
make install
```
* MinGW
```
make install LIBP=<MinGW install path>
```
demo:
```
make install LIBP=D:/MinGW
```
## License ## License
GNU GENERAL PUBLIC LICENSE GNU GENERAL PUBLIC LICENSE

119
README.md
View File

@ -12,61 +12,80 @@ varchwe-architecture意为我们的框架库是嵌入式C语言常用
## 内容 ## 内容
| module | version | usage | path | describe | | module | version | usage | path | describe |
|:-------------|:---------|:-----------------------------|:--------------------------------------|:--------------------------------------| |:-------------|:---------|:-----------------------------|:------------------------------------------|:--------------------------------------|
| overall | 00.02.00 | [link](README.md) | ./ | 整体 | overall | 00.02.00 | [link](README.md) | [path](./) | 整体
| init | 01.00.00 | [link](/doc/init.md) | ./source/00_application | 初始化导出模块 | init | 01.00.00 | [link](/doc/init.md) | [path](./source/00_application) | 初始化导出模块
| console | 01.00.00 | [link](/doc/console.md) | ./source/00_application/console | 控制台命令输入,结合 `command` 模块,解析在控制台中输入的命令 | console | 01.00.00 | [link](/doc/console.md) | [path](./source/00_application/console) | 控制台命令输入,结合 `command` 模块,解析在控制台中输入的命令
| arg | 01.00.00 | [link](/doc/arg.md) | ./source/01_general | 不定参数,获取不定参数和指定参数的个数 | arg | 01.00.00 | [link](/doc/arg.md) | [path](./source/01_general) | 不定参数,获取不定参数和指定参数的个数
| calculate | 01.00.00 | [link](/doc/calculate.md) | ./source/01_general | 计算模块,输入计算表达式,得到计算结果 | calculate | 01.00.00 | [link](/doc/calculate.md) | [path](./source/01_general) | 计算模块,输入计算表达式,得到计算结果
| command | 01.00.00 | [link](/doc/command.md) | ./source/01_general | 命令解析模块,输入字符串命令(类似于shell命令),执行相应的命令功能 | command | 01.00.00 | [link](/doc/command.md) | [path](./source/01_general) | 命令解析模块,输入字符串命令(类似于shell命令),执行相应的命令功能
| cPatten | 01.00.00 | [link](/doc/cPatten.md) | ./source/01_general | 艺术图案字符 | cPatten | 01.00.00 | [link](/doc/cPatten.md) | [path](./source/01_general) | 艺术图案字符
| cQueue | 01.00.00 | [link](/doc/cQueue.md) | ./source/01_general | 通用队列控制器 | cQueue | 01.00.00 | [link](/doc/cQueue.md) | [path](./source/01_general) | 通用队列控制器
| dList | 01.00.01 | [link](/doc/dList.md) | ./source/01_general | 通用双链表控制器 | sList | 01.00.01 | [link](/doc/sList.md) | [path](./source/01_general) | 通用单链表控制器
| fsm | 01.00.00 | [link](/doc/fsm.md) | ./source/01_general | 通用有限状态机模块 | dList | 01.00.01 | [link](/doc/dList.md) | [path](./source/01_general) | 通用双链表控制器
| kern | 01.00.00 | [link](/doc/kern.md) | ./source/01_general | 用于调度周期性任务的内核模块主要用于varch测试 | fsm | 01.00.00 | [link](/doc/fsm.md) | [path](./source/01_general) | 通用有限状态机模块
| oscp | 01.00.00 | [link](/doc/oscp.md) | ./source/01_general | 模拟示波器模块,可以方便地监测波形的变量变化 | kern | 01.00.00 | [link](/doc/kern.md) | [path](./source/01_general) | 用于调度周期性任务的内核模块主要用于varch测试
| sList | 01.00.01 | [link](/doc/sList.md) | ./source/01_general | 通用单链表控制器 | oscp | 01.00.00 | [link](/doc/oscp.md) | [path](./source/01_general) | 模拟示波器模块,可以方便地监测波形的变量变化
| tool | 01.00.00 | [link](/doc/tool.md) | ./source/01_general | 通用工具代码 | tool | 01.00.00 | [link](/doc/tool.md) | [path](./source/01_general) | 通用工具代码
| valloc | 01.00.00 | [link](/doc/valloc.md) | ./source/01_general | 动态内存使用测试工具 | valloc | 01.00.00 | [link](/doc/valloc.md) | [path](./source/01_general) | 动态内存使用测试工具
| vlog | 01.01.00 | [link](/doc/vlog.md) | ./source/01_general | 日志输出模块 | vlog | 01.01.00 | [link](/doc/vlog.md) | [path](./source/01_general) | 日志输出模块
| intl | 01.00.00 | [link](/doc/intl.md) | ./source/01_general | 大型整数运算模块 | intl | 01.00.00 | [link](/doc/intl.md) | [path](./source/01_general) | 大型整数运算模块
| vctype | 01.00.00 | [link](/doc/vctype.md) | ./source/02_vstd | 类似于C标准库ctype | vctype | 01.00.00 | [link](/doc/vctype.md) | [path](./source/02_vstd) | 类似于C标准库ctype
| vmath | 01.00.00 | [link](/doc/vmath.md) | ./source/02_vstd | 类似于C标准库math | vmath | 01.00.00 | [link](/doc/vmath.md) | [path](./source/02_vstd) | 类似于C标准库math
| vmem | 01.00.00 | [link](/doc/vmem.md) | ./source/02_vstd | 内存池的简单实现 | vmem | 01.00.00 | [link](/doc/vmem.md) | [path](./source/02_vstd) | 内存池的简单实现
| vstddef | 01.00.00 | [link](/doc/vstddef.md) | ./source/02_vstd | 类似于C标准库stddef | vstddef | 01.00.00 | [link](/doc/vstddef.md) | [path](./source/02_vstd) | 类似于C标准库stddef
| vstdint | 01.00.00 | [link](/doc/vstdint.md) | ./source/02_vstd | 类似于C标准库stdint | vstdint | 01.00.00 | [link](/doc/vstdint.md) | [path](./source/02_vstd) | 类似于C标准库stdint
| vstdlib | 01.00.00 | [link](/doc/vstdlib.md) | ./source/02_vstd | 类似于C标准库stdlib | vstdlib | 01.00.00 | [link](/doc/vstdlib.md) | [path](./source/02_vstd) | 类似于C标准库stdlib
| vstring | 01.00.00 | [link](/doc/vstring.md) | ./source/02_vstd | 类似于C标准库string | vstring | 01.00.00 | [link](/doc/vstring.md) | [path](./source/02_vstd) | 类似于C标准库string
| deque | 01.00.00 | [link](/doc/deque.md) | ./source/03_container | 通用双端队列容器 | queue | 01.00.00 | [link](/doc/queue.md) | [path](./source/03_container) | 通用队列容器
| dict | 01.00.00 | [link](/doc/dict.md) | ./source/03_container | 通用字典容器,基于哈希表实现 | stack | 01.00.00 | [link](/doc/stack.md) | [path](./source/03_container) | 通用栈式容器
| heap | 01.00.00 | [link](/doc/heap.md) | ./source/03_container | 通用堆容器 | deque | 01.00.00 | [link](/doc/deque.md) | [path](./source/03_container) | 通用双端队列容器
| list | 01.00.00 | [link](/doc/list.md) | ./source/03_container | 通用列表容器,单链接和支持内部迭代器 | list | 01.00.00 | [link](/doc/list.md) | [path](./source/03_container) | 通用列表容器,单链接和支持内部迭代器
| map | 01.00.00 | [link](/doc/map.md) | ./source/03_container | 通用映射容器基于RB-tree实现 | vector | 01.00.00 | [link](/doc/vector.md) | [path](./source/03_container) | 通用向量(数组)容器
| queue | 01.00.00 | [link](/doc/queue.md) | ./source/03_container | 通用队列容器 | str | 01.00.00 | [link](/doc/str.md) | [path](./source/03_container) | 字符串类
| set | 01.00.00 | [link](/doc/set.md) | ./source/03_container | 通用集合容器基于RB-tree实现 | dict | 01.00.00 | [link](/doc/dict.md) | [path](./source/03_container) | 通用字典容器,基于哈希表实现
| stack | 01.00.00 | [link](/doc/stack.md) | ./source/03_container | 通用栈式容器 | heap | 01.00.00 | [link](/doc/heap.md) | [path](./source/03_container) | 通用堆容器
| str | 01.00.00 | [link](/doc/str.md) | ./source/03_container | 字符串类 | set | 01.00.00 | [link](/doc/set.md) | [path](./source/03_container) | 通用集合容器基于RB-tree实现
| tree | 01.00.00 | [link](/doc/tree.md) | ./source/03_container | 通用树容器 | map | 01.00.00 | [link](/doc/map.md) | [path](./source/03_container) | 通用映射容器基于RB-tree实现
| vector | 01.00.00 | [link](/doc/vector.md) | ./source/03_container | 通用向量(数组)容器 | tree | 01.00.00 | [link](/doc/tree.md) | [path](./source/03_container) | 通用树容器
| graph | 01.00.00 | [link](/doc/graph.md) | ./source/03_container | 通用图容器 | graph | 01.00.00 | [link](/doc/graph.md) | [path](./source/03_container) | 通用图容器
| check | 01.00.00 | [link](/doc/check.md) | ./source/04_algorithm | 校验算法求和校验奇偶校验异或校验LRC校验 | check | 01.00.00 | [link](/doc/check.md) | [path](./source/04_algorithm) | 校验算法求和校验奇偶校验异或校验LRC校验
| crc | 01.00.00 | [link](/doc/check.md) | ./source/04_algorithm | 通用标准CRC算法 | crc | 01.00.00 | [link](/doc/check.md) | [path](./source/04_algorithm) | 通用标准CRC算法
| encrypt | 01.00.00 | [link](/doc/encrypt.md) | ./source/04_algorithm | 加密解密算法 | encrypt | 01.00.00 | [link](/doc/encrypt.md) | [path](./source/04_algorithm) | 加密解密算法
| filter | 01.00.00 | [link](/doc/filter.md) | ./source/04_algorithm | 滤波算法,中值,卡尔曼,平均值 | filter | 01.00.00 | [link](/doc/filter.md) | [path](./source/04_algorithm) | 滤波算法,中值,卡尔曼,平均值
| hash | 01.00.00 | [link](/doc/hash.md) | ./source/04_algorithm | 哈希算法bkdr、ap、djb、js、rs、sdbm、pjw、elf、dek、bp、fnv、jdk6 | hash | 01.00.00 | [link](/doc/hash.md) | [path](./source/04_algorithm) | 哈希算法bkdr、ap、djb、js、rs、sdbm、pjw、elf、dek、bp、fnv、jdk6
| pid | 01.00.00 | [link](/doc/pid.md) | ./source/04_algorithm | PID控制算法计算器 | pid | 01.00.00 | [link](/doc/pid.md) | [path](./source/04_algorithm) | PID控制算法计算器
| search | 01.00.00 | [link](/doc/search.md) | ./source/04_algorithm | 通用搜索算法,线性,二进制 | search | 01.00.00 | [link](/doc/search.md) | [path](./source/04_algorithm) | 通用搜索算法,线性,二进制
| sort | 01.00.00 | [link](/doc/sort.md) | ./source/04_algorithm | 通用排序算法(各种数据结构),冒泡排序、选择排序、插入排序、希尔排序、快速排序、堆排序 | sort | 01.00.00 | [link](/doc/sort.md) | [path](./source/04_algorithm) | 通用排序算法(各种数据结构),冒泡排序、选择排序、插入排序、希尔排序、快速排序、堆排序
| csv | 01.00.00 | [link](/doc/csv.md) | ./source/05_parser | CSV文件解析生成器 | csv | 01.00.00 | [link](/doc/csv.md) | [path](./source/05_parser) | CSV文件解析生成器
| ini | 01.00.00 | [link](/doc/ini.md) | ./source/05_parser | INI配置文件解析生成器 | ini | 01.00.00 | [link](/doc/ini.md) | [path](./source/05_parser) | INI配置文件解析生成器
| json | 01.00.00 | [link](/doc/json.md) | ./source/05_parser | JSON文件解析生成器 | json | 01.00.00 | [link](/doc/json.md) | [path](./source/05_parser) | JSON文件解析生成器
| txls | 01.00.00 | [link](/doc/txls.md) | ./source/05_parser | TXLS文件解析生成器 | txls | 01.00.00 | [link](/doc/txls.md) | [path](./source/05_parser) | TXLS文件解析生成器
| xml | 01.00.00 | [link](/doc/xml.md) | ./source/05_parser | XML文件解析生成器 | xml | 01.00.00 | [link](/doc/xml.md) | [path](./source/05_parser) | XML文件解析生成器
## 使用说明 ## 使用说明
代码在linux环境下编写编译测试在`built`目录下的`makefile`配置需要编译的文件进行编译即可,也可以直接运行`run.sh`文件编译加运行。varch模块尽可能的保持独立为了减少对其他模块的依赖大部分的文件是可以直接单独拎出来就可以直接使用。如果编译存在对其他模块的依赖解决依赖问题只是数据类型依赖的问题完全可以参考定义所需类型即可。 代码在linux环境下编写编译测试在`built`目录下的`makefile`配置需要编译的文件进行编译即可,也可以直接运行`run.sh`文件编译加运行。varch模块尽可能的保持独立为了减少对其他模块的依赖大部分的文件是可以直接单独拎出来就可以直接使用。如果编译存在对其他模块的依赖解决依赖问题只是数据类型依赖的问题完全可以参考定义所需类型即可。
## 安装
* linux
```
make install
```
* MinGW
```
make install LIBP=<MinGW install path>
```
例子:
```
make install LIBP=D:/MinGW
```
## 开源协议 ## 开源协议
GNU GENERAL PUBLIC LICENSE GNU GENERAL PUBLIC LICENSE

View File

@ -2,8 +2,10 @@
### config ### config
################################################################################## ##################################################################################
CC = gcc CC = gcc
AR = ar
BUILT_DIR = built BUILT_DIR = built
TARGET = app TARGET = app
LIB = varch
################################################################################## ##################################################################################
### source locations ### source locations
@ -22,47 +24,74 @@ PARSER_PATH = $(WORKSPACE)/05_parser
################################################################################## ##################################################################################
include $(TESTSPACE)/test.mk include $(TESTSPACE)/test.mk
INCLUDE += -I $(APPLICATION_PATH) INCLUDE += $(APPLICATION_PATH)
INCLUDE += -I $(GENDATA_PATH) INCLUDE += $(GENDATA_PATH)
INCLUDE += -I $(VSTD_PATH) INCLUDE += $(VSTD_PATH)
INCLUDE += -I $(CONTAINER_PATH) INCLUDE += $(CONTAINER_PATH)
INCLUDE += -I $(ALGORITHM_PATH) INCLUDE += $(ALGORITHM_PATH)
INCLUDE += -I $(PARSER_PATH) INCLUDE += $(PARSER_PATH)
SOURCES += $(APPLICATION_PATH)/init.c LIBSRCS += $(APPLICATION_PATH)/init.c
SOURCES += $(APPLICATION_PATH)/main.c LIBSRCS += $(wildcard $(APPLICATION_PATH)/console/*.c)
SOURCES += $(wildcard $(APPLICATION_PATH)/console/*.c) LIBSRCS += $(wildcard $(GENDATA_PATH)/*.c)
SOURCES += $(wildcard $(GENDATA_PATH)/*.c) LIBSRCS += $(wildcard $(VSTD_PATH)/*.c)
SOURCES += $(wildcard $(VSTD_PATH)/*.c) LIBSRCS += $(wildcard $(CONTAINER_PATH)/*.c)
SOURCES += $(wildcard $(CONTAINER_PATH)/*.c) LIBSRCS += $(wildcard $(ALGORITHM_PATH)/*.c)
SOURCES += $(wildcard $(ALGORITHM_PATH)/*.c) LIBSRCS += $(wildcard $(PARSER_PATH)/*.c)
SOURCES += $(wildcard $(PARSER_PATH)/*.c)
SOURCES += $(TEST_SRC) TESTSRC += $(APPLICATION_PATH)/main.c
TESTSRC += $(TEST_SRC)
################################################################################## ##################################################################################
### targets and recipes ### targets and recipes
################################################################################## ##################################################################################
OBJ_PATH = $(BUILT_DIR)/obj INCS = $(addprefix -I,$(INCLUDE))
BIN_PATH = $(BUILT_DIR)/bin OBJP = $(BUILT_DIR)/obj
OBJS = $(patsubst %.c, $(OBJ_PATH)/%.o, $(SOURCES)) BINP = $(BUILT_DIR)/bin
TAR_PATH = $(BIN_PATH)/$(TARGET) LIBO = $(patsubst %.c, $(OBJP)/%.o, $(LIBSRCS))
TSTO = $(patsubst %.c, $(OBJP)/%.o, $(TESTSRC))
OBJS = $(LIBO) $(TSTO)
TARP = $(BINP)/$(TARGET)
LIBN = lib$(LIB)
LIBA = $(BUILT_DIR)/$(LIBN).a
LIBP ?= /usr
# link # link
${TAR_PATH}:$(OBJS) ${TARP}:$(OBJS)
$(shell mkdir -p $(dir $@)) mkdir -p $(dir $@)
# @ $(CC) $(OBJS) -o $(TAR_PATH) -lm -lX11 -lpthread # @ $(CC) $(OBJS) -o $(TARP) -lm -lX11 -lpthread
@ $(CC) $(CFLAG) $(OBJS) -o $(TAR_PATH) -lm -lpthread @ $(CC) $(CFLAG) $(OBJS) -o $(TARP) -lm -lpthread
# compile # compile
$(OBJ_PATH)/%.o:%.c $(OBJP)/%.o:%.c
$(shell mkdir -p $(dir $@)) @ mkdir -p $(dir $@)
@ echo "compiling $(notdir $<)" @ echo "compiling $(notdir $<)"
@ $(CC) $(CFLAG) $(INCLUDE) -c $< -o $@ @ $(CC) $(CFLAG) $(INCS) -c $< -o $@
.PHONY:clean .PHONY:clean
clean: clean:
@echo "remove app and objs files ..." @echo "remove app and objs files ..."
$(shell rm $(BUILT_DIR)/$(WORKSPACE) -rf) @ rm $(BUILT_DIR)/$(WORKSPACE) -rf
$(shell rm $(BUILT_DIR)/* -rf) @ rm $(BUILT_DIR)/* -rf
.PHONY:install
install:$(LIBO)
@ $(AR) -crv $(LIBA) $(LIBO)
@ mkdir -p $(LIBP)/include/$(LIB)
@ find $(INCLUDE) -name "*.h" -exec cp {} $(LIBP)/include/$(LIB) \;
@ mv -f $(LIBA) $(LIBP)/lib \
&& ( echo "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" && \
echo "[INFO] varch install success !!!" && \
echo "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx") \
|| ( echo "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" && \
echo "[ERROR] varch install fail !!!" && \
echo "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" && \
rm $(LIBP)/include/$(LIB) -rf )
# @ ldconfig
.PHONY:uninstall
uninstall:
@ rm $(BUILT_DIR)/$(LIB) -rf
@ rm $(LIBP)/lib/$(LIBN).a
@ rm $(LIBP)/include/$(LIB) -rf
# @ ldconfig

31
test/test_install.c Normal file
View File

@ -0,0 +1,31 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <varch/set.h>
int main(int argc, char *argv[])
{
set_t set = set(int);
int i;
for (i = 0; i < 100; i++)
{
set_insert(set, i, &i);
}
printf("size = %d, data size = %d\r\n", set_size(set), set_dsize(set));
i = -100; set_insert(set, i, &i);
i = 1024; set_insert(set, i, &i);
printf("set[6] = %d\r\n", set_at(set, int, 6));
printf("set[-100] = %d\r\n", set_at(set, int, -100));
printf("set[1024] = %d\r\n", set_at(set, int, 1024));
set_at(set, int, 6) = 11111;
printf("set[6] = %d\r\n", set_at(set, int, 6));
_set(set);
}
// gcc ./test/test_install.c -o ./built/bin/app -lvarch
// ./built/bin/app