Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing headers (case sensitivity.) #2

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# BeOS R5 Headers

These headers came with BeOS R5 and are for REFERENCE ONLY. No pull requests will be accepted and the license is Propriatary.
These headers came with BeOS R5 and are for REFERENCE ONLY. No pull requests will be accepted and the license is Proprietary.
27 changes: 27 additions & 0 deletions headers/be/add-ons/tracker/TrackerAddOn.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/******************************************************************************
/
/ File: TrackerAddOn.h
/
/ Description: Protocol for the process_refs() hook function.
/
/ Copyright 1995-98, Be Incorporated, All Rights Reserved.
/
*******************************************************************************/

#ifndef _TRACKER_ADDON_H
#define _TRACKER_ADDON_H

#include <BeBuild.h>

struct entry_ref;
class BMessage;

/*-------------------------------------------------------------*/
/*------- This is why you're here: ----------------------------*/
extern "C" _EXPORT void process_refs(entry_ref dir_ref, BMessage* msg, void*);


/*-------------------------------------------------------------*/
/*-------------------------------------------------------------*/

#endif /* _TRACKER_ADDON_H */
151 changes: 151 additions & 0 deletions headers/be/support/ByteOrder.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
/******************************************************************************
/
/ File: ByteOrder.h
/
/ Description: Endian correction functions
/
/ Copyright 1993-98, Be Incorporated
/
******************************************************************************/

#ifndef _BYTEORDER_H
#define _BYTEORDER_H

#include <BeBuild.h>
#include <endian.h>
#include <SupportDefs.h>
#include <TypeConstants.h> /* For convenience */

