libUEMF
A portable library for reading and writing WMF, EMF and EMF+ files
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Functions
uwmf_endian.c File Reference

Functions for converting WMF records between Big Endian and Little Endian byte orders. More...

#include <stdlib.h>
#include <stdio.h>
#include <stddef.h>
#include <string.h>
#include "uwmf.h"
#include "uwmf_endian.h"

Functions

int U_wmf_endian (char *contents, size_t length, int torev)
 Convert an entire WMF in memory from Big Endian to Little Endian (or vice versa). More...
 

Detailed Description

Functions for converting WMF records between Big Endian and Little Endian byte orders.

Function Documentation

int U_wmf_endian ( char *  contents,
size_t  length,
int  torev 
)

Convert an entire WMF in memory from Big Endian to Little Endian (or vice versa).

Returns
0 on failure, 1 on success
Parameters
contentspointer to the buffer holding the entire EMF in memory
lengthnumber of bytes in the buffer
torev1 for native to reversed, 0 for reversed to native

Normally this would be called immediately before writing the data to a file or immediately after reading the data from a file.