InChI
 
Loading...
Searching...
No Matches
ichicomp.h
Go to the documentation of this file.
1/*
2 * SPDX-License-Identifier: MIT
3 * Copyright (c) 2024 IUPAC and InChI Trust
4 */
5
6
7#ifndef _INCHI_COMP_H_
8#define _INCHI_COMP_H_
9
10#ifndef COMPILE_ALL_CPP
11#ifdef __cplusplus
12extern "C" {
13#endif
14#endif
15
16 /* compatibility */
17
18#if ( defined(__GNUC__) && defined(__MINGW32__) && __GNUC__ == 3 && __GNUC_MINOR__ == 2 && __GNUC_PATCHLEVEL__ == 0 && defined(_WIN32) )
19/* replace with the proper definition for GNU gcc & MinGW-2.0.0-3 (mingw special 20020817-1), gcc 3.2 core */
20#define my_va_start(A,B) ((A)=(va_list)__builtin_next_arg(lpszFormat))
21#else
22#define my_va_start va_start
23#endif
24
25
26
27/* ANSI redefinitions */
28#ifdef COMPILE_ANSI_ONLY /* { */
29#ifndef __isascii
30#define __isascii(val) ((unsigned)(val) <= 0x7F)
31#endif
32
33/* #ifndef __GNUC__ */
34/* these non-ANSI functions are implemented in gcc */
35#include <stdio.h>
36 /* this #include provides size_t definition */
37 /* implementation is located in util.c */
38/*#if ( !defined(_MSC_VER) || defined(__STDC__) && __STDC__ == 1 )*/
39
40#if ( defined(COMPILE_ADD_NON_ANSI_FUNCTIONS) || defined(__STDC__) && __STDC__ == 1 )
41
42/* support (VC++ Language extensions) = OFF && defined(COMPILE_ANSI_ONLY) */
43 int inchi_memicmp( const void*, const void*, size_t );
44 int inchi_stricmp( const char *s1, const char *s2 );
45 char *inchi__strnset( char *string, int c, size_t count );
46 char *inchi__strdup( const char *string );
47#endif
48/* #endif */
49
50#endif /* } */
51
52
53#ifndef COMPILE_ALL_CPP
54#ifdef __cplusplus
55}
56#endif
57#endif
58
59
60#endif /* _INCHI_COMP_H_ */
char * inchi__strnset(char *s, int val, size_t length)
Set a string to a specified value for a given length.
Definition util.c:1787
int inchi_stricmp(const char *s1, const char *s2)
Case-insensitive string comparison.
Definition util.c:1760
char * inchi__strdup(const char *string)
Duplicate a string.
Definition util.c:1800
int inchi_memicmp(const void *p1, const void *p2, size_t length)
Compare two memory blocks in a case-insensitive manner.
Definition util.c:1736