# cgmlib.hxx File Reference

`#include <stdio.h>`
`#include <stddef.h>`
`#include <stdlib.h>`

## Defines

#define | ASFS 18
#define | SignChar signed char
#define | Int16 short
#define | Char char
#define | Int int
#define | Long long
#define | Float float
#define | Double double
#define | NONOP (Code) 0
#define | BEGMF (Code) 0x3020
#define | ENDMF (Code) 0x3021
#define | BEGPIC (Code) 0x3022
#define | BEGPICBODY (Code) 0x3023
#define | ENDPIC (Code) 0x3024
#define | MFVERSION (Code) 0x3120
#define | MFDESC (Code) 0x3121
#define | VDCTYPE (Code) 0x3122
#define | INTEGERPREC (Code) 0x3123
#define | REALPREC (Code) 0x3124
#define | INDEXPREC (Code) 0x3125
#define | COLRPREC (Code) 0x3126
#define | COLRINDEXPREC (Code) 0x3127
#define | MAXCOLRINDEX (Code) 0x3128
#define | COLRVALUEEXT (Code) 0x3129
#define | MFELEMLIST (Code) 0x312A
#define | BEGMFDEFAULTS (Code) 0x312B
#define | ENDMFDEFAULTS (Code) 0x312C
#define | FONTLIST (Code) 0x312D
#define | CHARSETLIST (Code) 0x312E
#define | CHARCODING (Code) 0x312F
#define | SCALEMODE (Code) 0x3220
#define | COLRMODE (Code) 0x3221
#define | LINEWIDTHMODE (Code) 0x3222
#define | MARKERSIZEMODE (Code) 0x3223
#define | EDGEWIDTHMODE (Code) 0x3224
#define | VDCEXT (Code) 0x3225
#define | BACKCOLR (Code) 0x3226
#define | VDCINTEGERPREC (Code) 0x3320
#define | VDCREALPREC (Code) 0x3321
#define | AUXCOLR (Code) 0x3322
#define | TRANSPARENCY (Code) 0x3323
#define | CLIPRECT (Code) 0x3324
#define | CLIP (Code) 0x3325
#define | LINE (Code) 0x20
#define | DISJTLINE (Code) 0x21
#define | MARKER (Code) 0x22
#define | TEXT (Code) 0x23
#define | RESTRTEXT (Code) 0x24
#define | APNDTEXT (Code) 0x25
#define | POLYGON (Code) 0x26
#define | POLYGONSET (Code) 0x27
#define | CELLARRAY (Code) 0x28
#define | GDP (Code) 0x29
#define | RECT (Code) 0x2A
#define | CIRCLE (Code) 0x3420
#define | ARC3PT (Code) 0x3421
#define | ARC3PTCLOSE (Code) 0x3422
#define | ARCCTR (Code) 0x3423
#define | ARCCTRCLOSE (Code) 0x3424
#define | ELLIPSE (Code) 0x3425
#define | ELLIPARC (Code) 0x3426
#define | ELLIPARCCLOSE (Code) 0x3427
#define | LINEINDEX (Code) 0x3520
#define | LINETYPE (Code) 0x3521
#define | LINEWIDTH (Code) 0x3522
#define | LINECOLR (Code) 0x3523
#define | MARKERINDEX (Code) 0x3524
#define | MARKERTYPE (Code) 0x3525
#define | MARKERSIZE (Code) 0x3526
#define | MARKERCOLR (Code) 0x3527
#define | TEXTINDEX (Code) 0x3530
#define | TEXTFONTINDEX (Code) 0x3531
#define | TEXTPREC (Code) 0x3532
#define | CHAREXPAN (Code) 0x3533
#define | CHARSPACE (Code) 0x3534
#define | TEXTCOLR (Code) 0x3535
#define | CHARHEIGHT (Code) 0x3536
#define | CHARORI (Code) 0x3537
#define | TEXTPATH (Code) 0x3538
#define | TEXTALIGN (Code) 0x3539
#define | CHARSETINDEX (Code) 0x353A
#define | ALTCHARSETINDEX (Code) 0x353B
#define | FILLINDEX (Code) 0x3620
#define | INTSTYLE (Code) 0x3621
#define | FILLCOLR (Code) 0x3622
#define | HATCHINDEX (Code) 0x3623
#define | PATINDEX (Code) 0x3624
#define | EDGEINDEX (Code) 0x3625
#define | EDGETYPE (Code) 0x3626
#define | EDGEWIDTH (Code) 0x3627
#define | EDGECOLR (Code) 0x3628
#define | EDGEVIS (Code) 0x3629
#define | FILLREFPT (Code) 0x362A
#define | PATTABLE (Code) 0x362B
#define | PATSIZE (Code) 0x362C
#define | COLRTABLE (Code) 0x3630
#define | ASF (Code) 0x3631
#define | ESCAPE (Code) 0x3720
#define | MESSAGE (Code) 0x3721
#define | APPLDATA (Code) 0x3722
#define | DOMAINRING (Code) 0x3730
#define | MF_CLOSED (Enum) 0
#define | MF_DESC (Enum) 1
#define | MF_ELEMLIST (Enum) 2
#define | MF_DEFAULTS (Enum) 3
#define | PIC_DESC (Enum) 4
#define | PIC_OPEN (Enum) 5
#define | PIC_CLOSED (Enum) 6
#define | TEXT_OPEN (Enum) 7
#define | INTEGER (Enum) 0
#define | REAL (Enum) 1
#define | ABSTRACT (Enum) 0
#define | METRIC (Enum) 1
#define | INDEXED (Enum) 0
#define | DIRECT (Enum) 1
#define | ABS (Enum) 0
#define | ABSOLUTE (Enum) 0
#define | SCALED (Enum) 1
#define | INDIV (Enum) 0
#define | INDIVIDUAL (Enum) 0
#define | BUNDLED (Enum) 1
#define | ALLOWED (Enum) 0
#define | FORBIDDEN (Enum) 1
#define | OFF (Enum) 0
#define | ON (Enum) 1
#define | NOACTION (Enum) 0
#define | ACTION (Enum) 1
#define | STRING (Enum) 0
#define | CHAR (Enum) 1
#define | STROKE (Enum) 2
#define | P_RIGHT (Enum) 0
#define | P_LEFT (Enum) 1
#define | P_UP (Enum) 2
#define | UP (Enum) 2
#define | P_DOWN (Enum) 3
#define | DOWN (Enum) 3
#define | NORMHORIZ (Enum) 0
#define | LEFT (Enum) 1
#define | CTR (Enum) 2
#define | RIGHT (Enum) 3
#define | CONTHORIZ (Enum) 4
#define | NORMVERT (Enum) 0
#define | TOP (Enum) 1
#define | CAP (Enum) 2
#define | HALF (Enum) 3
#define | BASE (Enum) 4
#define | BOTTOM (Enum) 5
#define | CONTVERT (Enum) 6
#define | NOTFINAL (Enum) 0
#define | FINAL (Enum) 1
#define | HOLLOW (Enum) 0
#define | SOLID (Enum) 1
#define | PAT (Enum) 2
#define | PATTERN (Enum) 2
#define | HATCH (Enum) 3
#define | EMPTY (Enum) 4
#define | PIE (Enum) 0
#define | CHORD (Enum) 1
#define | NOCLOSE (Enum) 2
#define | EDGEVISIB (Enum) 1
#define | EDGECLOSE (Enum) 2
#define | INVIS (Enum) 0
#define | VIS (Enum) 1
#define | CLOSEINVIS (EDGECLOSE + INVIS)
#define | CLOSEVIS (EDGECLOSE + VIS)
#define | DRAWINGSET (Enum) 0
#define | DRAWINGSETPLUS (Enum) 1
#define | VER2 (Enum) 2
#define | EXTPRIM (Enum) 3
#define | VER2GKSM (Enum) 4
#define | STD94 (Enum) 0
#define | STD96 (Enum) 1
#define | STD94MULTIBYTE (Enum) 2
#define | STD96MULTIBYTE (Enum) 3
#define | COMPLETECODE (Enum) 4
#define | BASIC7BIT (Enum) 0
#define | BASIC8BIT (Enum) 1
#define | EXTD7BIT (Enum) 2
#define | EXTD8BIT (Enum) 3
#define | ALL (Enum) 511
#define | ALLLINE (Enum) 510
#define | ALLMARKER (Enum) 509
#define | ALLTEXT (Enum) 508
#define | ALLFILL (Enum) 507
#define | ALLEDGE (Enum) 506
#define | FRACTION (Enum) 0
#define | MM (Enum) 1
#define | PHYDEVUNITS (Enum) 2
#define | FORCED (Enum) 0
#define | NOTFORCED (Enum) 2
#define | LOCUS (Enum) 0
#define | SHAPE (Enum) 1
#define | LOCUSTHENSHAPE (Enum) 2
#define | NO (Enum) 0
#define | YES (Enum) 1
#define | STATELIST (Enum) 0
#define | SEGMENT (Enum) 1
#define | INTERSECTION (Enum) 1
#define | NORMAL (Enum) 0
#define | HIGHLIGHT (Enum) 1
#define | LINEATTR (Enum) 35
#define | MARKERATTR (Enum) 36
#define | TEXTATTR (Enum) 37
#define | CHARATTR (Enum) 38
#define | FILLATTR (Enum) 39
#define | EDGEATTR (Enum) 40
#define | PATATTR (Enum) 41
#define | OUTPUTCTRL (Enum) 42
#define | ALLATTRCTRL (Enum) 44
#define | ALLINH (Enum) 45
#define | LINETYPEASF (Enum) 46
#define | LINEWIDTHASF (Enum) 47
#define | LINECOLRASF (Enum) 48
#define | MARKERTYPEASF (Enum) 49
#define | MARKERSIZEASF (Enum) 50
#define | MARKERCOLRASF (Enum) 51
#define | TEXTFONTINDEXASF (Enum) 52
#define | TEXTPRECASF (Enum) 53
#define | CHAREXPANASF (Enum) 54
#define | CHARSPACEASF (Enum) 55
#define | TEXTCOLRASF (Enum) 56
#define | INTSTYLEASF (Enum) 57
#define | FILLCOLRASF (Enum) 58
#define | HATCHINDEXASF (Enum) 59
#define | PATINDEXASF (Enum) 60
#define | EDGETYPEASF (Enum) 61
#define | EDGEWIDTHASF (Enum) 62
#define | EDGECOLRASF (Enum) 63
#define | VDC (Enum) 0
#define | MULTIPLE FALSE
#define | SINGLE TRUE
#define | NOSET (Enum) 0
#define | SET (Enum) 1
#define | NOP (Enum) 0
#define | NONE (Enum) 0
#define | ANY (Enum) 0
#define | ZERO (Int) 0
#define | LOG2 0.30103
#define | PARABIT 0x40
#define | PI 3.1415926535
#define | FALSE (Enum) 0
#define | TRUE (Enum) 1

