File: binary_glue.h

package info (click to toggle)
kaya 0.2.0-6
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 3,012 kB
  • ctags: 1,307
  • sloc: cpp: 6,691; haskell: 4,833; sh: 2,868; yacc: 768; makefile: 700; perl: 87
file content (31 lines) | stat: -rw-r--r-- 822 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
#ifndef _BINARY_H // -*-C++-*-
#define _BINARY_H

#include <Heap.h>
#include <stdio.h>
#include <KayaAPI.h>

typedef unsigned char BYTE;

extern "C" {
    void* newBlock(int size);
    void poke(void* block,int offset,int val);
    int peek(void* block,int offset);

    void pokestring(void* block, int offset, wchar_t* str);
    wchar_t* peekstring(void* block, int offset);

    void* copyBlock(void* block,int size);
    void* copyChunk(void* block,int offset,int size);

    KayaArray getBlockData(void* block, int offset,int size);
    void setBlockData(void* block, int offset, int size, KayaArray data);

    int writeBlock(FILE* f,void* block, int size);
    void* readBlock(FILE* f, KayaValue size);

    wchar_t* b64binary(void* block, int len);
    void* b64binarydec(wchar_t* block, KayaValue len);
}

#endif