This commit is contained in:
vxclutch
2026-05-03 12:24:22 -04:00
parent 95f7a7a769
commit cf1ff9a96e
6 changed files with 143 additions and 14 deletions

View File

@@ -1,10 +1,38 @@
/* print.c: print functions for tcpl.
Copyright (C) vxclutch 2026
Written by vxclutch
This file is part of tcpl
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE. */
#include "print.h"
#include <stdio.h>
#include <stdarg.h>
#include <tcpl/tcpl.h>
char *arg0 = "";
char* arg0 = "";
int tcpl_print(char* s)
int tcpl_print(char* fmt, ...)
{
return printf("%s: %s\n", arg0, s);
va_list ap;
va_start(ap, fmt);
printf("%s: ", arg0);
int ln = vprintf(fmt, ap);
putc('\n', stdout);
va_end(ap);
return ln;
}