Re: [Libclc-developers] clc_strings: last call for functions
Status: Planning
Brought to you by:
augestad
|
From: Bryan D. <bd...@bd...> - 2003-03-23 18:03:06
|
=2D----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Sunday 23 March 2003 11:48 am, Bj=F8rn Augestad wrote: > The plan is to release libclc-0.2 in the middle of April. Before that > comp.lang.c must approve on both the interface and implementation of the > functions in clc_string. I expect that process to take some time. ;-) > > The deadline for submitting functions is therefore set to 2003-03-25 > 16:00 GMT. If you have a function which *must* be a part of the module, > please submit it, including documentation and a small test program, to > this list before the deadline. How about an saprintf? size_t saprintf(char *buf, const char *formatstr, void **args); size_t sanprintf(char *buf, size_t size, const char *formatstr, void **args= ); Put simply, it works like sprintf, but takes arguments in a void * array.=20 Arguments which are not pointers must be stored and passed as a pointer to= =20 said storage. Or would this go in another module? Example: char buf[1024]; char str1[1024] =3D "The number is: "; char str2[1024] =3D "!"; int x =3D 42; void *args[3]; args[0] =3D str1; args[1] =3D &x; args[2] =3D str2; sanprintf(buf, 1024, "%s%d%s\n", args); This would be useful if the format string is built at runtime - e.g. for an= =20 interpreter for some other language. =2D----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQE+ffbTx533NjVSos4RAlkIAKCZAfpwOJH2tM8P42fvj750CjPY2QCfROc/ mpdunT7ZNOqd/bSJD6OB2jg=3D =3DLRwI =2D----END PGP SIGNATURE----- |