~ubuntu-branches/ubuntu/natty/orbit2/natty

« back to all changes in this revision

Viewing changes to include/orbit/GIOP/giop-endian.h

  • Committer: Bazaar Package Importer
  • Author(s): Chris Waters
  • Date: 2002-03-25 17:24:03 UTC
  • Revision ID: james.westby@ubuntu.com-20020325172403-8lexv63608acfqgt
Tags: upstream-2.3.107
ImportĀ upstreamĀ versionĀ 2.3.107

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef GIOP_ENDIAN_H
 
2
#define GIOP_ENDIAN_H 1
 
3
 
 
4
#include <orbit/GIOP/giop-types.h>
 
5
 
 
6
G_BEGIN_DECLS
 
7
 
 
8
#ifdef ORBIT2_INTERNAL_API
 
9
 
 
10
/* This is also defined in IIOP-types.c */
 
11
void giop_byteswap(guchar *outdata,
 
12
                   const guchar *data,
 
13
                   gulong datalen);
 
14
 
 
15
#if defined(G_CAN_INLINE) && !defined(GIOP_DO_NOT_INLINE_IIOP_BYTESWAP)
 
16
G_INLINE_FUNC void giop_byteswap(guchar *outdata,
 
17
                                 const guchar *data,
 
18
                                 gulong datalen)
 
19
{
 
20
  const guchar *source_ptr = data;
 
21
  guchar *dest_ptr = outdata + datalen - 1;
 
22
  while(dest_ptr >= outdata)
 
23
    *dest_ptr-- = *source_ptr++;
 
24
}
 
25
#endif
 
26
 
 
27
#endif /* ORBIT2_INTERNAL_API */
 
28
 
 
29
G_END_DECLS
 
30
 
 
31
#endif