## Typedefs

typedef short | Logical
typedef long | Index
typedef unsigned short | Enum
typedef short | Code
typedef long | Prec
typedef unsigned long | Posint
typedef float | Ptype
typedef double | Mtype
typedef colour | Colour
typedef vdc | Vdc
typedef point | Cpoint
typedef colourentry | Colourentry

## Functions

void | CGMOtext (FILE *, Code, Long *, float *, char *)
void | CGMObin (FILE *, Code, Long *, float *, char *)
void | CGMOchar (FILE *, Code, Long *, float *, char *)
FILE * | getfd ()
FILE * | OPEN_FILE (char *, int)
void | CLOSE_FILE ()

## Variables

const struct commands | cgmelement []
char_defaults mfchar mfichar curichar curchar | oldchar
text_defaults mftext mfitext curitext | curtext
bin_defaults mfbin mfibin curibin | curbin
defaults mf cur | old
attributes mfatt curatt | oldatt
flags | att

## Define Documentation

#define ABS (Enum) 0

#define ABSOLUTE (Enum) 0

#define ABSTRACT (Enum) 0

#define ACTION (Enum) 1

#define ALL (Enum) 511

#define ALLATTRCTRL (Enum) 44

#define ALLEDGE (Enum) 506

#define ALLFILL (Enum) 507

