Coin Logo http://www.sim.no/
http://www.coin3d.org/

tidbits.h
1/**************************************************************************\
2 *
3 * This file is part of the Coin 3D visualization library.
4 * Copyright (C) by Kongsberg Oil & Gas Technologies.
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * ("GPL") version 2 as published by the Free Software Foundation.
9 * See the file LICENSE.GPL at the root directory of this source
10 * distribution for additional information about the GNU GPL.
11 *
12 * For using Coin with software that can not be combined with the GNU
13 * GPL, and for taking advantage of the additional benefits of our
14 * support services, please contact Kongsberg Oil & Gas Technologies
15 * about acquiring a Coin Professional Edition License.
16 *
17 * See http://www.coin3d.org/ for more information.
18 *
19 * Kongsberg Oil & Gas Technologies, Bygdoy Alle 5, 0257 Oslo, NORWAY.
20 * http://www.sim.no/ sales@sim.no coin-support@coin3d.org
21 *
22\**************************************************************************/
23
24#ifndef COIN_TIDBITS_H
25#define COIN_TIDBITS_H
26
27#include <Inventor/C/basic.h>
28#include <stdarg.h>
29
30#ifdef __cplusplus
31extern "C" {
32#endif /*__cplusplus */
33
34/* ********************************************************************** */
35
36enum CoinEndiannessValues {
37 COIN_HOST_IS_UNKNOWNENDIAN = -1,
38 COIN_HOST_IS_LITTLEENDIAN = 0,
39 COIN_HOST_IS_BIGENDIAN = 1
40};
41
42COIN_DLL_API int coin_host_get_endianness(void);
43
44COIN_DLL_API int coin_snprintf(char * dst, unsigned int n, const char * fmtstr, ...);
45COIN_DLL_API int coin_vsnprintf(char * dst, unsigned int n, const char * fmtstr, va_list args);
46
47COIN_DLL_API const char * coin_getenv(const char * name);
48COIN_DLL_API SbBool coin_setenv(const char * name, const char * value, int overwrite);
49COIN_DLL_API void coin_unsetenv(const char * name);
50
51COIN_DLL_API int coin_strncasecmp(const char * str1, const char * str2, int len);
52
53COIN_DLL_API uint16_t coin_hton_uint16(uint16_t value);
54COIN_DLL_API uint16_t coin_ntoh_uint16(uint16_t value);
55COIN_DLL_API uint32_t coin_hton_uint32(uint32_t value);
56COIN_DLL_API uint32_t coin_ntoh_uint32(uint32_t value);
57COIN_DLL_API uint64_t coin_hton_uint64(uint64_t value);
58COIN_DLL_API uint64_t coin_ntoh_uint64(uint64_t value);
59
60COIN_DLL_API void coin_hton_float_bytes(float value, char * result); /* expects room for 4 bytes in result*/
61COIN_DLL_API float coin_ntoh_float_bytes(const char * value); /* expects 4 bytes input */
62
63COIN_DLL_API void coin_hton_double_bytes(double value, char * result); /* expects room for 8 bytes in result */
64COIN_DLL_API double coin_ntoh_double_bytes(const char * value); /* expects 8 bytes input */
65
66COIN_DLL_API SbBool coin_isascii(const int c);
67COIN_DLL_API SbBool coin_isspace(const char c);
68
69COIN_DLL_API SbBool coin_is_power_of_two(uint32_t x);
70COIN_DLL_API uint32_t coin_next_power_of_two(uint32_t x);
71COIN_DLL_API uint32_t coin_geq_power_of_two(uint32_t x);
72
73COIN_DLL_API void coin_viewvolume_jitter(int numpasses, int curpass, const int * vpsize, float * jitter);
74
75typedef void coin_atexit_f(void);
76COIN_DLL_API void cc_coin_atexit(coin_atexit_f * fp);
77
78/* Used internally to clean up static data. Do not use in application code */
79COIN_DLL_API void cc_coin_atexit_static_internal(coin_atexit_f * fp);
80
81/* ********************************************************************** */
82
83/* OBSOLETED! These are not safe. Don't use them. */
84COIN_DLL_API float coin_hton_float(float value);
85COIN_DLL_API float coin_ntoh_float(float value);
86
87COIN_DLL_API double coin_hton_double(double value);
88COIN_DLL_API double coin_ntoh_double(double value);
89
90/* ********************************************************************** */
91
92#ifdef __cplusplus
93} /* extern "C" */
94#endif /* __cplusplus */
95
96#endif /* !COIN_TIDBITS_H */

Copyright © 1998-2010 by Kongsberg Oil & Gas Technologies. All rights reserved.

Generated on Wed Jul 17 2024 for Coin by Doxygen 1.12.0.