<commit_before>/**
 * Copyright (C) 2009 - 2010, <NAME>.
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *     http://www.apache.org/licenses/LICENSE-2.0
 *     
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
#ifndef INC_FUDGE_TYPES_H
#define INC_FUDGE_TYPES_H

#include "fudge/platform.h"

#ifdef __cplusplus
    extern "C" {
#endif

/*****************************************************************************
 * Primitive type definitions
 */

/* Bitmap values used to indicate the presence of optional values in the
   FudgeField type. */
typedef enum
{
    FUDGE_FIELD_HAS_NAME    = 0x1,
    FUDGE_FIELD_HAS_ORDINAL = 0x2
} FudgeFieldFlags;

/* Custom boolean definition: matches the standard definitions, in that it's
   the same length as an int and is false if zero. */
typedef enum
{
    FUDGE_FALSE = 0x0,
    FUDGE_TRUE  = 0x1
} fudge_bool;

/* Create types of the correct size. Currently dependent on C99 definitions
   but could be replaced with architecture specific types, just as long as
   they're wide enough to hold the values. */
typedef int8_t  fudge_byte;
typedef int16_t fudge_i16;
typedef int32_t fudge_i32;
typedef int64_t fudge_i64;
typedef float   fudge_f32;
typedef double  fudge_f64;

typedef uint8_t fudge_type_id;

/*****************************************************************************
 * Structure/union type definitions
 */

#ifdef _FUDGEMSGENVELOPEIMPL_DEFINED
typedef struct FudgeMsgEnvelopeImpl * FudgeMsgEnvelope;
#else /* ifdef _FUDGEMSGENVELOPEIMPL_DEFINED */
typedef struct { void * reserved; } * FudgeMsgEnvelope;
#endif /* ifdef _FUDGEMSGENVELOPEIMPL_DEFINED */

#ifdef _FUDGEMSGIMPL_DEFINED
typedef struct FudgeMsgImpl * FudgeMsg;
#else /* ifdef _FUDGEMSGIMPL_DEFINED */
typedef struct { void * reserved; } * FudgeMsg;
#endif /* ifdef _FUDGEMSGIMPL_DEFINED */

#ifdef _FUDGESTRINGIMPL_DEFINED
typedef struct FudgeStringImpl * FudgeString;
#else /* ifdef _FUDGESTRINGIMPL_DEFINED */
typedef struct { void * reserved; } * FudgeString;
#endif /* ifdef _FUDGESTRINGIMPL_DEFINED */

typedef struct<commit_msg>Made place-holder struct definitions named, rather than anonymouse. Allows the code to be linked to by both GCC and MSVC.<commit_after>/**
 * Copyright (C) 2009 - 2010; <NAME>, Open Gamma.
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *     http://www.apache.org/licenses/LICENSE-2.0
 *     
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
#ifndef INC_FUDGE_TYPES_H
#define INC_FUDGE_TYPES_H

#include "fudge/platform.h"

#ifdef __cplusplus
    extern "C" {
#endif

/*****************************************************************************
 * Primitive type definitions
 */

/* Bitmap values used to indicate the presence of optional values in the
   FudgeField type. */
typedef enum
{
    FUDGE_FIELD_HAS_NAME    = 0x1,
    FUDGE_FIELD_HAS_ORDINAL = 0x2
} FudgeFieldFlags;

/* Custom boolean definition: matches the standard definitions, in that it's
   the same length as an int and is false if zero. */
typedef enum
{
    FUDGE_FALSE = 0x0,
    FUDGE_TRUE  = 0x1
} fudge_bool;

/* Create types of the correct size. Currently dependent on C99 definitions
   but could be replaced with architecture specific types, just as long as
   they're wide enough to hold the values. */
typedef int8_t  fudge_byte;
typedef int16_t fudge_i16;
typedef int32_t fudge_i32;
typedef int64_t fudge_i64;
typedef float   fudge_f32;
typedef double  fudge_f64;

typedef uint8_t fudge_type_id;

/*****************************************************************************
 * Hidden struct pointer definitions (the actual struct defintions are not
 * available to client code) - they should be accessed only using the
 * functions provided in the respective headers.
 *
 * MSVC generates exceptions if functions take pointers to undefined types as
 * arguments; so unless the definition of a *Impl struct is available, a
 * simple place-holder struct is used.
 */

#ifdef _FUDGEMSGENVELOPEIMPL_DEFINED
typedef struct FudgeMsgEnvelopeImpl * FudgeMsgEnvelope;
#else
typedef struct FudgeMsgEnvelopeImpl { void * reserved; } * FudgeMsgEnvelope;
#endif

#ifdef _FUDGEMSGIMPL_DEFINED
typedef struct FudgeMsgImpl * FudgeMsg;
#else
typedef struct FudgeMsgImpl { void * reserved; } * FudgeMsg;
#endif

#ifdef _FUDGESTRINGIMPL_DEFINED
typedef struct FudgeStringImpl * FudgeString;
#else
typedef struct FudgeStringImpl { void * reserved; } * FudgeString;
#endif

/*****************************************************************************
 * Structure/union type definitions
 */

typedef struct
{'fraction_non_alphanumeric': 0.1351855304866679, 'fraction_numerical': 0.014917024053701287, 'mean_word_length': 4.610878661087866, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3703211', 'n_tokens_mistral': 1687, 'n_tokens_neox': 1540, 'n_words': 574}