#define ALLINH (Enum) 45

#define ALLLINE (Enum) 510

#define ALLMARKER (Enum) 509

#define ALLOWED (Enum) 0

#define ALLTEXT (Enum) 508

#define ALTCHARSETINDEX (Code) 0x353B

#define ANY (Enum) 0

#define APNDTEXT (Code) 0x25

#define APPLDATA (Code) 0x3722

#define ARC3PT (Code) 0x3421

#define ARC3PTCLOSE (Code) 0x3422

#define ARCCTR (Code) 0x3423

#define ARCCTRCLOSE (Code) 0x3424

#define ASF (Code) 0x3631

#define ASFS 18

#define AUXCOLR (Code) 0x3322

#define BACKCOLR (Code) 0x3226

#define BASE (Enum) 4

#define BASIC7BIT (Enum) 0

#define BASIC8BIT (Enum) 1

#define BEGMF (Code) 0x3020

#define BEGMFDEFAULTS (Code) 0x312B

#define BEGPIC (Code) 0x3022

#define BEGPICBODY (Code) 0x3023

#define BOTTOM (Enum) 5

#define BUNDLED (Enum) 1

#define CAP (Enum) 2

#define CELLARRAY (Code) 0x28

#define CHAR (Enum) 1

#define Char char

#define CHARATTR (Enum) 38

