135c4bbdfSmrg//
235c4bbdfSmrg// Copyright © Jon TURNEY 2013
335c4bbdfSmrg//
435c4bbdfSmrg// This file is part of xwinclip.
535c4bbdfSmrg//
635c4bbdfSmrg// Permission is hereby granted, free of charge, to any person obtaining a
735c4bbdfSmrg// copy of this software and associated documentation files (the "Software"),
835c4bbdfSmrg// to deal in the Software without restriction, including without limitation
935c4bbdfSmrg// the rights to use, copy, modify, merge, publish, distribute, sublicense,
1035c4bbdfSmrg// and/or sell copies of the Software, and to permit persons to whom the
1135c4bbdfSmrg// Software is furnished to do so, subject to the following conditions:
1235c4bbdfSmrg//
1335c4bbdfSmrg// The above copyright notice and this permission notice (including the next
1435c4bbdfSmrg// paragraph) shall be included in all copies or substantial portions of the
1535c4bbdfSmrg// Software.
1635c4bbdfSmrg//
1735c4bbdfSmrg// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1835c4bbdfSmrg// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1935c4bbdfSmrg// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
2035c4bbdfSmrg// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
2135c4bbdfSmrg// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
2235c4bbdfSmrg// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
2335c4bbdfSmrg// DEALINGS IN THE SOFTWARE.
2435c4bbdfSmrg//
2535c4bbdfSmrg
2635c4bbdfSmrg#include <stdarg.h>
2735c4bbdfSmrg#include <stdio.h>
2835c4bbdfSmrg
2935c4bbdfSmrg#if 1
3035c4bbdfSmrgint
3135c4bbdfSmrgwinDebug(const char *format, ...)
3235c4bbdfSmrg{
3335c4bbdfSmrg  int count;
3435c4bbdfSmrg  va_list ap;
3535c4bbdfSmrg  va_start(ap, format);
3635c4bbdfSmrg  count = fprintf(stderr, "xwinclip: ");
3735c4bbdfSmrg  count += vfprintf(stderr, format, ap);
3835c4bbdfSmrg  va_end(ap);
3935c4bbdfSmrg  return count;
4035c4bbdfSmrg}
4135c4bbdfSmrg#endif
4235c4bbdfSmrg
4335c4bbdfSmrgint
4435c4bbdfSmrgErrorF(const char *format, ...)
4535c4bbdfSmrg{
4635c4bbdfSmrg  int count;
4735c4bbdfSmrg  va_list ap;
4835c4bbdfSmrg  va_start(ap, format);
4935c4bbdfSmrg  count = vfprintf(stderr, format, ap);
5035c4bbdfSmrg  va_end(ap);
5135c4bbdfSmrg  return count;
5235c4bbdfSmrg}
53