source: trunk/util/xc_trace.c @ 1174

Last change on this file since 1174 was 1174, checked in by moo, 23 months ago

show basename for easier trace log reader

  • Property svn:eol-style set to native
File size: 562 bytes
Line 
1#include "php.h"
2#include "xc_trace.h"
3#include <stdio.h>
4#include <stdarg.h>
5#include <string.h>
6
7const char *xc_trace_get_basename(const char *path) /* {{{ */
8{
9    const char *last_separator = strrchr(path, PHP_DIR_SEPARATOR);
10    return last_separator ? last_separator + 1 : path;
11}
12/* }}} */
13int xc_vtrace(const char *fmt, va_list args) /* {{{ */
14{
15    return vfprintf(stderr, fmt, args);
16}
17/* }}} */
18int xc_trace(const char *fmt, ...) /* {{{ */
19{
20    va_list args;
21    int ret;
22
23    va_start(args, fmt);
24    ret = xc_vtrace(fmt, args);
25    va_end(args);
26    return ret;
27}
28/* }}} */
29
Note: See TracBrowser for help on using the repository browser.