#define CHARCODING (Code) 0x312F

#define CHAREXPAN (Code) 0x3533

#define CHAREXPANASF (Enum) 54

#define CHARHEIGHT (Code) 0x3536

#define CHARORI (Code) 0x3537

#define CHARSETINDEX (Code) 0x353A

#define CHARSETLIST (Code) 0x312E

#define CHARSPACE (Code) 0x3534

#define CHARSPACEASF (Enum) 55

#define CHORD (Enum) 1

#define CIRCLE (Code) 0x3420

#define CLIP (Code) 0x3325

#define CLIPRECT (Code) 0x3324

#define CLOSEINVIS (EDGECLOSE + INVIS)

#define CLOSEVIS (EDGECLOSE + VIS)

#define COLRINDEXPREC (Code) 0x3127

#define COLRMODE (Code) 0x3221

#define COLRPREC (Code) 0x3126

#define COLRTABLE (Code) 0x3630

#define COLRVALUEEXT (Code) 0x3129

#define COMPLETECODE (Enum) 4

#define CONTHORIZ (Enum) 4

#define CONTVERT (Enum) 6

#define CTR (Enum) 2

#define DIRECT (Enum) 1

#define DISJTLINE (Code) 0x21

#define DOMAINRING (Code) 0x3730

#define Double double

#define DOWN (Enum) 3

#define DRAWINGSET (Enum) 0

#define DRAWINGSETPLUS (Enum) 1

#define EDGEATTR (Enum) 40

#define EDGECLOSE (Enum) 2

#define EDGECOLR (Code) 0x3628

#define EDGECOLRASF (Enum) 63

#define EDGEINDEX (Code) 0x3625

#define EDGETYPE (Code) 0x3626

#define EDGETYPEASF (Enum) 61

#define EDGEVIS (Code) 0x3629

#define EDGEVISIB (Enum) 1

#define EDGEWIDTH (Code) 0x3627

#define EDGEWIDTHASF (Enum) 62

#define EDGEWIDTHMODE (Code) 0x3224

#define ELLIPARC (Code) 0x3426