#ifdef __cplusplus
extern "C" {
#endif

/*----------------------------------------------------------------------*/
/*------- Swap-direction constants, and swapping functions -------------*/

typedef enum {
B_SWAP_HOST_TO_LENDIAN,
B_SWAP_HOST_TO_BENDIAN,
B_SWAP_LENDIAN_TO_HOST,
B_SWAP_BENDIAN_TO_HOST,
B_SWAP_ALWAYS
} swap_action;

extern _IMPEXP_BE status_t swap_data(type_code type,
void *data,
size_t length,
swap_action action);

extern _IMPEXP_BE bool is_type_swapped(type_code type);


/*-----------------------------------------------------------------------*/
/*----- Private implementations -----------------------------------------*/
extern _IMPEXP_ROOT double __swap_double(double arg);
extern _IMPEXP_ROOT float __swap_float(float arg);
extern _IMPEXP_ROOT uint64 __swap_int64(uint64 uarg);
extern _IMPEXP_ROOT uint32 __swap_int32(uint32 uarg);
extern _IMPEXP_ROOT uint16 __swap_int16(uint16 uarg);
/*-------------------------------------------------------------*/


/*-------------------------------------------------------------*/
/*--------- Host is Little --------------------------------------*/

#if BYTE_ORDER == __LITTLE_ENDIAN
#define B_HOST_IS_LENDIAN 1
#define B_HOST_IS_BENDIAN 0

/*--------- Host Native -> Little --------------------*/

#define B_HOST_TO_LENDIAN_DOUBLE(arg) (double)(arg)
#define B_HOST_TO_LENDIAN_FLOAT(arg) (float)(arg)
#define B_HOST_TO_LENDIAN_INT64(arg) (uint64)(arg)
#define B_HOST_TO_LENDIAN_INT32(arg) (uint32)(arg)
#define B_HOST_TO_LENDIAN_INT16(arg) (uint16)(arg)

/*--------- Host Native -> Big ------------------------*/
#define B_HOST_TO_BENDIAN_DOUBLE(arg) __swap_double(arg)
#define B_HOST_TO_BENDIAN_FLOAT(arg) __swap_float(arg)
#define B_HOST_TO_BENDIAN_INT64(arg) __swap_int64(arg)
#define B_HOST_TO_BENDIAN_INT32(arg) __swap_int32(arg)
#define B_HOST_TO_BENDIAN_INT16(arg) __swap_int16(arg)

/*--------- Little -> Host Native ---------------------*/
#define B_LENDIAN_TO_HOST_DOUBLE(arg) (double)(arg)
#define B_LENDIAN_TO_HOST_FLOAT(arg) (float)(arg)
#define B_LENDIAN_TO_HOST_INT64(arg) (uint64)(arg)
#define B_LENDIAN_TO_HOST_INT32(arg) (uint32)(arg)
#define B_LENDIAN_TO_HOST_INT16(arg) (uint16)(arg)

/*--------- Big -> Host Native ------------------------*/
#define B_BENDIAN_TO_HOST_DOUBLE(arg) __swap_double(arg)
#define B_BENDIAN_TO_HOST_FLOAT(arg) __swap_float(arg)
#define B_BENDIAN_TO_HOST_INT64(arg) __swap_int64(arg)
#define B_BENDIAN_TO_HOST_INT32(arg) __swap_int32(arg)
#define B_BENDIAN_TO_HOST_INT16(arg) __swap_int16(arg)

#else /* __LITTLE_ENDIAN */


/*-------------------------------------------------------------*/
/*--------- Host is Big --------------------------------------*/

#define B_HOST_IS_LENDIAN 0
#define B_HOST_IS_BENDIAN 1

/*--------- Host Native -> Little -------------------*/
#define B_HOST_TO_LENDIAN_DOUBLE(arg) __swap_double(arg)
#define B_HOST_TO_LENDIAN_FLOAT(arg) __swap_float(arg)
#define B_HOST_TO_LENDIAN_INT64(arg) __swap_int64(arg)
#define B_HOST_TO_LENDIAN_INT32(arg) __swap_int32(arg)
#define B_HOST_TO_LENDIAN_INT16(arg) __swap_int16(arg)

/*--------- Host Native -> Big ------------------------*/
#define B_HOST_TO_BENDIAN_DOUBLE(arg) (double)(arg)
#define B_HOST_TO_BENDIAN_FLOAT(arg) (float)(arg)
#define B_HOST_TO_BENDIAN_INT64(arg) (uint64)(arg)
#define B_HOST_TO_BENDIAN_INT32(arg) (uint32)(arg)
#define B_HOST_TO_BENDIAN_INT16(arg) (uint16)(arg)

/*--------- Little -> Host Native ----------------------*/
#define B_LENDIAN_TO_HOST_DOUBLE(arg) __swap_double(arg)
#define B_LENDIAN_TO_HOST_FLOAT(arg) __swap_float(arg)
#define B_LENDIAN_TO_HOST_INT64(arg) __swap_int64(arg)
#define B_LENDIAN_TO_HOST_INT32(arg) __swap_int32(arg)
#define B_LENDIAN_TO_HOST_INT16(arg) __swap_int16(arg)

/*--------- Big -> Host Native -------------------------*/
#define B_BENDIAN_TO_HOST_DOUBLE(arg) (double)(arg)
#define B_BENDIAN_TO_HOST_FLOAT(arg) (float)(arg)
#define B_BENDIAN_TO_HOST_INT64(arg) (uint64)(arg)
#define B_BENDIAN_TO_HOST_INT32(arg) (uint32)(arg)
#define B_BENDIAN_TO_HOST_INT16(arg) (uint16)(arg)

#endif /* __LITTLE_ENDIAN */


/*-------------------------------------------------------------*/
/*--------- Just-do-it macros ---------------------------------*/
#define B_SWAP_DOUBLE(arg) __swap_double(arg)
#define B_SWAP_FLOAT(arg) __swap_float(arg)
#define B_SWAP_INT64(arg) __swap_int64(arg)
#define B_SWAP_INT32(arg) __swap_int32(arg)
#define B_SWAP_INT16(arg) __swap_int16(arg)


/*-------------------------------------------------------------*/
/*---------Berkeley macros -----------------------------------*/
#define htonl(x) B_HOST_TO_BENDIAN_INT32(x)
#define ntohl(x) B_BENDIAN_TO_HOST_INT32(x)
#define htons(x) B_HOST_TO_BENDIAN_INT16(x)
#define ntohs(x) B_BENDIAN_TO_HOST_INT16(x)

#ifdef __cplusplus
}
#endif /* __cplusplus */

/*-------------------------------------------------------------*/
/*-------------------------------------------------------------*/

#endif /* _BYTEORDER_H */