• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.9.5/Security-55471.14.18/libsecurity_utilities/lib/

Lines Matching +defs:buffer +defs:file +defs:format

6  * This file contains Original Code and/or Modifications of Original Code
8 * Version 2.0 (the 'License'). You may not use this file except in
11 * file.
60 void dump(const char *format, ...)
64 va_start(args, format);
65 Target::get().dump(format, args);
176 void Target::message(const char *scope, const char *format, va_list args)
180 char buffer[messageConstructionSize]; // building the message here
181 char *bufp = buffer;
218 size_t left = buffer + sizeof(buffer) - bufp - 1; // reserve one
219 size_t written = vsnprintf(bufp, left, format, args);
234 sink->put(buffer, (unsigned int)(bufp - buffer));
247 void Target::dump(const char *format, va_list args)
249 char buffer[messageConstructionSize]; // building the message here
250 vsnprintf(buffer, sizeof(buffer), format, args);
251 for (char *p = buffer; *p; p++)
254 sink->dump(buffer);
327 // /some/where -> that file
329 // >&number -> that (already) open (for write or append) file descriptor
335 if (dest[0] == '/') { // full pathname, write to file
343 } else if (!strncmp(dest, ">&", 2)) { // to file descriptor
351 } else { // if everything else fails, write a file
390 void Target::to(FILE *file)
392 to(new FileSink(file));
454 // File sinks (write to file via stdio)
458 fwrite(inbuf, 1, length + 1, file); // do pick up the trailing newline
463 fputs(text, file);
469 // we mean "if the file isn't unbuffered", but what's the portable way to say that?
470 if (file != stderr)
471 setlinebuf(file);
479 void SyslogSink::put(const char *buffer, unsigned int length)
481 syslog(priority, "%1.*s", length, buffer); // don't pick up trailing newline
486 // add to dump buffer
497 if (*p) { // left-over unterminated line segment in buffer
500 // shift buffer down to make room
505 } else { // buffer is empty; reset to start