#define ELLIPARCCLOSE (Code) 0x3427

#define ELLIPSE (Code) 0x3425

#define EMPTY (Enum) 4

#define ENDMF (Code) 0x3021

#define ENDMFDEFAULTS (Code) 0x312C

#define ENDPIC (Code) 0x3024

#define ESCAPE (Code) 0x3720

#define EXTD7BIT (Enum) 2

#define EXTD8BIT (Enum) 3

#define EXTPRIM (Enum) 3

#define FALSE (Enum) 0

#define FILLATTR (Enum) 39

#define FILLCOLR (Code) 0x3622

#define FILLCOLRASF (Enum) 58

#define FILLINDEX (Code) 0x3620

#define FILLREFPT (Code) 0x362A

#define FINAL (Enum) 1

#define Float float

#define FONTLIST (Code) 0x312D

#define FORBIDDEN (Enum) 1

#define FORCED (Enum) 0

#define FRACTION (Enum) 0

#define GDP (Code) 0x29

#define HALF (Enum) 3

#define HATCH (Enum) 3

#define HATCHINDEX (Code) 0x3623

#define HATCHINDEXASF (Enum) 59

#define HIGHLIGHT (Enum) 1

#define HOLLOW (Enum) 0

#define INDEXED (Enum) 0

#define INDEXPREC (Code) 0x3125

#define INDIV (Enum) 0

#define INDIVIDUAL (Enum) 0

#define Int int

#define Int16 short

#define INTEGER (Enum) 0

#define INTEGERPREC (Code) 0x3123

#define INTERSECTION (Enum) 1

#define INTSTYLE (Code) 0x3621

#define INTSTYLEASF (Enum) 57

#define INVIS (Enum) 0

#define LEFT (Enum) 1

#define LINE (Code) 0x20

#define LINEATTR (Enum) 35

#define LINECOLR (Code) 0x3523

#define LINECOLRASF (Enum) 48

#define LINEINDEX (Code) 0x3520

#define LINETYPE (Code) 0x3521

#define LINETYPEASF (Enum) 46

#define LINEWIDTH (Code) 0x3522

#define LINEWIDTHASF (Enum) 47

#define LINEWIDTHMODE (Code) 0x3222

#define LOCUS (Enum) 0

#define LOCUSTHENSHAPE (Enum) 2

#define LOG2 0.30103

#define Long long

#define MARKER (Code) 0x22

#define MARKERATTR (Enum) 36

#define MARKERCOLR (Code) 0x3527

#define MARKERCOLRASF (Enum) 51

#define MARKERINDEX (Code) 0x3524

#define MARKERSIZE (Code) 0x3526

#define MARKERSIZEASF (Enum) 50

#define MARKERSIZEMODE (Code) 0x3223

#define MARKERTYPE (Code) 0x3525

#define MARKERTYPEASF (Enum) 49

#define MAXCOLRINDEX (Code) 0x3128

#define MESSAGE (Code) 0x3721

#define METRIC (Enum) 1

#define MF_CLOSED (Enum) 0

#define MF_DEFAULTS (Enum) 3

#define MF_DESC (Enum) 1

#define MF_ELEMLIST (Enum) 2

#define MFDESC (Code) 0x3121

#define MFELEMLIST (Code) 0x312A

#define MFVERSION (Code) 0x3120

#define MM (Enum) 1

#define MULTIPLE FALSE

#define NO (Enum) 0

#define NOACTION (Enum) 0

#define NOCLOSE (Enum) 2

#define NONE (Enum) 0

#define NONOP (Code) 0

#define NOP (Enum) 0

#define NORMAL (Enum) 0

#define NORMHORIZ (Enum) 0

#define NORMVERT (Enum) 0

#define NOSET (Enum) 0

#define NOTFINAL (Enum) 0

#define NOTFORCED (Enum) 2

#define OFF (Enum) 0

#define ON (Enum) 1

#define OUTPUTCTRL (Enum) 42

#define P_DOWN (Enum) 3

