|
Revision 1174, 0.5 KB
(checked in by moo, 6 months ago)
|
|
show basename for easier trace log reader
|
-
Property svn:eol-style set to
native
|
| Rev | Line | |
|---|
| [1174] | 1 | #include "php.h" |
|---|
| [990] | 2 | #include "xc_trace.h" |
|---|
| 3 | #include <stdio.h> |
|---|
| 4 | #include <stdarg.h> |
|---|
| [1174] | 5 | #include <string.h> |
|---|
| [990] | 6 | |
|---|
| [1174] | 7 | const 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 | /* }}} */ |
|---|
| [990] | 13 | int xc_vtrace(const char *fmt, va_list args) /* {{{ */ |
|---|
| 14 | { |
|---|
| 15 | return vfprintf(stderr, fmt, args); |
|---|
| 16 | } |
|---|
| 17 | /* }}} */ |
|---|
| 18 | int 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 | |
|---|