More translations of c comments, now also include files!
This commit is contained in:
@@ -46,7 +46,7 @@ extern "C" {
|
||||
struct Library;
|
||||
struct FileData;
|
||||
|
||||
/* let op: Sequence heeft identiek begin. */
|
||||
/* watch it: Sequence has identical beginning. */
|
||||
/**
|
||||
* ID is the first thing included in all serializable types. It
|
||||
* provides a common handle to place all data in double-linked lists.
|
||||
@@ -66,14 +66,14 @@ typedef struct ID {
|
||||
} ID;
|
||||
|
||||
/**
|
||||
* ??
|
||||
* For each library file used, a Library struct is added to Main
|
||||
*/
|
||||
typedef struct Library {
|
||||
ID id;
|
||||
ID *idblock;
|
||||
struct FileData *filedata;
|
||||
char name[160];
|
||||
int tot, pad; /* tot, idblock en filedata zijn voor lezen en schrijven */
|
||||
int tot, pad; /* tot, idblock and filedata are only fo read and write */
|
||||
} Library;
|
||||
|
||||
/**
|
||||
@@ -129,8 +129,7 @@ typedef struct Library {
|
||||
|
||||
#define IPO_CO MAKE_ID2('C', 'O') /* NOTE! This is not an ID, but is needed for g.sipo->blocktype */
|
||||
|
||||
/* id->flag: eerste 8 bits altijd op nul zetten bij inlezen */
|
||||
/* (always zero the first 8 bits when reading a file) */
|
||||
/* id->flag: set frist 8 bits always at zero while reading */
|
||||
#define LIB_LOCAL 0
|
||||
#define LIB_EXTERN 1
|
||||
#define LIB_INDIRECT 2
|
||||
@@ -142,7 +141,7 @@ typedef struct Library {
|
||||
|
||||
#define LIB_NEW 256
|
||||
#define LIB_FAKEUSER 512
|
||||
/* vrije testflag */
|
||||
/* free test flag */
|
||||
#define LIB_DOIT 1024
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@@ -48,9 +48,9 @@ typedef struct Camera {
|
||||
|
||||
short type, flag, drawzoom, hold;
|
||||
float clipsta, clipend;
|
||||
float netsta, netend; /* network camera */
|
||||
float netsta, netend; /* network camera (obsolete -ton) */
|
||||
float lens, drawsize;
|
||||
float hololen, hololen1;
|
||||
float hololen, hololen1; /* obsolete (ton) */
|
||||
|
||||
struct Ipo *ipo;
|
||||
|
||||
|
@@ -131,7 +131,7 @@ typedef struct Curve {
|
||||
/* default */
|
||||
short resolu, resolv;
|
||||
|
||||
/* font stuk */
|
||||
/* font part */
|
||||
short len, lines, pos, spacemode;
|
||||
float spacing, linedist, shear, fsize;
|
||||
float xof, yof;
|
||||
|
@@ -34,11 +34,11 @@
|
||||
#ifndef DNA_EFFECT_TYPES_H
|
||||
#define DNA_EFFECT_TYPES_H
|
||||
|
||||
/* DENK ERAAN: NIEUWE EFFECTEN OOK IN DE WRITEFILE.C IVM DNA!!! */
|
||||
/* don't forget, new effects also in writefile.c for dna!!! */
|
||||
|
||||
#define PAF_MAXMULT 4
|
||||
|
||||
/* paf->flag (bitje 0 vrij houden ivm compatibility) */
|
||||
/* paf->flag (keep bit 0 free for compatibility) */
|
||||
#define PAF_BSPLINE 2
|
||||
#define PAF_STATIC 4
|
||||
#define PAF_FACE 8
|
||||
|
@@ -1,8 +1,10 @@
|
||||
/**
|
||||
* blenlib/DNA_ika_types.h (mar-2001 nzc)
|
||||
*
|
||||
* Old ika types. These will be superceded by Reevan's stuff, soon (I
|
||||
* hope).
|
||||
* Old ika types. These have been superceded by Reevan's stuff
|
||||
* (armatures and bones)
|
||||
*
|
||||
* Can be removed! (ton)
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
@@ -46,9 +48,9 @@ struct Ipo;
|
||||
typedef struct Deform {
|
||||
struct Object *ob;
|
||||
short flag, partype;
|
||||
int par1, par2, par3; /* kunnen vertexnrs zijn */
|
||||
int par1, par2, par3; /* can be vertexnrs */
|
||||
float imat[4][4], premat[4][4], postmat[4][4];
|
||||
float vec[3]; /* als partype==LIMB, voor distfunc */
|
||||
float vec[3]; /* when partype==LIMB, for distfunc */
|
||||
float fac, dist, pad;
|
||||
|
||||
} Deform;
|
||||
@@ -67,12 +69,12 @@ typedef struct Ika {
|
||||
short partype, flag, iter, lastfra;
|
||||
|
||||
ListBase limbbase;
|
||||
float eff[3], effg[3], effn[3]; /* current, global en (local)wanted */
|
||||
float eff[3], effg[3], effn[3];
|
||||
float mem, slow, toty, totx, xyconstraint;
|
||||
|
||||
struct Ipo *ipo;
|
||||
struct Object *parent;
|
||||
int par1, par2, par3; /* kunnen vertexnrs zijn */
|
||||
int par1, par2, par3;
|
||||
|
||||
int totdef;
|
||||
Deform *def;
|
||||
|
@@ -52,12 +52,12 @@ typedef struct Image {
|
||||
short ok, flag;
|
||||
short lastframe, lastquality;
|
||||
|
||||
/* texture pagina */
|
||||
/* texture page */
|
||||
short tpageflag, totbind;
|
||||
short xrep, yrep;
|
||||
short twsta, twend;
|
||||
unsigned int bindcode;
|
||||
unsigned int *repbind; /* om subregio's te kunnen repeaten */
|
||||
unsigned int *repbind; /* for repeat of parts of images */
|
||||
|
||||
struct PackedFile * packedfile;
|
||||
|
||||
|
@@ -270,7 +270,7 @@ typedef short IPO_Channel;
|
||||
#define IPO_FLOAT 4
|
||||
#define IPO_DOUBLE 5
|
||||
#define IPO_FLOAT_DEGR 6
|
||||
/* zeer speciaal geval in keys */
|
||||
/* very special case, in keys */
|
||||
#define IPO_BEZTRIPLE 100
|
||||
#define IPO_BPOINT 101
|
||||
|
||||
|
@@ -56,7 +56,7 @@ typedef struct Lamp {
|
||||
float clipsta, clipend, shadspotsize;
|
||||
float bias, soft;
|
||||
|
||||
/* texact is voor buttons */
|
||||
/* texact is for buttons */
|
||||
short texact, shadhalostep;
|
||||
|
||||
struct MTex *mtex[8];
|
||||
|
@@ -43,12 +43,12 @@ struct MTex;
|
||||
struct Ipo;
|
||||
struct Material;
|
||||
|
||||
/* LET OP: type veranderen? ook in ipo.h doen */
|
||||
/* WATCH IT: change type? also make changes in ipo.h */
|
||||
|
||||
typedef struct Material {
|
||||
ID id;
|
||||
|
||||
short colormodel, lay; /* lay: voor dynamics */
|
||||
short colormodel, lay; /* lay: for dynamics (old engine, until 2.04) */
|
||||
float r, g, b;
|
||||
float specr, specg, specb;
|
||||
float mirr, mirg, mirb;
|
||||
@@ -65,7 +65,7 @@ typedef struct Material {
|
||||
short flarec, starc, linec, ringc;
|
||||
float hasize, flaresize, subsize, flareboost;
|
||||
|
||||
/* onderstaand is voor buttons en render*/
|
||||
/* for buttons and render*/
|
||||
char rgbsel, texact, pr_type, septex;
|
||||
short pr_back, pr_lamp;
|
||||
|
||||
|
@@ -76,7 +76,7 @@ typedef struct TFace {
|
||||
/* this one gets interpreted as a image in texture.c */
|
||||
void *tpage;
|
||||
|
||||
float uv[4][2]; /* als je dit wijzigt: ook fie set_correct_uv editmesh.c, ook andere plekken maken gebruik van de lengte van dit blok */
|
||||
float uv[4][2]; /* when you change this: also do function set_correct_uv in editmesh.c, and there are more locations that use the size of this part */
|
||||
unsigned int col[4];
|
||||
char flag, transp;
|
||||
short mode, tile, pad;
|
||||
@@ -132,7 +132,7 @@ typedef struct Mesh {
|
||||
struct Mesh *texcomesh;
|
||||
float *orco;
|
||||
|
||||
struct OcInfo *oc; /* niet in file */
|
||||
struct OcInfo *oc; /* not written in file */
|
||||
void *sumohandle;
|
||||
|
||||
int totvert, totface;
|
||||
@@ -168,7 +168,7 @@ typedef struct Mesh {
|
||||
#define ME_SMESH 64
|
||||
#define ME_SUBSURF 128
|
||||
|
||||
/* puno (mface) */
|
||||
/* puno = vertexnormal (mface) */
|
||||
#define ME_FLIPV1 1
|
||||
#define ME_FLIPV2 2
|
||||
#define ME_FLIPV3 4
|
||||
@@ -187,8 +187,6 @@ typedef struct Mesh {
|
||||
/* flag (mface) */
|
||||
#define ME_SMOOTH 1
|
||||
|
||||
/* tface->mode (beetje compatible met PMD formaat) */
|
||||
/* sharedvert bepaalt hoe de PSX versie wordt, sharedcol is vertexkleur en puno */
|
||||
|
||||
#define TF_DYNAMIC 1
|
||||
/* #define TF_INVISIBLE 2 */
|
||||
|
@@ -69,7 +69,7 @@ typedef struct Object {
|
||||
ID id;
|
||||
|
||||
short type, partype;
|
||||
int par1, par2, par3; /* kunnen vertexnrs zijn */
|
||||
int par1, par2, par3; /* can be vertexnrs */
|
||||
char parsubstr[32]; /* String describing subobject info */
|
||||
void *pardata;
|
||||
struct Object *parent, *track;
|
||||
@@ -89,28 +89,28 @@ typedef struct Object {
|
||||
ListBase defbase;
|
||||
struct Material **mat;
|
||||
|
||||
/* rot en drot moeten achterelkaar! (transform('r' en 's')) */
|
||||
/* rot en drot have to be together! (transform('r' en 's')) */
|
||||
float loc[3], dloc[3], orig[3];
|
||||
float size[3], dsize[3];
|
||||
float rot[3], drot[3];
|
||||
float quat[4], dquat[4];
|
||||
float obmat[4][4];
|
||||
float parentinv[4][4];
|
||||
float imat[4][4]; /* voor bij render, tijdens simulate, tijdelijk: ipokeys van transform */
|
||||
float imat[4][4]; /* for during render, old game engine, temporally: ipokeys of transform */
|
||||
|
||||
unsigned int lay; /* kopie van Base */
|
||||
short flag; /* kopie van Base */
|
||||
short colbits; /* nul==van obdata */
|
||||
unsigned int lay; /* copy of Base */
|
||||
short flag; /* copy of Base */
|
||||
short colbits; /* when zero, from obdata */
|
||||
char transflag, ipoflag;
|
||||
char trackflag, upflag;
|
||||
short ipowin, scaflag; /* ipowin: blocktype laatste ipowindow */
|
||||
short ipowin, scaflag; /* ipowin: blocktype last ipowindow */
|
||||
short scavisflag, boundtype;
|
||||
|
||||
short dupon, dupoff, dupsta, dupend;
|
||||
|
||||
float sf, ctime;
|
||||
|
||||
/* tijdens realtime */
|
||||
/* during realtime */
|
||||
|
||||
/* note that inertia is only called inertia for historical reasons
|
||||
* and is not changed to avoid DNA surgery. It actually reflects the
|
||||
@@ -129,7 +129,7 @@ typedef struct Object {
|
||||
float rdamping, sizefac;
|
||||
|
||||
char dt, dtx;
|
||||
char totcol; /* kopie van mesh of curve of meta */
|
||||
char totcol; /* copy of mesh or curve or meta */
|
||||
char actcol;
|
||||
|
||||
ScriptLink scriptlink;
|
||||
|
@@ -44,7 +44,7 @@ struct ID;
|
||||
typedef struct Oops {
|
||||
struct Oops *next, *prev;
|
||||
short type, flag, dt, hide;
|
||||
float x, y; /* linksonder */
|
||||
float x, y; /* left - bottom */
|
||||
float dx, dy; /* shuffle */
|
||||
struct ID *id;
|
||||
ListBase link;
|
||||
@@ -56,7 +56,7 @@ typedef struct OopsLink {
|
||||
struct OopsLink *next, *prev;
|
||||
short type, flag;
|
||||
ID **idfrom;
|
||||
Oops *to, *from; /* from is voor temp */
|
||||
Oops *to, *from; /* from is for temp */
|
||||
float xof, yof;
|
||||
char name[12];
|
||||
} OopsLink;
|
||||
|
@@ -40,12 +40,12 @@
|
||||
|
||||
typedef struct Radio {
|
||||
short hemires, maxiter;
|
||||
short drawtype, flag; /* bit 0 en 1: limits laten zien */
|
||||
short drawtype, flag; /* bit 0 and 1: show limits */
|
||||
short subshootp, subshoote, nodelim, maxsublamp;
|
||||
short pama, pami, elma, elmi; /* patch en elem limits */
|
||||
short pama, pami, elma, elmi; /* patch and elem limits */
|
||||
int maxnode;
|
||||
float convergence;
|
||||
float radfac, gamma; /* voor afbeelden */
|
||||
float radfac, gamma; /* for display */
|
||||
|
||||
} Radio;
|
||||
|
||||
|
@@ -82,10 +82,9 @@ typedef struct AviCodecData {
|
||||
typedef struct RenderData {
|
||||
struct AviCodecData *avicodecdata;
|
||||
|
||||
/* hoe gaat tijd gedefinieerd worden? */
|
||||
short cfra, sfra, efra; /* plaatjes */
|
||||
short cfra, sfra, efra; /* fames as in 'images' */
|
||||
short images, framapto, flag;
|
||||
float ctime; /* hiermee rekenen? */
|
||||
float ctime; /* use for calcutions */
|
||||
float framelen, blurfac;
|
||||
|
||||
/** For UR edge rendering: give the edges this colour */
|
||||
@@ -98,7 +97,7 @@ typedef struct RenderData {
|
||||
short pad[3];
|
||||
|
||||
short size, maximsize; /* size in %, max in Kb */
|
||||
/* uit buttons: */
|
||||
/* from buttons: */
|
||||
/**
|
||||
* The desired number of pixels in the x direction
|
||||
*/
|
||||
@@ -217,8 +216,8 @@ typedef struct Scene {
|
||||
float cursor[3];
|
||||
unsigned int lay;
|
||||
|
||||
/* enkele realtime vars */
|
||||
struct FreeCamera *fcam;
|
||||
/* some realtime vars */
|
||||
struct FreeCamera *fcam; /* old, can be removed (ton) */
|
||||
|
||||
void *ed;
|
||||
struct Radio *radio;
|
||||
@@ -256,7 +255,7 @@ typedef struct Scene {
|
||||
#define R_PANORAMA 0x0400
|
||||
#define R_MOVIECROP 0x0800
|
||||
#define R_COSMO 0x1000
|
||||
/* deze verschillen tussen IrisGL en OpenGL!!! */
|
||||
/* these difines were different between IrisGL and OpenGL!!! */
|
||||
#define R_ODDFIELD 0x2000
|
||||
#define R_MBLUR 0x4000
|
||||
#define R_UNIFIED 0x8000
|
||||
@@ -303,21 +302,21 @@ typedef struct Scene {
|
||||
#define R_RENDERING 16
|
||||
#define R_ANIMRENDER 32
|
||||
|
||||
/* vlakren->flag */
|
||||
/* vlakren->flag (vlak = face in dutch) */
|
||||
#define R_SMOOTH 1
|
||||
#define R_VISIBLE 2
|
||||
#define R_NOPUNOFLIP 8
|
||||
#define R_CMAPCODE 16
|
||||
#define R_FACE_SPLIT 32
|
||||
|
||||
/* vertren->texofs (texcoordinaten offset vanaf vertren->orco */
|
||||
/* vertren->texofs (texcoordinate offset relative to vertren->orco */
|
||||
#define R_UVOFS3 1
|
||||
|
||||
/* **************** SCENE ********************* */
|
||||
#define RAD_PHASE_PATCHES 1
|
||||
#define RAD_PHASE_FACES 2
|
||||
|
||||
/* base->flag en ob->flag */
|
||||
/* base->flag and ob->flag */
|
||||
#define BA_WASSEL 2
|
||||
#define BA_PARSEL 4
|
||||
#define BA_WHERE_UPDATE 8
|
||||
|
@@ -48,7 +48,7 @@ typedef struct bScreen {
|
||||
struct Scene *scene;
|
||||
short startx, endx, starty, endy; /* framebuffer coords */
|
||||
short sizex, sizey;
|
||||
short scenenr, screennr; /* alleen voor pupmenu */
|
||||
short scenenr, screennr; /* only for pupmenu */
|
||||
short full, rt;
|
||||
short mainwin, winakt;
|
||||
} bScreen;
|
||||
@@ -63,7 +63,7 @@ typedef struct ScrVert {
|
||||
typedef struct ScrEdge {
|
||||
struct ScrEdge *next, *prev;
|
||||
ScrVert *v1, *v2;
|
||||
short border; /* 1 als op rand screen */
|
||||
short border; /* 1 when at edge of screen */
|
||||
short flag;
|
||||
int pad;
|
||||
} ScrEdge;
|
||||
@@ -81,12 +81,12 @@ typedef unsigned short dna_ushort_fix;
|
||||
typedef struct ScrArea {
|
||||
struct ScrArea *next, *prev;
|
||||
ScrVert *v1, *v2, *v3, *v4;
|
||||
bScreen *full; /* als area==full, dit is de parent */
|
||||
bScreen *full; /* if area==full, this is the parent */
|
||||
float winmat[4][4];
|
||||
rcti totrct, headrct, winrct;
|
||||
|
||||
short headwin, win;
|
||||
short headertype; /* 0=niets, 1= down, 2= up */
|
||||
short headertype; /* 0=no header, 1= down, 2= up */
|
||||
char spacetype, butspacetype; /* SPACE_... */
|
||||
short winx, winy; /* size */
|
||||
char head_swap, head_equal;
|
||||
@@ -101,7 +101,7 @@ typedef struct ScrArea {
|
||||
|
||||
#define MAXWIN 128
|
||||
|
||||
/* Als je EDGEWIDTH verandert, ook globale array edcol[] goedzetten */
|
||||
/* If you change EDGEWIDTH, also do the global arrat edcol[] */
|
||||
#define EDGEWIDTH 5
|
||||
#define EDGEWIDTH2 (2)
|
||||
#define AREAGRID 4
|
||||
|
@@ -78,7 +78,7 @@ typedef struct PluginSeq {
|
||||
} PluginSeq;
|
||||
|
||||
|
||||
/* LET OP: eerste stuk identiek aan ID (ivm ipo's) */
|
||||
/* WATCH IT: first part identical to ID (for use in ipo's) */
|
||||
|
||||
typedef struct Sequence {
|
||||
|
||||
@@ -105,7 +105,7 @@ typedef struct Sequence {
|
||||
|
||||
PluginSeq *plugin;
|
||||
|
||||
/* pointers voor effecten: */
|
||||
/* pointers for effects: */
|
||||
struct Sequence *seq1, *seq2, *seq3;
|
||||
|
||||
/* meta */
|
||||
@@ -138,7 +138,7 @@ typedef struct Editing {
|
||||
#define SEQ_OVERLAP 8
|
||||
#define SEQ_FILTERY 16
|
||||
|
||||
/* seq->type LET OP BITJE 3!!! */
|
||||
/* seq->type WATCH IT: BIT 3!!! */
|
||||
#define SEQ_IMAGE 0
|
||||
#define SEQ_META 1
|
||||
#define SEQ_SCENE 2
|
||||
|
@@ -96,7 +96,7 @@ typedef struct SpaceButs {
|
||||
int pad2;
|
||||
View2D v2d;
|
||||
|
||||
short mainb, menunr; /* texnr en menunr moeten shorts blijven */
|
||||
short mainb, menunr; /* texnr and menunr have to remain shorts */
|
||||
short pin, mainbo;
|
||||
void *lockpoin;
|
||||
|
||||
@@ -186,7 +186,7 @@ typedef struct SpaceImage {
|
||||
|
||||
struct Image *image;
|
||||
float zoom;
|
||||
float pad2; /* MAART: is this needed? Ton: yes, padding with 8 bytes aligned */
|
||||
float pad2; /* padding is with 8 bytes aligned */
|
||||
short mode, pin;
|
||||
short imanr, curtile;
|
||||
short xof, yof;
|
||||
@@ -364,7 +364,7 @@ typedef struct SpaceImaSel {
|
||||
#define BUTS_ACT_ACT 128
|
||||
#define BUTS_ACT_LINK 256
|
||||
|
||||
/* deze getallen ook invullen in blender.h SpaceFile: struct dna herkent geen defines */
|
||||
/* these values need to be hardcoded in blender.h SpaceFile: struct dna does not recognize defines */
|
||||
#define FILE_MAXDIR 160
|
||||
#define FILE_MAXFILE 80
|
||||
|
||||
@@ -396,8 +396,8 @@ typedef struct SpaceImaSel {
|
||||
#define MOVIEFILE 32
|
||||
#define PYSCRIPTFILE 64
|
||||
|
||||
#define SCROLLH 16 /* hoogte scrollbar */
|
||||
#define SCROLLB 16 /* breedte scrollbar */
|
||||
#define SCROLLH 16 /* height scrollbar */
|
||||
#define SCROLLB 16 /* width scrollbar */
|
||||
|
||||
/* SpaceImage->mode */
|
||||
#define SI_TEXTURE 0
|
||||
|
@@ -179,7 +179,7 @@ typedef struct Tex {
|
||||
#define TEX_FLIPBLEND 2
|
||||
#define TEX_NEGALPHA 4
|
||||
|
||||
/* extend (begint bij 1 ivm backward comp.) */
|
||||
/* extend (starts with 1 because of backward comp.) */
|
||||
#define TEX_EXTEND 1
|
||||
#define TEX_CLIP 2
|
||||
#define TEX_REPEAT 3
|
||||
|
@@ -93,7 +93,7 @@ typedef struct View3D {
|
||||
float lens, grid, near, far;
|
||||
float ofs[3], cursor[3];
|
||||
|
||||
short mx, my; /* moeten achter elkaar blijven staan ivm als pointer doorgeven */
|
||||
short mx, my; /* have to remain together, because used as single pointer */
|
||||
short mxo, myo;
|
||||
|
||||
short gridlines, viewbut;
|
||||
|
@@ -38,6 +38,10 @@
|
||||
|
||||
struct Ipo;
|
||||
|
||||
|
||||
/* a Wave has never been implemented... it was meant as a 'free' mathematical
|
||||
deformation object type (ton) */
|
||||
|
||||
typedef struct Wave {
|
||||
ID id;
|
||||
|
||||
|
@@ -131,14 +131,14 @@ int maxdata= 500000, maxnr= 50000;
|
||||
int nr_names=0;
|
||||
int nr_types=0;
|
||||
int nr_structs=0;
|
||||
char **names, *namedata; /* op adres names[a] staat string a */
|
||||
char **types, *typedata; /* op adres types[a] staat string a */
|
||||
short *typelens; /* op typelens[a] staat de lengte van type a */
|
||||
char **names, *namedata; /* at adress names[a] is string a */
|
||||
char **types, *typedata; /* at adress types[a] is string a */
|
||||
short *typelens; /* at typelens[a] is de length of type a */
|
||||
short *alphalens; /* contains sizes as they are calculated on the alpha */
|
||||
short **structs, *structdata; /* op sp= structs[a] staat eerste adres structdefinitie
|
||||
sp[0] is typenummer
|
||||
sp[1] is aantal elementen
|
||||
sp[2] sp[3] is typenr, namenr (enz) */
|
||||
short **structs, *structdata; /* at sp= structs[a] is the first adress of a struct definition
|
||||
sp[0] is type number
|
||||
sp[1] is amount of elements
|
||||
sp[2] sp[3] is typenr, namenr (etc) */
|
||||
/*
|
||||
* debugSDNA:
|
||||
* - 0 = no output, except errors
|
||||
@@ -225,7 +225,7 @@ int add_type(char *str, int len)
|
||||
|
||||
if(str[0]==0) return -1;
|
||||
|
||||
/* zoek typearray door */
|
||||
/* search through type array */
|
||||
for(nr=0; nr<nr_types; nr++) {
|
||||
if(strcmp(str, types[nr])==0) {
|
||||
if (len) {
|
||||
@@ -236,7 +236,7 @@ int add_type(char *str, int len)
|
||||
}
|
||||
}
|
||||
|
||||
/* nieuw type appenden */
|
||||
/* append new type */
|
||||
if(nr_types==0) cp= typedata;
|
||||
else {
|
||||
cp= types[nr_types-1]+strlen(types[nr_types-1])+1;
|
||||
@@ -356,14 +356,14 @@ int add_name(char *str)
|
||||
name = str;
|
||||
}
|
||||
|
||||
/* zoek name array door */
|
||||
/* search name array */
|
||||
for(nr=0; nr<nr_names; nr++) {
|
||||
if(strcmp(name, names[nr])==0) {
|
||||
return nr;
|
||||
}
|
||||
}
|
||||
|
||||
/* nieuw type appenden */
|
||||
/* append new type */
|
||||
if(nr_names==0) cp= namedata;
|
||||
else {
|
||||
cp= names[nr_names-1]+strlen(names[nr_names-1])+1;
|
||||
@@ -415,7 +415,7 @@ int preprocess_include(char *maindata, int len)
|
||||
memcpy(temp, maindata, len);
|
||||
|
||||
// remove all c++ comments
|
||||
/* alle enters/tabs/etc vervangen door spaties */
|
||||
/* replace all enters/tabs/etc with spaces */
|
||||
cp= temp;
|
||||
a= len;
|
||||
comment = 0;
|
||||
@@ -430,7 +430,7 @@ int preprocess_include(char *maindata, int len)
|
||||
}
|
||||
|
||||
|
||||
/* data uit temp naar maindata kopieeren, verwijder commentaar en dubbele spaties */
|
||||
/* data from temp copy to maindata, remove comments and double spaces */
|
||||
cp= temp;
|
||||
md= maindata;
|
||||
newlen= 0;
|
||||
@@ -447,10 +447,10 @@ int preprocess_include(char *maindata, int len)
|
||||
cp[0]=cp[1]= 32;
|
||||
}
|
||||
|
||||
/* niet kopieeren als: */
|
||||
/* do not copy when: */
|
||||
if(comment);
|
||||
else if( cp[0]==' ' && cp[1]==' ' );
|
||||
else if( cp[-1]=='*' && cp[0]==' ' ); /* pointers met spatie */
|
||||
else if( cp[-1]=='*' && cp[0]==' ' ); /* pointers with a space */
|
||||
else {
|
||||
md[0]= cp[0];
|
||||
md++;
|
||||
@@ -498,8 +498,8 @@ void *read_file_data(char *filename, int *len_r)
|
||||
|
||||
int convert_include(char *filename)
|
||||
{
|
||||
/* lees includefile, sla structen over die op regel ervoor '#' hebben.
|
||||
sla alle data op in tijdelijke arrays.
|
||||
/* read include file, skip structs with a '#' before it.
|
||||
store all data in temporal arrays.
|
||||
*/
|
||||
int filelen, count, overslaan, slen, type, name, strct;
|
||||
short *structpoin, *sp;
|
||||
@@ -514,12 +514,12 @@ int convert_include(char *filename)
|
||||
filelen= preprocess_include(maindata, filelen);
|
||||
mainend= maindata+filelen-1;
|
||||
|
||||
/* we zoeken naar '{' en dan terug naar 'struct' */
|
||||
/* we look for '{' and then back to 'struct' */
|
||||
count= 0;
|
||||
overslaan= 0;
|
||||
while(count<filelen) {
|
||||
|
||||
/* code voor struct overslaan: twee hekjes. (voor spatie zorgt preprocess) */
|
||||
/* code for skipping a struct: two hashes. (preprocess added a space) */
|
||||
if(md[0]=='#' && md[1]==' ' && md[2]=='#') {
|
||||
overslaan= 1;
|
||||
}
|
||||
@@ -532,10 +532,10 @@ int convert_include(char *filename)
|
||||
else {
|
||||
if(md[-1]==' ') md[-1]= 0;
|
||||
md1= md-2;
|
||||
while( *md1!=32) md1--; /* naar begin woord */
|
||||
while( *md1!=32) md1--; /* to beginning of word */
|
||||
md1++;
|
||||
|
||||
/* structnaam te pakken, als... */
|
||||
/* we've got a struct name when... */
|
||||
if( strncmp(md1-7, "struct", 6)==0 ) {
|
||||
|
||||
|
||||
@@ -545,7 +545,7 @@ int convert_include(char *filename)
|
||||
|
||||
if (debugSDNA > 1) printf("\t|\t|-- detected struct %s\n", types[strct]);
|
||||
|
||||
/* eerst overal keurige strings van maken */
|
||||
/* first lets make it all nice strings */
|
||||
md1= md+1;
|
||||
while(*md1 != '}') {
|
||||
if( ((long)md1) > ((long)mainend) ) break;
|
||||
@@ -554,17 +554,17 @@ int convert_include(char *filename)
|
||||
md1++;
|
||||
}
|
||||
|
||||
/* types en namen lezen tot eerste karakter niet '}' */
|
||||
/* read types and names until first character that is not '}' */
|
||||
md1= md+1;
|
||||
while( *md1 != '}' ) {
|
||||
if( ((long)md1) > ((long)mainend) ) break;
|
||||
|
||||
/* als er 'struct' of 'unsigned' staat, overslaan */
|
||||
/* skip when it says 'struct' or 'unsigned' */
|
||||
if(*md1) {
|
||||
if( strncmp(md1, "struct", 6)==0 ) md1+= 7;
|
||||
if( strncmp(md1, "unsigned", 6)==0 ) md1+= 9;
|
||||
|
||||
/* type te pakken! */
|
||||
/* we've got a type! */
|
||||
type= add_type(md1, 0);
|
||||
|
||||
if (debugSDNA > 1) printf("\t|\t|\tfound type %s (", md1);
|
||||
@@ -572,12 +572,12 @@ int convert_include(char *filename)
|
||||
md1+= strlen(md1);
|
||||
|
||||
|
||||
/* doorlezen tot ';' */
|
||||
/* read until ';' */
|
||||
while( *md1 != ';' ) {
|
||||
if( ((long)md1) > ((long)mainend) ) break;
|
||||
|
||||
if(*md1) {
|
||||
/* Name te pakken. slen needs
|
||||
/* We've got a name. slen needs
|
||||
* correction for function
|
||||
* pointers! */
|
||||
slen= strlen(md1);
|
||||
@@ -663,12 +663,12 @@ int calculate_structlens(void)
|
||||
lastunknown= unknown;
|
||||
unknown= 0;
|
||||
|
||||
/* loop alle structen af... */
|
||||
/* check all structs... */
|
||||
for(a=0; a<nr_structs; a++) {
|
||||
structpoin= structs[a];
|
||||
structtype= structpoin[0];
|
||||
|
||||
/* als lengte nog niet bekend */
|
||||
/* when length is not known... */
|
||||
if(typelens[structtype]==0) {
|
||||
|
||||
sp= structpoin+2;
|
||||
@@ -676,16 +676,16 @@ int calculate_structlens(void)
|
||||
alphalen = 0;
|
||||
has_pointer = 0;
|
||||
|
||||
/* loop alle elementen in struct af */
|
||||
/* check all elements in struct */
|
||||
for(b=0; b<structpoin[1]; b++, sp+=2) {
|
||||
type= sp[0];
|
||||
cp= names[sp[1]];
|
||||
|
||||
namelen= strlen(cp);
|
||||
/* is het een pointer of functiepointer? */
|
||||
/* is it a pointer or function pointer? */
|
||||
if(cp[0]=='*' || cp[1]=='*') {
|
||||
has_pointer = 1;
|
||||
/* heeft de naam een extra lengte? (array) */
|
||||
/* has the name an extra length? (array) */
|
||||
mul= 1;
|
||||
if( cp[namelen-1]==']') mul= arraysize(cp, namelen);
|
||||
|
||||
@@ -711,7 +711,7 @@ int calculate_structlens(void)
|
||||
alphalen += 8 * mul;
|
||||
|
||||
} else if( typelens[type] ) {
|
||||
/* heeft de naam een extra lengte? (array) */
|
||||
/* has the name an extra length? (array) */
|
||||
mul= 1;
|
||||
if( cp[namelen-1]==']') mul= arraysize(cp, namelen);
|
||||
|
||||
@@ -763,7 +763,7 @@ int calculate_structlens(void)
|
||||
structpoin= structs[a];
|
||||
structtype= structpoin[0];
|
||||
|
||||
/* lengte nog niet bekend */
|
||||
/* length unknown */
|
||||
if(typelens[structtype]!=0) {
|
||||
printf(" %s\n", types[structtype]);
|
||||
}
|
||||
@@ -777,7 +777,7 @@ int calculate_structlens(void)
|
||||
structpoin= structs[a];
|
||||
structtype= structpoin[0];
|
||||
|
||||
/* lengte nog niet bekend */
|
||||
/* length unkown yet */
|
||||
if(typelens[structtype]==0) {
|
||||
printf(" %s\n", types[structtype]);
|
||||
}
|
||||
@@ -818,7 +818,7 @@ void printStructLenghts(void)
|
||||
lastunknown= unknown;
|
||||
unknown= 0;
|
||||
|
||||
/* loop alle structen af... */
|
||||
/* check all structs... */
|
||||
for(a=0; a<nr_structs; a++) {
|
||||
structpoin= structs[a];
|
||||
structtype= structpoin[0];
|
||||
@@ -846,20 +846,20 @@ int make_structDNA(FILE *file)
|
||||
printf("\tProgram version: %s\n", DNA_VERSION_DATE);
|
||||
}
|
||||
|
||||
/* de allerlangst bekende struct is 50k, 100k is ruimte genoeg! */
|
||||
/* the longest known struct is 50k, so we assume 100k is sufficent! */
|
||||
namedata= MEM_callocN(maxdata, "namedata");
|
||||
typedata= MEM_callocN(maxdata, "typedata");
|
||||
structdata= MEM_callocN(maxdata, "structdata");
|
||||
|
||||
/* maximaal 5000 variablen, vast voldoende? */
|
||||
/* a maximum of 5000 variables, must be sufficient? */
|
||||
names= MEM_callocN(sizeof(char *)*maxnr, "names");
|
||||
types= MEM_callocN(sizeof(char *)*maxnr, "types");
|
||||
typelens= MEM_callocN(sizeof(short)*maxnr, "typelens");
|
||||
alphalens= MEM_callocN(sizeof(short)*maxnr, "alphalens");
|
||||
structs= MEM_callocN(sizeof(short)*maxnr, "structs");
|
||||
|
||||
/* inserten alle bekende types */
|
||||
/* let op: uint komt niet voor! gebruik in structen unsigned int */
|
||||
/* insertion of all known types */
|
||||
/* watch it: uint is not allowed! use in structs an unsigned int */
|
||||
add_type("char", 1); /* 0 */
|
||||
add_type("uchar", 1); /* 1 */
|
||||
add_type("short", 2); /* 2 */
|
||||
@@ -903,7 +903,7 @@ int make_structDNA(FILE *file)
|
||||
return(1);
|
||||
}
|
||||
|
||||
/* DIT DEEL VOOR DEBUG */
|
||||
/* FOR DEBUG */
|
||||
if (debugSDNA > 1)
|
||||
{
|
||||
int a,b;
|
||||
@@ -934,7 +934,7 @@ int make_structDNA(FILE *file)
|
||||
}
|
||||
}
|
||||
|
||||
/* file schrijven */
|
||||
/* file writing */
|
||||
|
||||
if (debugSDNA > -1) printf("Writing file ... ");
|
||||
|
||||
@@ -943,34 +943,34 @@ int make_structDNA(FILE *file)
|
||||
strcpy(str, "SDNA");
|
||||
dna_write(file, str, 4);
|
||||
|
||||
/* SCHRIJF NAMEN */
|
||||
/* write names */
|
||||
strcpy(str, "NAME");
|
||||
dna_write(file, str, 4);
|
||||
len= nr_names;
|
||||
dna_write(file, &len, 4);
|
||||
|
||||
/* lengte berekenen datablok met strings */
|
||||
/* calculate size of datablock with strings */
|
||||
cp= names[nr_names-1];
|
||||
cp+= strlen(names[nr_names-1]) + 1; /* +1: nul-terminator */
|
||||
cp+= strlen(names[nr_names-1]) + 1; /* +1: null-terminator */
|
||||
len= (long)cp - (long)(names[0]);
|
||||
len= (len+3) & ~3;
|
||||
dna_write(file, names[0], len);
|
||||
|
||||
/* SCHRIJF TYPES */
|
||||
/* write TYPES */
|
||||
strcpy(str, "TYPE");
|
||||
dna_write(file, str, 4);
|
||||
len= nr_types;
|
||||
dna_write(file, &len, 4);
|
||||
|
||||
/* lengte berekenen datablok */
|
||||
/* calculate datablock size */
|
||||
cp= types[nr_types-1];
|
||||
cp+= strlen(types[nr_types-1]) + 1; /* +1: nul-terminator */
|
||||
cp+= strlen(types[nr_types-1]) + 1; /* +1: null-terminator */
|
||||
len= (long)cp - (long)(types[0]);
|
||||
len= (len+3) & ~3;
|
||||
|
||||
dna_write(file, types[0], len);
|
||||
|
||||
/* SCHRIJF TYPELENGTES */
|
||||
/* WRITE TYPELENGTHS */
|
||||
strcpy(str, "TLEN");
|
||||
dna_write(file, str, 4);
|
||||
|
||||
@@ -978,13 +978,13 @@ int make_structDNA(FILE *file)
|
||||
if(nr_types & 1) len+= 2;
|
||||
dna_write(file, typelens, len);
|
||||
|
||||
/* SCHRIJF STRUCTEN */
|
||||
/* WRITE STRUCTS */
|
||||
strcpy(str, "STRC");
|
||||
dna_write(file, str, 4);
|
||||
len= nr_structs;
|
||||
dna_write(file, &len, 4);
|
||||
|
||||
/* lengte berekenen datablok */
|
||||
/* calc datablock size */
|
||||
sp= structs[nr_structs-1];
|
||||
sp+= 2+ 2*( sp[1] );
|
||||
len= (long)sp - (long)(structs[0]);
|
||||
@@ -992,7 +992,7 @@ int make_structDNA(FILE *file)
|
||||
|
||||
dna_write(file, structs[0], len);
|
||||
|
||||
/* dna padding test */
|
||||
/* a simple dna padding test */
|
||||
|
||||
if (0) {
|
||||
FILE *fp;
|
||||
@@ -1036,7 +1036,7 @@ int make_structDNA(FILE *file)
|
||||
return(0);
|
||||
}
|
||||
|
||||
/* ************************* END MAKEN DNA ********************** */
|
||||
/* ************************* END MAKE DNA ********************** */
|
||||
|
||||
void make_bad_file(char *file)
|
||||
{
|
||||
|
Reference in New Issue
Block a user