Libtrap: Internal development docs  1.16.1
Functions | Variables
trap_internal.c File Reference

Internal functions and macros for libtrap Verbose and debug macros from libcommlbr. More...

#include <stdio.h>
#include "trap_internal.h"
Include dependency graph for trap_internal.c:

Go to the source code of this file.

Functions

static void get_level (int level, char **str_level)
 Return syslog and output level based on given verbose level. More...
 
void trap_verbose_msg (int level, char *string)
 send verbose message to stderr More...
 
_Bool __sync_bool_compare_and_swap_8 (int64_t *ptr, int64_t oldvar, int64_t newval)
 
uint64_t __sync_fetch_and_add_8 (uint64_t *ptr, uint64_t value)
 
uint64_t __sync_add_and_fetch_8 (uint64_t *ptr, uint64_t value)
 
uint64_t __sync_and_and_fetch_8 (uint64_t *ptr, uint64_t value)
 
uint64_t __sync_or_and_fetch_8 (uint64_t *ptr, uint64_t value)
 

Variables

int trap_debug = 0
 
int trap_verbose = -1
 
char trap_err_msg [4096]
 
static pthread_mutex_t atomic_mutex = PTHREAD_MUTEX_INITIALIZER
 

Detailed Description

Internal functions and macros for libtrap Verbose and debug macros from libcommlbr.

Author
Tomas Konir Tomas.nosp@m..Kon.nosp@m.ir@li.nosp@m.bero.nosp@m.uter..nosp@m.org
Milan Kovacik xkova.nosp@m.ci1@.nosp@m.fi.mu.nosp@m.ni.c.nosp@m.z
Vojtech Krmicek xkrmi.nosp@m.cek@.nosp@m.fi.mu.nosp@m.ni.c.nosp@m.z
Juraj Blaho xblah.nosp@m.o00@.nosp@m.stud..nosp@m.fit..nosp@m.vutbr.nosp@m..cz
Tomas Cejka cejka.nosp@m.t@ce.nosp@m.snet..nosp@m.cz
Date
2006-2011
2013
2014

Copyright (C) 2006-2014 CESNET

LICENSE TERMS

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  3. Neither the name of the Company nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

ALTERNATIVELY, provided that this notice is retained in full, this product may be distributed under the terms of the GNU General Public License (GPL) version 2 or later, in which case the provisions of the GPL apply INSTEAD OF those given above.

This software is provided `‘as is’', and any express or implied warranties, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose are disclaimed. In no event shall the company or contributors be liable for any direct, indirect, incidental, special, exemplary, or consequential damages (including, but not limited to, procurement of substitute goods or services; loss of use, data, or profits; or business interruption) however caused and on any theory of liability, whether in contract, strict liability, or tort (including negligence or otherwise) arising in any way out of the use of this software, even if advised of the possibility of such damage.

Definition in file trap_internal.c.

Function Documentation

◆ __sync_add_and_fetch_8()

uint64_t __sync_add_and_fetch_8 ( uint64_t *  ptr,
uint64_t  value 
)

Definition at line 137 of file trap_internal.c.

◆ __sync_and_and_fetch_8()

uint64_t __sync_and_and_fetch_8 ( uint64_t *  ptr,
uint64_t  value 
)

Definition at line 146 of file trap_internal.c.

◆ __sync_bool_compare_and_swap_8()

_Bool __sync_bool_compare_and_swap_8 ( int64_t *  ptr,
int64_t  oldvar,
int64_t  newval 
)

Definition at line 119 of file trap_internal.c.

◆ __sync_fetch_and_add_8()

uint64_t __sync_fetch_and_add_8 ( uint64_t *  ptr,
uint64_t  value 
)

Definition at line 128 of file trap_internal.c.

◆ __sync_or_and_fetch_8()

uint64_t __sync_or_and_fetch_8 ( uint64_t *  ptr,
uint64_t  value 
)

Definition at line 155 of file trap_internal.c.

◆ get_level()

static void get_level ( int  level,
char **  str_level 
)
static

Return syslog and output level based on given verbose level.

Parameters
levelVerbose level
str_levelString that is set according to given verbose level

Definition at line 66 of file trap_internal.c.

Variable Documentation

◆ atomic_mutex

pthread_mutex_t atomic_mutex = PTHREAD_MUTEX_INITIALIZER
static

Definition at line 117 of file trap_internal.c.