#define P_LEFT (Enum) 1

#define P_RIGHT (Enum) 0

#define P_UP (Enum) 2

#define PARABIT 0x40

#define PAT (Enum) 2

#define PATATTR (Enum) 41

#define PATINDEX (Code) 0x3624

#define PATINDEXASF (Enum) 60

#define PATSIZE (Code) 0x362C

#define PATTABLE (Code) 0x362B

#define PATTERN (Enum) 2

#define PHYDEVUNITS (Enum) 2

#define PI 3.1415926535

#define PIC_CLOSED (Enum) 6

#define PIC_DESC (Enum) 4

#define PIC_OPEN (Enum) 5

#define PIE (Enum) 0

#define POLYGON (Code) 0x26

#define POLYGONSET (Code) 0x27

#define REAL (Enum) 1

#define REALPREC (Code) 0x3124

#define RECT (Code) 0x2A

#define RESTRTEXT (Code) 0x24

#define RIGHT (Enum) 3

#define SCALED (Enum) 1

#define SCALEMODE (Code) 0x3220

#define SEGMENT (Enum) 1

#define SET (Enum) 1

#define SHAPE (Enum) 1

#define SignChar signed char

#define SINGLE TRUE

#define SOLID (Enum) 1

#define STATELIST (Enum) 0

#define STD94 (Enum) 0

#define STD94MULTIBYTE (Enum) 2

#define STD96 (Enum) 1

#define STD96MULTIBYTE (Enum) 3

#define STRING (Enum) 0

#define STROKE (Enum) 2

#define TEXT (Code) 0x23

#define TEXT_OPEN (Enum) 7

#define TEXTALIGN (Code) 0x3539

#define TEXTATTR (Enum) 37

#define TEXTCOLR (Code) 0x3535

#define TEXTCOLRASF (Enum) 56

#define TEXTFONTINDEX (Code) 0x3531

#define TEXTFONTINDEXASF (Enum) 52

#define TEXTINDEX (Code) 0x3530

#define TEXTPATH (Code) 0x3538

#define TEXTPREC (Code) 0x3532

#define TEXTPRECASF (Enum) 53

#define TOP (Enum) 1

#define TRANSPARENCY (Code) 0x3323

#define TRUE (Enum) 1

#define UP (Enum) 2

#define VDC (Enum) 0

#define VDCEXT (Code) 0x3225

#define VDCINTEGERPREC (Code) 0x3320

#define VDCREALPREC (Code) 0x3321

#define VDCTYPE (Code) 0x3122

#define VER2 (Enum) 2

#define VER2GKSM (Enum) 4

#define VIS (Enum) 1

#define YES (Enum) 1

#define ZERO (Int) 0

## Typedef Documentation

typedef short Code

typedef struct colour Colour

typedef struct colourentry Colourentry

typedef struct point Cpoint

typedef unsigned short Enum

typedef long Index

typedef short Logical

typedef double Mtype

typedef unsigned long Posint

typedef long Prec

typedef float Ptype

typedef struct vdc Vdc

## Function Documentation

void CGMObin | ( | FILE * | ,
|  | Code | ,
|  | Long * | ,
|  | float * | ,
|  | char * |
| ) |

void CGMOchar | ( | FILE * | ,
|  | Code | ,
|  | Long * | ,
|  | float * | ,
|  | char * |
| ) |

void CGMOtext | ( | FILE * | ,
|  | Code | ,
|  | Long * | ,
|  | float * | ,
|  | char * |
| ) |

void CLOSE_FILE | ( |  | ) |

FILE* getfd | ( |  | ) |

FILE* OPEN_FILE | ( | char * | ,
|  | int |
| ) |

## Variable Documentation

struct flags att

const struct commands cgmelement[]

struct bin_defaults mfbin mfibin curibin curbin

struct text_defaults mftext mfitext curitext curtext

struct defaults mf cur old

struct attributes mfatt curatt oldatt

struct char_defaults mfchar mfichar curichar curchar oldchar