
代码仓库
junlon2006
Coding for fun.
展开
-
Linux c 简单队列管理源码
#ifndef __IPC_INTELLI_QUE_MANGER_H__#ifdef __cplusplusextern "C" {#endif /* __cplusplus */#define __IPC_INTELLI_QUE_MANGER_H__#include #include #define IPC_INTELLI_SOK (0)#de原创 2017-03-12 19:15:39 · 525 阅读 · 0 评论 -
stupid coding
工作丑陋代码流程,鞭策前行的路:原创 2017-05-05 19:09:23 · 228 阅读 · 0 评论 -
list_head
#ifndef LIST_HEAD_H#define LIST_HEAD_Htypedef struct list_head { struct list_head *next, *prev;} list_head;#define LIST_HEAD_INIT(obj) { &(obj), &(obj) }/* For the entry to be added , INIT原创 2017-06-16 21:17:51 · 334 阅读 · 0 评论 -
fopen code
static result_t __read_dns_config(const char *file_name, char *output_buf, size_t output_buf_len){ FILE *fp = NULL; size_t flen; LOGD(C_DNS_TAG, "read livepush config, file_name=%s", fil原创 2017-07-18 16:04:42 · 256 阅读 · 0 评论 -
cJSON array
static result_t __config_parse_dns(char *config_buf){ int i, count; cJSON *root = cJSON_Parse(config_buf); if (NULL == root) { goto L_ERROR; } cJSON *dns_domain = cJSON_Ge原创 2017-07-18 16:05:56 · 1616 阅读 · 0 评论 -
ring buf
#ifndef __RING_BUF_H__#define __RING_BUF_H__#include "stdint.h"void* ring_slab_new(void *slab_addr, uint32_t slab_length, size_t item_size);void ring_slab_del(void *slab);void* ring_slab_put(原创 2017-08-13 11:16:40 · 356 阅读 · 0 评论