Commit 7f9bce0b authored by ml's avatar ml

Changed to old co_eBO and co_eFT

parent 4ce66654
...@@ -11,8 +11,25 @@ ...@@ -11,8 +11,25 @@
/* /*
* co_GetOwnPlatform * co_GetOwnFormat
*/ */
co_mFormat* co_GetOwnFormat(co_mFormat *format)
{
format->m = 0;
format->b.bo = co_dHostByteOrder;
format->b.ct = co_dHostAsciiType;
format->b.ft = co_dHostFloatType;
return format;
}
/*
* co_GetOwnPlatform
*/
co_sPlatform* co_GetOwnPlatform(co_sPlatform *platform) co_sPlatform* co_GetOwnPlatform(co_sPlatform *platform)
{ {
platform->os = co_dHostOS; platform->os = co_dHostOS;
...@@ -22,13 +39,16 @@ co_sPlatform* co_GetOwnPlatform(co_sPlatform *platform) ...@@ -22,13 +39,16 @@ co_sPlatform* co_GetOwnPlatform(co_sPlatform *platform)
return platform; return platform;
} }
/*
co_mFormat* co_GetOwnFormat(co_mFormat *format) * co_SetFormat
*/
co_mFormat* co_SetFormat(co_mFormat *format, co_eBO bo, co_eFT ft)
{ {
format->m = 0; format->m = 0;
format->b.bo = co_dHostByteOrder; format->b.bo = bo;
format->b.ft = co_dHostFloatType; format->b.ft = ft;
format->b.ct = co_eCT_ascii; format->b.ct = co_eCT_ascii;
return format; return format;
} }
#ifndef co_platform_h #ifndef co_platform_h
#define co_platform_h #define co_platform_h
#ifdef __cplusplus
extern "C" {
#endif
/* co_platform.h -- platform routines /* co_platform.h -- platform routines
PROVIEW/R PROVIEW/R
...@@ -13,6 +9,10 @@ extern "C" { ...@@ -13,6 +9,10 @@ extern "C" {
This module contains data structures that descibes a PROVIEW platform This module contains data structures that descibes a PROVIEW platform
*/ */
#ifdef __cplusplus
extern "C" {
#endif
#ifndef pwr_h #ifndef pwr_h
# include "pwr.h" # include "pwr.h"
...@@ -55,15 +55,17 @@ extern "C" { ...@@ -55,15 +55,17 @@ extern "C" {
#define ENDIAN_SWAP_BOOLP(s) (*(int *)s = (0 != *(int *)s)) #define ENDIAN_SWAP_BOOLP(s) (*(int *)s = (0 != *(int *)s))
/** OS type
* @note Do not change the order. Must be backward compatible
*/
typedef enum { typedef enum {
co_eOS__ = 0, co_eOS__ = 0,
co_eOS_Lynx, co_eOS_Lynx,
co_eOS_VMS, co_eOS_VMS,
co_eOS_ELN, co_eOS_ELN,
co_eOS_WNT, co_eOS_WNT, /**< Pay me and I will do it */
co_eOS_W95, co_eOS_W95, /**< Never!! */
co_eOS_Amiga, co_eOS_Amiga, /**< We are working on it ;-) */
co_eOS_Linux, co_eOS_Linux,
co_eOS_ co_eOS_
} co_eOS; } co_eOS;
...@@ -83,7 +85,9 @@ typedef enum { ...@@ -83,7 +85,9 @@ typedef enum {
#endif #endif
/** Hardware type */ /** Hardware type
* @note Do not change the order. Must be backward compatible
*/
typedef enum { typedef enum {
co_eHW__ = 0, co_eHW__ = 0,
...@@ -110,14 +114,20 @@ typedef enum { ...@@ -110,14 +114,20 @@ typedef enum {
/** Integer and floating-point byte order. /** Integer and floating-point byte order.
* *
* @note The enum must not exceed 15 * Network is big endian
* 68k is big endian
* x86 is little endian
* PPC is both endian
* VAX is little endian
*
* @note Do not change the order. Must be backward compatible
*/ */
typedef enum { typedef enum {
co_eBO__ = 0, co_eBO__ = 0,
co_eBO_big, co_eBO_big,
co_eBO_little, co_eBO_little,
co_eBO_ co_eBO_middle /**< Not used, historical reasons */
} co_eBO; } co_eBO;
...@@ -128,8 +138,7 @@ typedef enum { ...@@ -128,8 +138,7 @@ typedef enum {
#endif #endif
/** Character representation type. Always set to ascii
/** Character representation type. Currently not used
* *
* @note The enum must not exceed 15 * @note The enum must not exceed 15
*/ */
...@@ -142,15 +151,20 @@ typedef enum { ...@@ -142,15 +151,20 @@ typedef enum {
#define co_dHostAsciiType co_eCT_ascii #define co_dHostAsciiType co_eCT_ascii
/** Floating-point representation type. /** Floating-point representation type.
* *
* @note The enum must not exceed 255 * @note Do not change the order. Must be backward compatible
*/ */
typedef enum { typedef enum {
co_eFT__ = 0, co_eFT__ = 0,
co_eFT_ieee, co_eFT_ieeeS,
co_eFT_ieeeT, /**< Not used */
co_eFT_ieeeK, /**< Not used */
co_eFT_vaxF, /**< Not set, implicit for both vaxD and vaxG */
co_eFT_vaxD, co_eFT_vaxD,
co_eFT_vaxG, co_eFT_vaxG,
co_eFT_vaxH, /**< Not used */
co_eFT_ co_eFT_
} co_eFT; } co_eFT;
...@@ -161,7 +175,7 @@ typedef enum { ...@@ -161,7 +175,7 @@ typedef enum {
# define co_dHostFloatType co_eFT_vaxD # define co_dHostFloatType co_eFT_vaxD
# endif # endif
#else #else
# define co_dHostFloatType co_eFT_ieee # define co_dHostFloatType co_eFT_ieeeS
#endif #endif
...@@ -169,7 +183,7 @@ typedef union { ...@@ -169,7 +183,7 @@ typedef union {
pwr_tBitMask m; pwr_tBitMask m;
pwr_32Bits ( pwr_32Bits (
pwr_Bits( bo , 4),,,, /**< Byte order */ pwr_Bits( bo , 4),,,, /**< Byte order */
pwr_Bits( ct , 4),,,, /**< Character representation */ pwr_Bits( ct , 4),,,, /**< Not used. Character representation */
pwr_Bits( ft , 8),,,,,,,, /**< Floting-point representation */ pwr_Bits( ft , 8),,,,,,,, /**< Floting-point representation */
pwr_Bits( reserved1, 8),,,,,,,, pwr_Bits( reserved1, 8),,,,,,,,
pwr_Bits( reserved2, 8),,,,,,, pwr_Bits( reserved2, 8),,,,,,,
...@@ -178,8 +192,6 @@ typedef union { ...@@ -178,8 +192,6 @@ typedef union {
} co_mFormat; } co_mFormat;
typedef struct { typedef struct {
co_eOS os; co_eOS os;
co_eHW hw; co_eHW hw;
...@@ -187,12 +199,14 @@ typedef struct { ...@@ -187,12 +199,14 @@ typedef struct {
} co_sPlatform; } co_sPlatform;
co_mFormat* co_GetOwnFormat(co_mFormat *format);
co_sPlatform *co_GetOwnPlatform(co_sPlatform *platform); co_sPlatform* co_GetOwnPlatform(co_sPlatform *platform);
co_mFormat *co_GetOwnFormat(co_mFormat *format); co_mFormat* co_SetFormat(co_mFormat *format, co_eBO bo, co_eFT ft);
#ifdef __cplusplus
}
#endif
#ifdef __cplusplus #ifdef __cplusplus
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment