Blame src/ccapi/common/cci_debugging.c

Packit Service 99d1c0
/* ccapi/common/cci_debugging.c */
Packit Service 99d1c0
/*
Packit Service 99d1c0
 * Copyright 2006 Massachusetts Institute of Technology.
Packit Service 99d1c0
 * All Rights Reserved.
Packit Service 99d1c0
 *
Packit Service 99d1c0
 * Export of this software from the United States of America may
Packit Service 99d1c0
 * require a specific license from the United States Government.
Packit Service 99d1c0
 * It is the responsibility of any person or organization contemplating
Packit Service 99d1c0
 * export to obtain such a license before exporting.
Packit Service 99d1c0
 *
Packit Service 99d1c0
 * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and
Packit Service 99d1c0
 * distribute this software and its documentation for any purpose and
Packit Service 99d1c0
 * without fee is hereby granted, provided that the above copyright
Packit Service 99d1c0
 * notice appear in all copies and that both that copyright notice and
Packit Service 99d1c0
 * this permission notice appear in supporting documentation, and that
Packit Service 99d1c0
 * the name of M.I.T. not be used in advertising or publicity pertaining
Packit Service 99d1c0
 * to distribution of the software without specific, written prior
Packit Service 99d1c0
 * permission.  Furthermore if you modify this software you must label
Packit Service 99d1c0
 * your software as modified software and not distribute it in such a
Packit Service 99d1c0
 * fashion that it might be confused with the original M.I.T. software.
Packit Service 99d1c0
 * M.I.T. makes no representations about the suitability of
Packit Service 99d1c0
 * this software for any purpose.  It is provided "as is" without express
Packit Service 99d1c0
 * or implied warranty.
Packit Service 99d1c0
 */
Packit Service 99d1c0
Packit Service 99d1c0
#include "cci_common.h"
Packit Service 99d1c0
#include "cci_os_debugging.h"
Packit Service 99d1c0
Packit Service 99d1c0
/* ------------------------------------------------------------------------ */
Packit Service 99d1c0
Packit Service 99d1c0
cc_int32 _cci_check_error (cc_int32    in_error,
Packit Service 99d1c0
                           const char *in_function,
Packit Service 99d1c0
                           const char *in_file,
Packit Service 99d1c0
                           int         in_line)
Packit Service 99d1c0
{
Packit Service 99d1c0
    /* Do not log for flow control errors or when there is no error at all */
Packit Service 99d1c0
    if (in_error != ccNoError && in_error != ccIteratorEnd) {
Packit Service 99d1c0
        cci_debug_printf ("%s() got %d at %s: %d", in_function,
Packit Service 99d1c0
                          in_error, in_file, in_line);
Packit Service 99d1c0
    }
Packit Service 99d1c0
Packit Service 99d1c0
    return in_error;
Packit Service 99d1c0
}
Packit Service 99d1c0
Packit Service 99d1c0
/* ------------------------------------------------------------------------ */
Packit Service 99d1c0
Packit Service 99d1c0
void cci_debug_printf (const char *in_format, ...)
Packit Service 99d1c0
{
Packit Service 99d1c0
    va_list args;
Packit Service 99d1c0
Packit Service 99d1c0
    va_start (args, in_format);
Packit Service 99d1c0
    cci_os_debug_vprintf (in_format, args);
Packit Service 99d1c0
    va_end (args);
Packit Service 99d1c0
}