Code Monkey home page Code Monkey logo

easy-lib's Introduction

一个轻量的 ,可以让c语言代码变得优雅的库

怎么使用呢? 需要在CMakeLists.txt 引入:

include(ExternalProject)
ExternalProject_Add(
        easy_lib
        GIT_REPOSITORY https://github.com/putao0525/easy-lib.git
        GIT_TAG main  # 或者指定特定的分支、标签或提交哈希
        INSTALL_COMMAND ""  # 不使用 install 目标
)
ExternalProject_Get_Property(easy_lib source_dir binary_dir)
include_directories(${source_dir}/include)
add_executable(easy_lib_test main.c)
add_dependencies(easy_lib_test easy_lib)

讲解一个案例:

#include <stdio.h>
#include "easy_tools.h"

int main(void) {
    //时间库
    struct tm *curTime = easy_get_current_time();
    //日志库
    EASY_LOG_INFO("当前时间:%s", easy_format_time(curTime, NORM_DATETIME_PATTERN));
    //指针释放
    EASY_DELETE(curTime);
    return 0;
}

easy-lib's People

Contributors

putao0525 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.