gCAD3D 2.35
ut_mem.h
Go to the documentation of this file.
1 
2  // ut_mem.o:
3  int MEM_swap__ (void *stru1, void* stru2, long strSiz);
4 
5 
6  int MEM_ins_rec (void *insPos, long movSiz, void *insDat, long insSiz);
7  int MEM_chg_rec (void *datStart, long *datSiz,
8  void *insDat, long insSiz,
9  void *delPos, long delSiz);
10  int MEM_ins_nrec (int *recNr, void *recTab,
11  int ipos, void *insDat, int insRecNr, int sizRec);
12  int MEM_del_nrec (int *recNr, void *recTab,
13  int ipos, int delRecNr, int sizRec);
14  int MEM_del_IndRec (int *recNr, void *recTab, int ipos);
15  int MEM_del_DbRec (int *recNr, void *recTab, int ipos);
16  void* MEM_ptr_mov (void *ptr, long dist);
17  int MEM_cmp__ (void *obj1, void *obj2, int size);
18 
19 
20 //----------------------------------------------------------------
22 #define MEM_cmp__ memcmp
23 
25 void MEM_swap_short (short *i1, short *i2);
26 #define MEM_swap_short(i1,i2){\
27  short _i3 = *(i1); *(i1) = *(i2); *(i2) = _i3;}
28 
30 void MEM_swap_int (int *i1, int *i2);
31 #define MEM_swap_int(i1,i2){\
32  int _i3 = *(i1); *(i1) = *(i2); *(i2) = _i3;}
33 
35 void MEM_swap_2lg (long *i1, long *i2);
36 #define MEM_swap_2lg(i1,i2){\
37  long _i3 = *(i1); *(i1) = *(i2); *(i2) = _i3;}
38 
40 void MEM_swap_2db (double*, double*);
41 #define MEM_swap_2db(d1,d2){\
42  double _d3 = *(d1); *(d1) = *(d2); *(d2) = _d3;}
43 
45 void MEM_swap_2vp (void **v1, void **v2);
46 #define MEM_swap_2vp(v1,v2){\
47  void *_v3 = *(v1); *(v1) = *(v2); *(v2) = _v3;}
48 // void MEM_swap_2vp (void **p1, void **p2)
49 
50 // swap structs: MEM_swap__ ();
51 
57 #define MEM_ptr_mov(ptr,dist) ((char*)(ptr) + (dist))
58 
59 
68 void* MEM_alloc_tmp(int);
69 #ifdef _MSC_VER
70 #define MEM_alloc_tmp(siz) _alloca(siz + 64)
71 //#define MEM_alloc_tmp(siz) alloca(siz)
72 #else
73 #define MEM_alloc_tmp(siz) alloca(siz)
74 #endif
75 
76 
78 int MEM_alloc_file (void**, long*, char*);
79 #define MEM_alloc_file(fBuf, fSiz, fNam)\
80  *fSiz = OS_FilSiz (fNam);\
81  *fBuf = (void*)MEM_alloc_tmp (*fSiz)
82 
83 
84 //=============== EOF ============================================
#define MEM_swap_2db(d1, d2)
Definition: ut_mem.h:41
int MEM_del_DbRec(int *recNr, void *recTab, int ipos)
Definition: ut_mem.c:599
#define MEM_swap_2lg(i1, i2)
Definition: ut_mem.h:36
#define MEM_swap_int(i1, i2)
Definition: ut_mem.h:31
int MEM_ins_nrec(int *recNr, void *recTab, int ipos, void *insDat, int insRecNr, int sizRec)
Definition: ut_mem.c:468
#define MEM_cmp__
compare memoryspaces (n bytes); returns 0 for equal.
Definition: ut_mem.h:22
int MEM_del_nrec(int *recNr, void *recTab, int ipos, int delRecNr, int sizRec)
Definition: ut_mem.c:612
int MEM_ins_rec(void *insPos, long movSiz, void *insDat, long insSiz)
Definition: ut_mem.c:437
#define MEM_alloc_file(fBuf, fSiz, fNam)
Definition: ut_mem.h:79
#define MEM_ptr_mov(ptr, dist)
Definition: ut_mem.h:57
#define MEM_swap_short(i1, i2)
Definition: ut_mem.h:26
int MEM_swap__(void *stru1, void *stru2, long strSiz)
Definition: ut_mem.c:344
#define MEM_swap_2vp(v1, v2)
Definition: ut_mem.h:46
#define MEM_alloc_tmp(siz)
Definition: ut_mem.h:73
int MEM_chg_rec(void *datStart, long *datSiz, void *insDat, long insSiz, void *delPos, long delSiz)
Definition: ut_mem.c:518
int MEM_del_IndRec(int *recNr, void *recTab, int ipos)
Definition: ut_mem.c:586