w32tex
About: TeX Live provides a comprehensive TeX system including all the major TeX-related programs, macro packages, and fonts that are free software. Windows sources.
  Fossies Dox: w32tex-src.tar.xz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

fpgm-prep.c
Go to the documentation of this file.
1 #include "fpgm-prep.h"
2 
3 #include "support/util.h"
5 
7  if (table->tag) sdsfree(table->tag);
8  if (table->bytes) FREE(table->bytes);
9 }
10 
12 
14  uint32_t tag) {
16  FOR_TABLE(tag, table) {
18  uint32_t length = table.length;
19  t = table_iFpgm_prep.create();
20  t->tag = NULL;
21  t->length = length;
22  NEW(t->bytes, length);
23  if (!t->bytes) goto FAIL;
24  memcpy(t->bytes, data, length);
25  return t;
26  FAIL:
27  table_iFpgm_prep.free(t);
28  t = NULL;
29  }
30  return NULL;
31 }
32 
34  const otfcc_Options *options, const char *tag) {
35  if (!table) return;
36  loggedStep("%s", tag) {
38  }
39 }
40 
41 static void makeFpgmPrepInstr(void *_t, uint8_t *instrs, uint32_t length) {
43  t->length = length;
44  t->bytes = instrs;
45 }
46 static void wrongFpgmPrepInstr(void *_t, const char *reason, int pos) {
47  /*
48  table_fpgm_prep *t = (table_fpgm_prep *)_t;
49  fprintf(stderr, "[OTFCC] TrueType instructions parse error : %s, at %d in /%s\n", reason, pos,
50  t->tag);
51  */
52 }
53 
55  const char *tag) {
58  if ((table = json_obj_get(root, tag))) {
59  loggedStep("%s", tag) {
60  t = table_iFpgm_prep.create();
61  t->tag = sdsnew(tag);
63  }
64  }
65  return t;
66 }
67 
69  if (!table) return NULL;
71  bufwrite_bytes(buf, table->length, table->bytes);
72  return buf;
73 }
struct rect data
Definition: dvipdfm.c:64
void table_dumpTableFpgmPrep(const table_fpgm_prep *table, json_value *root, const otfcc_Options *options, const char *tag)
Definition: fpgm-prep.c:33
static INLINE void disposeFpgmPrep(MOVE table_fpgm_prep *table)
Definition: fpgm-prep.c:6
caryll_standardRefType(table_fpgm_prep, table_iFpgm_prep, disposeFpgmPrep)
table_fpgm_prep * otfcc_parseFpgmPrep(const json_value *root, const otfcc_Options *options, const char *tag)
Definition: fpgm-prep.c:54
caryll_Buffer * otfcc_buildFpgmPrep(const table_fpgm_prep *table, const otfcc_Options *options)
Definition: fpgm-prep.c:68
static void wrongFpgmPrepInstr(void *_t, const char *reason, int pos)
Definition: fpgm-prep.c:46
static void makeFpgmPrepInstr(void *_t, uint8_t *instrs, uint32_t length)
Definition: fpgm-prep.c:41
table_fpgm_prep * otfcc_readFpgmPrep(const otfcc_Packet packet, const otfcc_Options *options, uint32_t tag)
Definition: fpgm-prep.c:13
#define t
Definition: afcover.h:96
#define memcpy(d, s, n)
Definition: gsftopk.c:64
const unsigned char FREE
Definition: image.cpp:34
json_value * json_object_push(json_value *object, const char *name, json_value *)
static json_value * json_obj_get(const json_value *obj, const char *key)
Definition: json-funcs.h:26
#define NULL
Definition: ftobjs.h:61
#define NEW
Definition: gdkanji.c:77
unsigned int uint32_t
Definition: stdint.h:80
unsigned char uint8_t
Definition: stdint.h:78
#define INLINE
Definition: port.h:26
#define buf
#define length(c)
Definition: ctangleboot.c:65
#define root
Definition: ctangleboot.c:69
uint8_t * font_file_pointer
Definition: aliases.h:41
#define FOR_TABLE(name, table)
Definition: aliases.h:33
#define loggedStep(...)
Definition: aliases.h:6
const int * pos
Definition: combiners.h:905
static char reason[256]
Definition: pdfsig.cc:141
@ MOVE
Definition: pl-parser.h:87
void bufwrite_bytes(caryll_Buffer *buf, size_t size, const uint8_t *str)
Definition: buffer.c:149
caryll_Buffer * bufnew(void)
Definition: buffer.c:4
void sdsfree(sds s)
sds sdsnew(const char *init)
Definition: dvips.h:235
Definition: table.h:30
unsigned long tag
Definition: xmlparse.c:179
json_value * dump_ttinstr(uint8_t *instructions, uint32_t length, const otfcc_Options *options)
Definition: ttinstr.c:624
void parse_ttinstr(json_value *col, void *context, void(*Make)(void *, uint8_t *, uint32_t), void(*Wrong)(void *, const char *, int))
Definition: ttinstr.c:654
#define FAIL(ec)