Skip to content

aperezdc/dbuf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dbuf

builds.sr.ht status

Installation

With clib:

clib install aperezdc/dbuf

Example

#include "dbuf.h"

int
main(int argc, char **argv)
{
    struct dbuf b = DBUF_INIT;

    dbuf_addstr(&b, "Command line arguments:\n");

    for (int i = 1; i < argc; i++) {
        dbuf_addstr(&b, argv[i]);
        dbuf_addch(&b, '\n');
    }

    puts(buf_str(&b));
    dbuf_clear(&b);

    return EXIT_SUCCESS;
}