#include "training.h"
#include "debug.h"
#include "memry.h"
#include "grphics.h"
#include "evnts.h"
Go to the source code of this file.
void* c_alloc_mem | ( | INT32 | count | ) |
Allocate count units of memory.
count | Number of bytes to get |
Definition at line 97 of file training.cpp.
References alloc_mem().
void* c_alloc_mem_p | ( | INT32 | count | ) |
Allocate permanent space.
count | Block size to allocate |
Definition at line 84 of file training.cpp.
References alloc_mem_p().
00087 { 00088 return alloc_mem_p(count); 00089 }// c_alloc_mem_p
char* c_alloc_string | ( | INT32 | count | ) |
Allocate string.
count | Number of chars required |
Definition at line 60 of file training.cpp.
References alloc_string().
00063 { 00064 return alloc_string(count); 00065 }// c_alloc_string
void* c_alloc_struct | ( | INT32 | count, | |
const char * | name | |||
) |
Allocate count units of memory for name Class.
count | Number of chars required | |
name | Class name |
Definition at line 136 of file training.cpp.
References alloc_struct().
00140 { 00141 return alloc_struct(count,name); 00142 }// c_alloc_struct
void c_check_mem | ( | const char * | string, | |
INT8 | level | |||
) |
Check consistency of string.
string | Context message | |
level | Level of check |
Definition at line 122 of file training.cpp.
References check_mem().
00126 { 00127 check_mem(string,level); 00128 }// c_check_mem
void c_clear_window | ( | void * | win | ) |
Clear window.
win | Window |
Definition at line 300 of file training.cpp.
References WINFD::Clear_view_surface().
00303 { 00304 WINDOW window=(WINDOW)win; 00305 00306 window->Clear_view_surface(); 00307 }// c_clear_window
void* c_create_window | ( | const char * | name, | |
INT16 | xpos, | |||
INT16 | ypos, | |||
INT16 | xsize, | |||
INT16 | ysize, | |||
double | xmin, | |||
double | xmax, | |||
double | ymin, | |||
double | ymax | |||
) |
Create new window for training interface.
name | Name/title of window | |
xpos | X coord of window | |
ypos | Y coord of window | |
xsize | Width, size of window | |
ysize | Height, size of window | |
xmin | Minimum x user can scroll | |
xmax | Maximum x user can scroll | |
ymin | Minimum y user can scroll | |
ymax | Maximum y user can scroll |
Definition at line 224 of file training.cpp.
References create_window, FALSE, SCROLLINGWIN, and TRUE.
00235 { 00236 return create_window(name,SCROLLINGWIN,xpos,ypos,xsize,ysize, 00237 xmin,xmax,ymin,ymax,TRUE,FALSE,FALSE,TRUE); 00238 }// c_create_window
void c_draw | ( | void * | win, | |
double | x, | |||
double | y | |||
) |
Draw line to new point (x,y) and move pen.
win | Window | |
x | To x | |
y | To y |
Definition at line 284 of file training.cpp.
References WINFD::Draw2d().
void c_free_mem | ( | void * | oldchunk | ) |
Free mem from alloc_mem.
oldchunk | Chunk to free |
Definition at line 109 of file training.cpp.
References free_mem().
00112 { 00113 free_mem(oldchunk); 00114 }// c_free_mem
void c_free_string | ( | char * | string | ) |
Free a string.
string | String to free |
Definition at line 72 of file training.cpp.
References free_string().
00075 { 00076 free_string(string); 00077 }// c_free_string
void c_free_struct | ( | void * | deadstruct, | |
INT32 | count, | |||
const char * | name | |||
) |
Free a structure of count bytes.
deadstruct | Structure to free | |
count | Number of bytes | |
name | Class name |
Definition at line 151 of file training.cpp.
References free_struct().
00156 { 00157 free_struct(deadstruct,count,name); 00158 }// c_free_struct
void c_line_color_index | ( | void * | win, | |
C_COL | index | |||
) |
Sets color of line.
win | Window | |
index | Color (0 to 48) to set line to |
Definition at line 246 of file training.cpp.
References WINFD::Line_color_index().
00250 { 00251 WINDOW window=(WINDOW)win; 00252 00253 // ASSERT_HOST(index>=0 && index<=48); 00254 if (index<0 || index>48) 00255 index=(C_COL)1; 00256 window->Line_color_index((COLOUR)index); 00257 }
void c_make_current | ( | void * | win | ) |
Make picture current, FIX:.
win | Window |
Definition at line 165 of file training.cpp.
References WINFD::Make_picture_current().
00168 { 00169 WINDOW window=(WINDOW)win; 00170 00171 window->Make_picture_current(); 00172 }// c_make_current
void c_move | ( | void * | win, | |
double | x, | |||
double | y | |||
) |
Move "current location" to new point (x,y).
win | Window | |
x | To x | |
y | To y |
Definition at line 266 of file training.cpp.
References WINFD::Move2d().
void cprintf | ( | const char * | format, | |
... | ||||
) |
Does nothing at all, might output a trace printf.
format | Special message | |
... | Additional parameters |
Definition at line 48 of file training.cpp.
References tprintf().
void reverse16 | ( | void * | ptr | ) |
Inverts/flips 16-bit data (2 characters) pointed to by ptr.
ptr | Pointer to data |
Definition at line 199 of file training.cpp.
00202 { 00203 char tmp; 00204 char* cptr=(char*)ptr; 00205 00206 tmp=*cptr; 00207 *cptr=*(cptr+1); 00208 *(cptr+1)=tmp; 00209 }// reverse16
void reverse32 | ( | void * | ptr | ) |
Inverts/flips 32-bit data (4 characters) pointed to by ptr.
ptr | Pointer to data |
Definition at line 179 of file training.cpp.
00182 { 00183 char tmp; 00184 char* cptr=(char*)ptr; 00185 00186 tmp=*cptr; 00187 *cptr=*(cptr+3); 00188 *(cptr+3)=tmp; 00189 tmp=*(cptr+1); 00190 *(cptr+1)=*(cptr+2); 00191 *(cptr+2)=tmp; 00192 }// reverse32
char window_wait | ( | void * | win | ) |
Move pen.
win | Window |
Definition at line 313 of file training.cpp.
References ANY_EVENT, await_event, graphicsevent::key, KEYPRESS_EVENT, TRUE, and graphicsevent::type.
00316 { 00317 WINDOW window=(WINDOW)win; 00318 GRAPHICS_EVENT event; 00319 00320 await_event(window,TRUE,ANY_EVENT,&event); 00321 if (event.type==KEYPRESS_EVENT) 00322 return event.key; 00323 else 00324 return '\0'; 00325 }// window_wait
char* demodir |