Skip to content
Snippets Groups Projects
Select Git revision
  • 49c676ac68166d5be5056acf076eb967e4f3d75a
  • master default protected
  • replication_test
  • dev protected
  • release-1.10 protected
  • release-1.9 protected
  • 551-init-broker-service-permissions
  • 549-test-oai-pmh
  • 545-saving-multiple-times-breaks-pid-metadata
  • 499-standalone-compute-service-2
  • 539-load-tests
  • hotfix/helm-chart
  • luca_ba_new_interface
  • 534-bug-when-adding-access-to-user-that-is-not-registered-at-dashboard-service
  • release-1.8 protected
  • 533-integrate-semantic-recommendation
  • feature/openshift
  • 518-spark-doesn-t-map-the-headers-correct
  • 485-fixity-checks
  • 530-various-schema-problems-with-subsets
  • release-1.7 protected
  • v1.10.2 protected
  • v1.10.1 protected
  • v1.10.0-rc13 protected
  • v1.10.0-rc12 protected
  • v1.10.0-rc11 protected
  • v1.10.0-rc10 protected
  • v1.10.0-rc9 protected
  • v1.10.0-rc8 protected
  • v1.10.0-rc7 protected
  • v1.10.0-rc6 protected
  • v1.10.0-rc5 protected
  • v1.10.0-rc4 protected
  • v1.10.0-rc3 protected
  • v1.10.0-rc2 protected
  • v1.10.0rc1 protected
  • v1.10.0rc0 protected
  • v1.10.0 protected
  • v1.9.3 protected
  • v1.9.2 protected
  • v1.9.2-rc0 protected
41 results

CreateDB.vue

Blame
  • cmp_debug.c 2.16 KiB
    /**
     * @file   cmp_debug.c
     * @author Dominik Loidolt (dominik.loidolt@univie.ac.at)
     * @date   2024
     *
     * @copyright GPLv2
     * This program is free software; you can redistribute it and/or modify it
     * under the terms and conditions of the GNU General Public License,
     * version 2, as published by the Free Software Foundation.
     *
     * This program is distributed in the hope it will be useful, but WITHOUT
     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
     * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
     * more details.
     *
     * @brief compression/decompression debugging printing functions
     */
    
    #if (DEBUGLEVEL > 0)
    
    #ifndef ICU_ASW
    #  include <stdio.h>
    #endif
    #include <string.h>
    #include <stdarg.h>
    
    #include "cmp_debug.h"
    #include "compiler.h"
    #include "vsnprintf.h"
    
    
    /**
     * @brief outputs a debug string
     *
     * This function outputs a string for debugging purposes
     *
     * @param str The string to output
     */
    
    static void cmp_debug_puts(const char *str)
    {
    #ifdef ICU_ASW
    	/* XXX adapt it to your needs */
    	/* asw_puts(str); */
    	(void)str;
    #else
    	fputs(str, stderr);
    	fputs("\n", stderr);
    #endif
    }
    
    
    /**
     * @brief implements debug printing
     *
     * This function formats a string and prints it for debugging. It uses a static
     * buffer to format the string
     *
     * @param fmt	pointer to a null-terminated byte string specifying how to
     *		interpret the data
     * @param ...	arguments specifying data to print
     */
    
    void cmp_debug_print_impl(const char *fmt, ...)
    {
    	static char print_buffer[PRINT_BUFFER_SIZE];
    	int len;
    	va_list args;
    
    	va_start(args, fmt);
    	len = my_vsnprintf(print_buffer, sizeof(print_buffer)-1, fmt, args);
    	va_end(args);
    
    	if (len < 0) {
    		const char str[] = "my_snprintf is broken";
    
    		compile_time_assert(sizeof(str) <= sizeof(print_buffer), CMP_DEBUG_PRINT_BUFFER_SIZE_TO_SMALL);
    		memcpy(print_buffer, str, sizeof(str));
    	}
    	if ((size_t)len >= sizeof(print_buffer)-1) {
    		const char str[] =  "cmp_debug print_buffer too small";
    
    		compile_time_assert(sizeof(str) <= sizeof(print_buffer), CMP_DEBUG_PRINT_BUFFER_SIZE_TO_SMALL);
    		memcpy(print_buffer, str, sizeof(str));
    	}
    
    	cmp_debug_puts(print_buffer);
    }
    
    #endif /* (DEBUGLEVEL > 0) */