File: output.h

package info (click to toggle)
libming 0.2a.cvs20020110-1
  • links: PTS
  • area: main
  • in suites: woody
  • size: 2,204 kB
  • ctags: 4,173
  • sloc: ansic: 19,467; yacc: 2,149; cpp: 1,518; java: 1,253; ruby: 516; perl: 462; python: 436; makefile: 295; sh: 4
file content (58 lines) | stat: -rw-r--r-- 1,447 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/* output.h */

#ifndef OUTPUT_H_INCLUDED
#define OUTPUT_H_INCLUDED

#include "libswf.h"

#define max(x,y)	(((x)>(y))?(x):(y))

#define BUFFER_INCREMENT 1024

struct _output
{
  struct _output *next;
  byte *buffer;
  byte *pos;
  int buffersize;
  int free;
  int bitpos;
};
typedef struct _output *Output;

#define OUTPUT_SIZE sizeof(struct _output)

/* create/destroy output object */
Output newOutput();
Output newSizedOutput(int size);
void destroyOutput(Output out);

/* write output's buffer to stream */
void outputWriteToStream(Output out, FILE *f);

/* utilities for writing */
void outputGrow(Output out);
void outputCheckSize(Output out, int bytes);
void outputByteAlign(Output out);

int outputLength(Output out);

/* write data to output */
void outputWriteBits(Output out, int data, int bits);
void outputWriteSBits(Output out, int data, int bits);
void outputWriteUInt8(Output out, int data);
void outputWriteSInt8(Output out, int data);
void outputWriteUInt16(Output out, int data);
void outputWriteSInt16(Output out, int data);
void outputWriteUInt32(Output out, long data);
void outputWriteSInt32(Output out, long data);
void outputWriteBuffer(Output out, char *buffer, int bytes);

/* number of bits required to store num */
int numBits(int num);
int numSBits(int num);

void outputWriteRect(Output out, int xmin, int xmax, int ymin, int ymax);
void outputWriteString(Output out, byte *string);

#endif /* OUTPUT_H_INCLUDED */