Don't declare anonymous enum/struct in the public API
This commit is contained in:
parent
c4c08b1e5c
commit
660c2699e7
@ -4,13 +4,15 @@
|
|||||||
#include "global.h"
|
#include "global.h"
|
||||||
|
|
||||||
/*! This enum identifies endian representations of numbers */
|
/*! This enum identifies endian representations of numbers */
|
||||||
typedef enum
|
enum foug_endianness
|
||||||
{
|
{
|
||||||
FOUG_LITTLE_ENDIAN,
|
FOUG_LITTLE_ENDIAN,
|
||||||
FOUG_BIG_ENDIAN,
|
FOUG_BIG_ENDIAN,
|
||||||
FOUG_MIDDLE_ENDIAN,
|
FOUG_MIDDLE_ENDIAN,
|
||||||
FOUG_OTHER_ENDIAN
|
FOUG_OTHER_ENDIAN
|
||||||
} foug_endianness_t;
|
};
|
||||||
|
|
||||||
|
typedef enum foug_endianness foug_endianness_t;
|
||||||
|
|
||||||
/*! Returns endianness (byte order) of the host's CPU architecture */
|
/*! Returns endianness (byte order) of the host's CPU architecture */
|
||||||
FOUG_LIB_EXPORT foug_endianness_t foug_host_endianness();
|
FOUG_LIB_EXPORT foug_endianness_t foug_host_endianness();
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
#include "global.h"
|
#include "global.h"
|
||||||
|
|
||||||
/*! This enum defines common errors */
|
/*! This enum defines common errors */
|
||||||
typedef enum
|
enum foug_datax_error
|
||||||
{
|
{
|
||||||
/*! No error occurred, success */
|
/*! No error occurred, success */
|
||||||
FOUG_DATAX_NO_ERROR = 0,
|
FOUG_DATAX_NO_ERROR = 0,
|
||||||
@ -21,10 +21,11 @@ typedef enum
|
|||||||
/*! An error occurred with the argument foug_stream_t (check foug_stream_error()) */
|
/*! An error occurred with the argument foug_stream_t (check foug_stream_error()) */
|
||||||
FOUG_DATAX_STREAM_ERROR = -4,
|
FOUG_DATAX_STREAM_ERROR = -4,
|
||||||
|
|
||||||
/*! Operation was stopped by user (foug_task_control_t::handle_progress_func() returned false) */
|
/*! Operation was stopped by user (foug_task_control::handle_progress_func() returned FOUG_FALSE) */
|
||||||
FOUG_DATAX_TASK_STOPPED_ERROR = -5
|
FOUG_DATAX_TASK_STOPPED_ERROR = -5
|
||||||
|
};
|
||||||
|
|
||||||
} foug_datax_error_t;
|
typedef enum foug_datax_error foug_datax_error_t;
|
||||||
|
|
||||||
/*! Returns true if \p code == FOUG_DATAX_NO_ERROR */
|
/*! Returns true if \p code == FOUG_DATAX_NO_ERROR */
|
||||||
FOUG_LIB_EXPORT foug_bool_t foug_datax_no_error(int code);
|
FOUG_LIB_EXPORT foug_bool_t foug_datax_no_error(int code);
|
||||||
|
@ -2,7 +2,8 @@
|
|||||||
#define FOUG_LIBSTL_STL_ERROR_H
|
#define FOUG_LIBSTL_STL_ERROR_H
|
||||||
|
|
||||||
#define FOUG_STL_ERROR_TAG 0x11000000
|
#define FOUG_STL_ERROR_TAG 0x11000000
|
||||||
typedef enum
|
|
||||||
|
enum foug_stl_rw_error
|
||||||
{
|
{
|
||||||
FOUG_STL_WRITE_NULL_GET_TRIANGLE_FUNC_ERROR = FOUG_STL_ERROR_TAG + 1,
|
FOUG_STL_WRITE_NULL_GET_TRIANGLE_FUNC_ERROR = FOUG_STL_ERROR_TAG + 1,
|
||||||
|
|
||||||
@ -14,6 +15,8 @@ typedef enum
|
|||||||
FOUG_STLB_UNSUPPORTED_BYTE_ORDER_ERROR = FOUG_STL_ERROR_TAG + 300,
|
FOUG_STLB_UNSUPPORTED_BYTE_ORDER_ERROR = FOUG_STL_ERROR_TAG + 300,
|
||||||
FOUG_STLB_READ_HEADER_WRONG_SIZE_ERROR = FOUG_STL_ERROR_TAG + 301,
|
FOUG_STLB_READ_HEADER_WRONG_SIZE_ERROR = FOUG_STL_ERROR_TAG + 301,
|
||||||
FOUG_STLB_READ_FACET_COUNT_ERROR = FOUG_STL_ERROR_TAG + 302
|
FOUG_STLB_READ_FACET_COUNT_ERROR = FOUG_STL_ERROR_TAG + 302
|
||||||
} foug_stl_rw_error_t;
|
};
|
||||||
|
|
||||||
|
typedef enum foug_stl_rw_error foug_stl_rw_error_t;
|
||||||
|
|
||||||
#endif /* FOUG_LIBSTL_STL_ERROR_H */
|
#endif /* FOUG_LIBSTL_STL_ERROR_H */
|
||||||
|
@ -4,13 +4,15 @@
|
|||||||
#include "stl_global.h"
|
#include "stl_global.h"
|
||||||
#include "../stream.h"
|
#include "../stream.h"
|
||||||
|
|
||||||
typedef enum
|
enum foug_stl_format
|
||||||
{
|
{
|
||||||
FOUG_STL_ASCII_FORMAT, /*!< STL ASCII (text) */
|
FOUG_STL_ASCII_FORMAT, /*!< STL ASCII (text) */
|
||||||
FOUG_STL_BINARY_LE_FORMAT, /*!< STL binary (little-endian) */
|
FOUG_STL_BINARY_LE_FORMAT, /*!< STL binary (little-endian) */
|
||||||
FOUG_STL_BINARY_BE_FORMAT, /*!< STL binary (big-endian) */
|
FOUG_STL_BINARY_BE_FORMAT, /*!< STL binary (big-endian) */
|
||||||
FOUG_STL_UNKNOWN_FORMAT
|
FOUG_STL_UNKNOWN_FORMAT
|
||||||
} foug_stl_format_t;
|
};
|
||||||
|
|
||||||
|
typedef enum foug_stl_format foug_stl_format_t;
|
||||||
|
|
||||||
FOUG_DATAX_LIBSTL_EXPORT
|
FOUG_DATAX_LIBSTL_EXPORT
|
||||||
foug_stl_format_t foug_stl_get_format(foug_stream_t* stream, size_t data_size);
|
foug_stl_format_t foug_stl_get_format(foug_stream_t* stream, size_t data_size);
|
||||||
|
@ -4,11 +4,13 @@
|
|||||||
#include "stl_global.h"
|
#include "stl_global.h"
|
||||||
#include "stl_triangle.h"
|
#include "stl_triangle.h"
|
||||||
|
|
||||||
typedef struct foug_stl_geom
|
struct foug_stl_geom
|
||||||
{
|
{
|
||||||
const void* cookie;
|
const void* cookie;
|
||||||
uint32_t triangle_count;
|
uint32_t triangle_count;
|
||||||
void (*get_triangle_func)(const void*, uint32_t, foug_stl_triangle_t*);
|
void (*get_triangle_func)(const void*, uint32_t, foug_stl_triangle_t*);
|
||||||
} foug_stl_geom_t;
|
};
|
||||||
|
|
||||||
|
typedef struct foug_stl_geom foug_stl_geom_t;
|
||||||
|
|
||||||
#endif /* FOUG_LIBSTL_STL_GEOM_H */
|
#endif /* FOUG_LIBSTL_STL_GEOM_H */
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
#include "stl_global.h"
|
#include "stl_global.h"
|
||||||
#include "stl_triangle.h"
|
#include "stl_triangle.h"
|
||||||
|
|
||||||
typedef struct
|
struct foug_stl_geom_creator
|
||||||
{
|
{
|
||||||
void* cookie;
|
void* cookie;
|
||||||
|
|
||||||
@ -14,6 +14,8 @@ typedef struct
|
|||||||
void (*add_triangle_func)(void*, uint32_t, const foug_stl_triangle_t*); /* Optional */
|
void (*add_triangle_func)(void*, uint32_t, const foug_stl_triangle_t*); /* Optional */
|
||||||
|
|
||||||
void (*end_solid_func) (void*); /* Optional */
|
void (*end_solid_func) (void*); /* Optional */
|
||||||
} foug_stl_geom_creator_t;
|
};
|
||||||
|
|
||||||
|
typedef struct foug_stl_geom_creator foug_stl_geom_creator_t;
|
||||||
|
|
||||||
#endif /* FOUG_LIBSTL_STL_GEOM_CREATOR_H */
|
#endif /* FOUG_LIBSTL_STL_GEOM_CREATOR_H */
|
||||||
|
@ -3,22 +3,26 @@
|
|||||||
|
|
||||||
#include "stl_global.h"
|
#include "stl_global.h"
|
||||||
|
|
||||||
typedef struct foug_stl_coords
|
struct foug_stl_coords
|
||||||
{
|
{
|
||||||
foug_real32_t x;
|
foug_real32_t x;
|
||||||
foug_real32_t y;
|
foug_real32_t y;
|
||||||
foug_real32_t z;
|
foug_real32_t z;
|
||||||
} foug_stl_coords_t;
|
};
|
||||||
|
|
||||||
|
typedef struct foug_stl_coords foug_stl_coords_t;
|
||||||
#define FOUG_STL_COORDS_RAWSIZE (3 * sizeof(foug_real32_t))
|
#define FOUG_STL_COORDS_RAWSIZE (3 * sizeof(foug_real32_t))
|
||||||
|
|
||||||
typedef struct foug_stl_triangle
|
struct foug_stl_triangle
|
||||||
{
|
{
|
||||||
foug_stl_coords_t normal;
|
foug_stl_coords_t normal;
|
||||||
foug_stl_coords_t v1;
|
foug_stl_coords_t v1;
|
||||||
foug_stl_coords_t v2;
|
foug_stl_coords_t v2;
|
||||||
foug_stl_coords_t v3;
|
foug_stl_coords_t v3;
|
||||||
uint16_t attribute_byte_count; /* Useful only for STL binary format */
|
uint16_t attribute_byte_count; /* Useful only for STL binary format */
|
||||||
} foug_stl_triangle_t;
|
};
|
||||||
|
|
||||||
|
typedef struct foug_stl_triangle foug_stl_triangle_t;
|
||||||
#define FOUG_STLA_TRIANGLE_RAWSIZE (4 * FOUG_STL_COORDS_RAWSIZE)
|
#define FOUG_STLA_TRIANGLE_RAWSIZE (4 * FOUG_STL_COORDS_RAWSIZE)
|
||||||
#define FOUG_STLB_TRIANGLE_RAWSIZE (FOUG_STLA_TRIANGLE_RAWSIZE + sizeof(uint16_t))
|
#define FOUG_STLB_TRIANGLE_RAWSIZE (FOUG_STLA_TRIANGLE_RAWSIZE + sizeof(uint16_t))
|
||||||
|
|
||||||
|
@ -5,12 +5,14 @@
|
|||||||
#include "stream.h"
|
#include "stream.h"
|
||||||
#include "task_control.h"
|
#include "task_control.h"
|
||||||
|
|
||||||
typedef struct foug_transfer
|
struct foug_transfer
|
||||||
{
|
{
|
||||||
foug_stream_t stream;
|
foug_stream_t stream;
|
||||||
foug_task_control_t task_control;
|
foug_task_control_t task_control;
|
||||||
void* buffer;
|
void* buffer;
|
||||||
size_t buffer_size;
|
size_t buffer_size;
|
||||||
} foug_transfer_t;
|
};
|
||||||
|
|
||||||
|
typedef struct foug_transfer foug_transfer_t;
|
||||||
|
|
||||||
#endif /* FOUG_C_TRANSFER_H */
|
#endif /* FOUG_C_TRANSFER_H */
|
||||||
|
Loading…
Reference in New Issue
Block a user