Skip to content

andrewgregory/mFmt.c

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NAME

mFmt.c - simple python-style string formatting for C

SYNOPSIS

ssize_t i = 0;
mfmt_t mfmt = mfmt_parse("foo {bar} baz");
for(mfmt_token *t = mfmt_nex(mfmt, &i); t; mfmt_next(mfmt, &i)) {
   if(strccmp(t->name, "bar")) {
       puts("bar");
   }
}

union mfmt_val {
   char *s;
   intmax_t i;
   uintmax_t u;
   double f;
};

mfmt_fmt("foo {bar} {} baz", MFMT_VAL("bar", 36), MFMT_VAL(42));

DESCRIPTION

Features:

* callback and iterator based argument handling * token-specific callback/context * helpers for python-esque interface

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages