Changeset 39 for abuse/trunk/src/imlib
- Timestamp:
- Mar 2, 2008, 12:29:06 AM (15 years ago)
- Location:
- abuse/trunk/src/imlib
- Files:
-
- 27 edited
Legend:
- Unmodified
- Added
- Removed
-
abuse/trunk/src/imlib/filesel.cpp
r4 r39 109 109 } 110 110 111 jwindow *file_dialog(window_manager *wm, char *prompt, char *def, 112 int ok_id, char *ok_name, int cancel_id, char *cancel_name, char *FILENAME_str, int filename_id) 111 jwindow *file_dialog(window_manager *wm, char const *prompt, char const *def, 112 int ok_id, char const *ok_name, int cancel_id, 113 char const *cancel_name, char const *FILENAME_str, 114 int filename_id) 113 115 { 114 116 int wl=WINDOW_FRAME_LEFT,wh=WINDOW_FRAME_TOP; -
abuse/trunk/src/imlib/fonts.cpp
r4 r39 17 17 } 18 18 19 void texture_font::put_string(image *screen, int x, int y, char *st)19 void texture_font::put_string(image *screen, int x, int y, char const *st) 20 20 { while (*st) 21 21 { put_char(screen,x,y,*st); … … 26 26 27 27 28 void JCFont::put_string(image *screen, int x, int y, char *st, int color)28 void JCFont::put_string(image *screen, int x, int y, char const *st, int color) 29 29 { while (*st) 30 30 { put_char(screen,x,y,*st,color); -
abuse/trunk/src/imlib/guistat.cpp
r2 r39 13 13 int last_update; 14 14 time_marker last_time; 15 gui_status_node(char *Name, visual_object *Show, window_manager *WM, gui_status_node *Next)15 gui_status_node(char const *Name, visual_object *Show, window_manager *WM, gui_status_node *Next) 16 16 { name=strcpy((char *)jmalloc(strlen(Name)+1,"status name"),Name); 17 17 show=Show; … … 60 60 #endif 61 61 62 void gui_status_manager::push(char *name, visual_object *show)62 void gui_status_manager::push(char const *name, visual_object *show) 63 63 { 64 64 first=new gui_status_node(name,show,wm,first); -
abuse/trunk/src/imlib/image.cpp
r19 r39 13 13 14 14 extern uint8_t current_background; 15 char *imerr_messages[]={"No error", 16 "Error occured while reading", 17 "Incorrect file type", 18 "File is corrupted", 19 "File not found", 20 "Memory allocation trouble", 21 "Operation/file type not supported", 22 "Error occured while writing, (disk full?)"}; 15 16 char const *imerr_messages[] = 17 { 18 "No error", 19 "Error occured while reading", 20 "Incorrect file type", 21 "File is corrupted", 22 "File not found", 23 "Memory allocation trouble", 24 "Operation/file type not supported", 25 "Error occured while writing, (disk full?)" 26 }; 23 27 24 28 -
abuse/trunk/src/imlib/include/filesel.hpp
r2 r39 4 4 #include "jwindow.hpp" 5 5 6 7 8 jwindow *file_dialog(window_manager *wm, char *prompt, char *def, 9 int ok_id, char *ok_name, int cancel_id, char *cancel_name, 10 char *FILENAME_str, 6 jwindow *file_dialog(window_manager *wm, char const *prompt, char const *def, 7 int ok_id, char const *ok_name, int cancel_id, 8 char const *cancel_name, char const *FILENAME_str, 11 9 int filename_id); 12 10 -
abuse/trunk/src/imlib/include/fonts.hpp
r2 r39 13 13 texture_font(image *letters, image *font_pattern=NULL); 14 14 void put_char(image *screen, int x, int y, char ch); 15 void put_string(image *screen, int x, int y, char *st);15 void put_string(image *screen, int x, int y, char const *st); 16 16 int height() { return th; } 17 17 int length() { return tl; } … … 29 29 JCFont(image *letters); 30 30 void put_char(image *screen, int x, int y, char ch, int color=-1); 31 void put_string(image *screen, int x, int y, char *st, int color=-1);31 void put_string(image *screen, int x, int y, char const *st, int color=-1); 32 32 int height() { return th; } 33 33 int length() { return tl; } -
abuse/trunk/src/imlib/include/guistat.hpp
r2 r39 14 14 gui_status_node *first; 15 15 gui_status_manager(window_manager *WM); 16 virtual void push(char *name, visual_object *show);16 virtual void push(char const *name, visual_object *show); 17 17 virtual void update(int percentage); 18 18 virtual void pop(); 19 19 void draw_bar(gui_status_node *whom, int perc); 20 void set_window_title(char *name) { strncpy(title,name,39); }20 void set_window_title(char const *name) { strncpy(title,name,39); } 21 21 virtual void force_display(); 22 22 } ; -
abuse/trunk/src/imlib/include/image.hpp
r19 r39 9 9 #define Inew(pointer,type); { make_block(sizeof(type)); pointer=new type; } 10 10 11 extern char *imerr_messages[]; // correspond to imERRORS11 extern char const *imerr_messages[]; // correspond to imERRORS 12 12 #define imREAD_ERROR 1 13 13 #define imINCORRECT_FILETYPE 2 -
abuse/trunk/src/imlib/include/input.hpp
r2 r39 12 12 int act_id; 13 13 public : 14 button(int X, int Y, int ID, char *Text, ifield *Next);14 button(int X, int Y, int ID, char const *Text, ifield *Next); 15 15 button(int X, int Y, int ID, image *vis, ifield *Next); 16 16 button(int X, int Y, int ID, image *Depressed, image *Pressed, image *active, ifield *Next); … … 64 64 } 65 65 public : 66 text_field(int X, int Y, int ID, char *Prompt, char*Format,67 char *Data, ifield *Next);68 text_field(int X, int Y, int ID, char *Prompt, char*Format,66 text_field(int X, int Y, int ID, char const *Prompt, char const *Format, 67 char const *Data, ifield *Next); 68 text_field(int X, int Y, int ID, char const *Prompt, char const *Format, 69 69 double Data, ifield *Next); 70 70 … … 76 76 virtual ~text_field() { jfree(prompt); jfree(format); jfree(data); } 77 77 virtual char *read(); 78 void change_data(char *new_data, int new_cursor, // cursor==-1, does not change it.78 void change_data(char const *new_data, int new_cursor, // cursor==-1, does not change it. 79 79 int active, image *screen, window_manager *wm); 80 80 } ; … … 85 85 char *text; 86 86 int w,h; 87 void put_para(image *screen, char *st, int dx, int dy, int xspace,87 void put_para(image *screen, char const *st, int dx, int dy, int xspace, 88 88 int yspace, JCFont *font, int color); 89 89 public : 90 info_field(int X, int Y, int ID, char *info, ifield *Next);90 info_field(int X, int Y, int ID, char const *info, ifield *Next); 91 91 virtual void area(int &x1, int &y1, int &x2, int &y2, window_manager *wm); 92 92 virtual void draw_first(image *screen, window_manager *wm); -
abuse/trunk/src/imlib/include/jmalloc.hpp
r17 r39 8 8 enum {ALLOC_SPACE_STATIC,ALLOC_SPACE_CACHE}; 9 9 extern int alloc_space; 10 void *jmalloc(int32_t size, char *what_for);11 void *jrealloc(void *ptr, int32_t size, char *what_for);10 void *jmalloc(int32_t size, char const *what_for); 11 void *jrealloc(void *ptr, int32_t size, char const *what_for); 12 12 void jfree(void *ptr); 13 void mem_report(char *filename);13 void mem_report(char const *filename); 14 14 void jmalloc_init(int32_t min_size); 15 15 void jmalloc_uninit(); -
abuse/trunk/src/imlib/include/jwindow.hpp
r17 r39 84 84 input_manager *inm; 85 85 void *local_info; // pointer to info block for local system (may support windows) 86 jwindow(int X, int Y, int L, int H, window_manager *wm, ifield *fields, char *Name=NULL);86 jwindow(int X, int Y, int L, int H, window_manager *wm, ifield *fields, char const *Name=NULL); 87 87 void redraw(int hi, int med, int low, JCFont *fnt); 88 88 void resize(int L, int H); … … 116 116 window_manager(image *Screen, palette *Pal, int Hi, int Med, int Low, JCFont *Font); 117 117 118 jwindow *new_window(int x, int y, int l, int h, ifield *fields=NULL, char *Name=NULL);118 jwindow *new_window(int x, int y, int l, int h, ifield *fields=NULL, char const *Name=NULL); 119 119 void set_frame_font(JCFont *fnt) { wframe_fnt=fnt; } 120 120 JCFont *frame_font() { return wframe_fnt; } -
abuse/trunk/src/imlib/include/keys.hpp
r2 r39 43 43 44 44 // returns a value describing a key name 45 int key_value( char *buffer);45 int key_value(char const *buffer); 46 46 47 47 #endif -
abuse/trunk/src/imlib/include/pcxread.hpp
r2 r39 8 8 enum PCX_type { not_PCX, PCX_8, PCX_24 }; 9 9 10 PCX_type PCX_file_type(char *filename);11 image24 *read_PCX24(char *filename);12 image *read_PCX(char *filename, palette *&pal);13 void write_PCX(image *im, palette *pal, char*filename);10 PCX_type PCX_file_type(char const *filename); 11 image24 *read_PCX24(char const *filename); 12 image *read_PCX(char const *filename, palette *&pal); 13 void write_PCX(image *im, palette *pal, char const *filename); 14 14 15 15 #endif -
abuse/trunk/src/imlib/include/pmenu.hpp
r2 r39 11 11 int hotkey; 12 12 public : 13 char *n,*on_off; 13 char *n; 14 char const *on_off; 14 15 psub_menu *sub; 15 16 16 17 int id,xp; 17 18 pmenu_item *next; 18 pmenu_item(int ID, char *name, char*on_off_flag, int Hotkey, pmenu_item *Next);19 pmenu_item(char *Name, psub_menu *Sub, pmenu_item *Next, int xpos=-1);19 pmenu_item(int ID, char const *name, char const *on_off_flag, int Hotkey, pmenu_item *Next); 20 pmenu_item(char const *Name, psub_menu *Sub, pmenu_item *Next, int xpos=-1); 20 21 char *name() { return n; } 21 22 pmenu_item *find_id(int search_id); -
abuse/trunk/src/imlib/include/sound.hpp
r2 r39 28 28 unsigned long song_id; 29 29 public : 30 char *name() { return Name; }31 song(char *filename);30 char const *name() { return Name; } 31 song(char const *filename); 32 32 void play(unsigned char volume=127); 33 33 void stop(long fadeout_time=0); // time in ms -
abuse/trunk/src/imlib/include/specs.hpp
r17 r39 9 9 #include <stdint.h> 10 10 11 extern char *spec_types[];11 extern char const *spec_types[]; 12 12 13 13 #define SPEC_INVALID_TYPE 0 … … 61 61 */ 62 62 63 void set_spec_main_file(char *filename, int search_order=SPEC_SEARCH_OUTSIDE_INSIDE);64 65 void set_filename_prefix(char *prefix);63 void set_spec_main_file(char const *filename, int search_order=SPEC_SEARCH_OUTSIDE_INSIDE); 64 65 void set_filename_prefix(char const *prefix); 66 66 char *get_filename_prefix(); 67 void set_save_filename_prefix(char *prefix);67 void set_save_filename_prefix(char const *prefix); 68 68 char *get_save_filename_prefix(); 69 69 #define JFILE_CLONED 1 … … 78 78 79 79 virtual int unbuffered_read(void *buf, size_t count) = 0; 80 virtual int unbuffered_write(void *buf, size_t count) = 0;80 virtual int unbuffered_write(void const *buf, size_t count) = 0; 81 81 virtual int unbuffered_tell() = 0; 82 82 virtual int unbuffered_seek(long offset, int whence) = 0; // whence=SEEK_SET, SEEK_CUR, … … 87 87 bFILE(); 88 88 virtual int open_failure() = 0; 89 int read(void *buf, size_t count); // returns number of bytes read, calls unbuffer_read90 int write(void *buf, size_t count);// returns number of bytes written91 int seek(long offset, int whence); // whence=SEEK_SET, SEEK_CUR, SEEK_END, ret=0=success89 int read(void *buf, size_t count); // returns number of bytes read, calls unbuffer_read 90 int write(void const *buf, size_t count); // returns number of bytes written 91 int seek(long offset, int whence); // whence=SEEK_SET, SEEK_CUR, SEEK_END, ret=0=success 92 92 int tell(); 93 93 virtual int file_size() = 0; … … 121 121 int get_fd() const { return fd; } 122 122 123 void open_internal(char *filename, char*mode, int flags);124 void open_external(char *filename, char*mode, int flags);125 126 jFILE(char *filename, char*access_string); // same as fopen parameters123 void open_internal(char const *filename, char const *mode, int flags); 124 void open_external(char const *filename, char const *mode, int flags); 125 126 jFILE(char const *filename, char const *access_string); // same as fopen parameters 127 127 jFILE(FILE *file_pointer); // assumes fp is at begining of file 128 128 virtual int open_failure() { return fd<0; } 129 129 virtual int unbuffered_read(void *buf, size_t count); // returns number of bytes read 130 virtual int unbuffered_write(void *buf, size_t count); // returns number of bytes written130 virtual int unbuffered_write(void const *buf, size_t count); // returns number of bytes written 131 131 virtual int unbuffered_seek(long offset, int whence); // whence=SEEK_SET, SEEK_CUR, 132 132 // SEEK_END, ret=0=success … … 144 144 145 145 spec_entry(unsigned char spec_type, 146 char *object_name,147 char *link_filename,146 char const *object_name, 147 char const *link_filename, 148 148 unsigned long data_size, 149 149 unsigned long data_offset) … … 170 170 spec_directory(bFILE *fp); 171 171 spec_directory(); 172 spec_entry *find(char *name);173 spec_entry *find(char *name, int type);172 spec_entry *find(char const *name); 173 spec_entry *find(char const *name, int type); 174 174 spec_entry *find(int type); 175 long find_number(char *name);175 long find_number(char const *name); 176 176 long find_number(int type); 177 177 void remove(spec_entry *e); … … 181 181 long data_end_offset(); // this should be the end of the file 182 182 long type_total(int type); 183 jFILE *write(char *filename);183 jFILE *write(char const *filename); 184 184 int write(bFILE *fp); 185 185 void print(); … … 207 207 208 208 void set_spec_main_file(char *filename, int Search_order); 209 void set_file_opener(bFILE *(*open_fun)(char *, char*));209 void set_file_opener(bFILE *(*open_fun)(char const *, char const *)); 210 210 void set_no_space_handler(void (*handle_fun)()); 211 bFILE *open_file(char *filename, char*mode);211 bFILE *open_file(char const *filename, char const *mode); 212 212 #endif 213 213 -
abuse/trunk/src/imlib/include/status.hpp
r14 r39 8 8 { 9 9 public : 10 virtual void push(char *name, visual_object *show) = 0;10 virtual void push(char const *name, visual_object *show) = 0; 11 11 virtual void update(int percentage) = 0; 12 12 virtual void pop() = 0; … … 24 24 text_status_node *first; 25 25 text_status_manager(); 26 virtual void push(char *name, visual_object *show);26 virtual void push(char const *name, visual_object *show); 27 27 virtual void update(int percentage); 28 28 virtual void pop(); … … 35 35 { 36 36 public : 37 stack_stat(char *st, visual_object *show=NULL) { if (stat_man) stat_man->push(st,show); }37 stack_stat(char const *st, visual_object *show=NULL) { if (stat_man) stat_man->push(st,show); } 38 38 ~stack_stat() { if (stat_man) stat_man->pop(); } 39 39 } ; -
abuse/trunk/src/imlib/include/timage.hpp
r17 r39 23 23 short height() { return h; } 24 24 short width() { return w; } 25 trans_image(image *im, char *name); // name has no meaning if MEM_CHECK is off25 trans_image(image *im, char const *name); // name has no meaning if MEM_CHECK is off 26 26 void put_image(image *screen, int x, int y); // always transparent 27 27 -
abuse/trunk/src/imlib/input.cpp
r4 r39 198 198 199 199 200 button::button(int X, int Y, int ID, char *Text, ifield *Next)200 button::button(int X, int Y, int ID, char const *Text, ifield *Next) 201 201 { 202 202 x=X; y=Y; id=ID; … … 225 225 226 226 227 void text_field::change_data(char *new_data, int new_cursor, // cursor==-1, does not change it.227 void text_field::change_data(char const *new_data, int new_cursor, // cursor==-1, does not change it. 228 228 int active, image *screen, window_manager *wm) 229 229 { … … 317 317 } 318 318 319 text_field::text_field(int X, int Y, int ID, char *Prompt, char *Format,320 char*Data, ifield *Next)319 text_field::text_field(int X, int Y, int ID, char const *Prompt, 320 char const *Format, char const *Data, ifield *Next) 321 321 { 322 322 int slen=(strlen(Format)>strlen(Data) ? strlen(Format) : strlen(Data)); … … 331 331 } 332 332 333 text_field::text_field(int X, int Y, int ID, char *Prompt, char *Format,334 333 text_field::text_field(int X, int Y, int ID, char const *Prompt, 334 char const *Format, double Data, ifield *Next) 335 335 { 336 336 char num[20]; … … 446 446 447 447 448 info_field::info_field(int X, int Y, int ID, char *info, ifield *Next)449 { 450 x =X; y=Y; id=ID; next=Next;451 text =strcpy((char *)jmalloc(strlen(info)+1,"info_field"),info);452 w =-1;448 info_field::info_field(int X, int Y, int ID, char const *info, ifield *Next) 449 { 450 x = X; y = Y; id = ID; next = Next; 451 text = strcpy((char *)jmalloc(strlen(info)+1,"info_field"), info); 452 w = -1; 453 453 } 454 454 … … 478 478 } 479 479 480 void info_field::put_para(image *screen, char *st, int dx, int dy,480 void info_field::put_para(image *screen, char const *st, int dx, int dy, 481 481 int xspace, int yspace, JCFont *font, int color) 482 482 { -
abuse/trunk/src/imlib/jmalloc.cpp
r17 r39 63 63 64 64 void init(void *block, int32_t Block_size, uint8_t type); 65 void *static_alloc(int32_t size, char *name);66 void *cache_alloc(int32_t size, char *name);65 void *static_alloc(int32_t size, char const *name); 66 void *cache_alloc(int32_t size, char const *name); 67 67 void static_free(void *ptr); 68 68 void cache_free(void *ptr); … … 325 325 } 326 326 327 void *block_manager::static_alloc(int32_t size, char *name)327 void *block_manager::static_alloc(int32_t size, char const *name) 328 328 { 329 329 if (size<JM_SMALL_SIZE) … … 405 405 406 406 407 void *block_manager::cache_alloc(int32_t size, char *name)407 void *block_manager::cache_alloc(int32_t size, char const *name) 408 408 { 409 409 if (size<JM_SMALL_SIZE) … … 683 683 684 684 685 int jmalloc_max_size=3072000; 686 int jmalloc_min_low_size=0x1000; 687 char *not_enough_total_memory_message="Memory manager : Sorry you do not have enough memory available to\n" 688 " run this program.\n" 689 " DOS users : Remove any TSR's and device drivers you can.\n" 690 " UNIX users : Do you have a swapfile/partition setup?\n"; 691 char *not_enough_low_memory_message="Memory Manager : Not enough low memory available (%d : need %d)\n" 692 " Suggestions...\n" 693 " - make a boot disk\n" 694 " - remove TSR's & drivers not needed by ABUSE\n" 695 " - add memory to your system\n"; 685 int jmalloc_max_size = 3072000; 686 int jmalloc_min_low_size = 0x1000; 687 static char const *not_enough_total_memory_message = 688 "Memory manager : Sorry you do not have enough memory available to\n" 689 " run this program.\n" 690 " DOS users : Remove any TSR's and device drivers you can.\n" 691 " UNIX users : Do you have a swapfile/partition setup?\n"; 692 static char const *not_enough_low_memory_message = 693 "Memory Manager : Not enough low memory available (%d : need %d)\n" 694 " Suggestions...\n" 695 " - make a boot disk\n" 696 " - remove TSRs & drivers not needed by ABUSE\n" 697 " - add memory to your system\n"; 696 698 697 699 void jmalloc_init(int32_t min_size) … … 784 786 785 787 786 void *jmalloc(int32_t size, char *name)788 void *jmalloc(int32_t size, char const *name) 787 789 { 788 790 if (!bmanage_total) … … 837 839 838 840 839 void *jrealloc(void *ptr, int32_t size, char *name)841 void *jrealloc(void *ptr, int32_t size, char const *name) 840 842 { 841 843 if (!ptr) return jmalloc(size,name); … … 882 884 883 885 884 void mem_report(char *filename)886 void mem_report(char const *filename) 885 887 { 886 888 char *reportpath; -
abuse/trunk/src/imlib/jwindow.cpp
r4 r39 258 258 } 259 259 260 jwindow *window_manager::new_window(int x, int y, int l, int h, ifield *fields, char *Name)260 jwindow *window_manager::new_window(int x, int y, int l, int h, ifield *fields, char const *Name) 261 261 { 262 262 if (x>screen->width()-4) x=screen->width()-25; … … 339 339 } 340 340 341 jwindow::jwindow(int X, int Y, int L, int H, window_manager *wm, ifield *fields, char *Name)341 jwindow::jwindow(int X, int Y, int L, int H, window_manager *wm, ifield *fields, char const *Name) 342 342 { 343 343 ifield *i; -
abuse/trunk/src/imlib/keys.cpp
r4 r39 3 3 #include <ctype.h> 4 4 5 char *jk_key_names[]= {"Up Arrow","Down Arrow","Left Arrow","Right Arrow", 6 "Left Ctrl","Right Ctrl","Left Alt","Right Alt", 7 "Left Shift","Right Shift","Caps Lock","Num Lock", 8 "Home","End","Del","F1","F2","F3","F4","F5","F6", 9 "F7","F8","F9","F10","Insert","PageUp","PageDown","Command"}; 10 5 char const *jk_key_names[]= 6 { 7 "Up Arrow","Down Arrow","Left Arrow","Right Arrow", 8 "Left Ctrl","Right Ctrl","Left Alt","Right Alt", 9 "Left Shift","Right Shift","Caps Lock","Num Lock", 10 "Home","End","Del","F1","F2","F3","F4","F5","F6", 11 "F7","F8","F9","F10","Insert","PageUp","PageDown","Command" 12 }; 11 13 12 14 void key_name(int key, char *buffer) 13 15 { 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 16 //static char sing[2]; 17 if( key > 255 && key <= JK_MAX_KEY ) 18 strcpy(buffer,jk_key_names[key-256]); 19 else if( key == JK_BACKSPACE ) 20 strcpy(buffer,"Backspace"); 21 else if( key == JK_TAB ) 22 strcpy(buffer,"Tab"); 23 else if( key == JK_ENTER ) 24 strcpy(buffer,"Enter"); 25 else if( key == JK_ESC ) 26 strcpy(buffer,"Esc"); 27 else if( key == JK_SPACE ) 28 strcpy( buffer, "Space" ); 29 else if( isprint(key) ) 30 { 31 buffer[0] = key; 32 buffer[1] = 0; 33 } 34 else 35 { 36 buffer[0] = 0; 37 } 36 38 } 37 39 38 int key_value( char *buffer)40 int key_value(char const *buffer) 39 41 { 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 42 if( strcasecmp( buffer, "Backspace" ) == 0 ) 43 return JK_BACKSPACE; 44 if( strcasecmp( buffer, "Tab" ) == 0 ) 45 return JK_TAB; 46 if( strcasecmp( buffer, "Enter" ) == 0 ) 47 return JK_ENTER; 48 if( strcasecmp( buffer, "ESC" ) == 0 ) 49 return JK_ESC; 50 if( strcasecmp( buffer, "Space" ) == 0 ) 51 return JK_SPACE; 52 if( strcasecmp( buffer, "Up" ) == 0 ) 53 return JK_UP; 54 if( strcasecmp( buffer, "Down" ) == 0 ) 55 return JK_DOWN; 56 if( strcasecmp( buffer, "Left" ) == 0 ) 57 return JK_LEFT; 58 if( strcasecmp( buffer, "Right" ) == 0 ) 59 return JK_RIGHT; 60 if( strcasecmp( buffer, "CTRL_L" ) == 0 ) 61 return JK_CTRL_L; 62 if( strcasecmp( buffer, "CTRL_R" ) == 0 ) 63 return JK_CTRL_R; 64 if( strcasecmp( buffer, "ALT_L" ) == 0 ) 65 return JK_ALT_L; 66 if( strcasecmp( buffer, "ALT_R" ) == 0 ) 67 return JK_ALT_R; 68 if( strcasecmp( buffer, "SHIFT_L" ) == 0 ) 69 return JK_SHIFT_L; 70 if( strcasecmp( buffer, "SHIFT_R" ) == 0 ) 71 return JK_SHIFT_R; 72 if( strcasecmp( buffer, "Caps" ) == 0 ) 73 return JK_CAPS; 74 if( strcasecmp( buffer, "Num_Lock" ) == 0 ) 75 return JK_NUM_LOCK; 76 if( strcasecmp( buffer, "Home" ) == 0 ) 77 return JK_HOME; 78 if( strcasecmp( buffer, "End" ) == 0 ) 79 return JK_END; 80 if( strcasecmp( buffer, "Del" ) == 0 ) 81 return JK_DEL; 82 if( strcasecmp( buffer, "F1" ) == 0 ) 83 return JK_F1; 84 if( strcasecmp( buffer, "F2" ) == 0 ) 85 return JK_F2; 86 if( strcasecmp( buffer, "F3" ) == 0 ) 87 return JK_F3; 88 if( strcasecmp( buffer, "F4" ) == 0 ) 89 return JK_F4; 90 if( strcasecmp( buffer, "F5" ) == 0 ) 91 return JK_F5; 92 if( strcasecmp( buffer, "F6" ) == 0 ) 93 return JK_F6; 94 if( strcasecmp( buffer, "F7" ) == 0 ) 95 return JK_F7; 96 if( strcasecmp( buffer, "F8" ) == 0 ) 97 return JK_F8; 98 if( strcasecmp( buffer, "F9" ) == 0 ) 99 return JK_F9; 100 if( strcasecmp( buffer, "F10" ) == 0 ) 101 return JK_F10; 102 if( strcasecmp( buffer, "Insert" ) == 0 ) 103 return JK_INSERT; 104 if( strcasecmp( buffer, "PageUp" ) == 0 ) 105 return JK_PAGEUP; 106 if( strcasecmp( buffer, "PageDown" ) == 0 ) 107 return JK_PAGEDOWN; 106 108 107 108 109 109 // Assume they are asking for a normal key, so convert the first 110 // character to an integer and return that 111 return (int)buffer[0]; 110 112 } 111 113 112 -
abuse/trunk/src/imlib/pcxread.cpp
r17 r39 56 56 57 57 58 PCX_type PCX_file_type(char *filename)58 PCX_type PCX_file_type(char const *filename) 59 59 { 60 60 FILE *fp=fopen(filename,"rb"); … … 108 108 109 109 110 image24 *read_PCX24(char *filename)110 image24 *read_PCX24(char const *filename) 111 111 { 112 112 if (PCX_file_type(filename)!=PCX_24) return NULL; … … 126 126 } 127 127 128 image *read_PCX(char *filename, palette *&pal)128 image *read_PCX(char const *filename, palette *&pal) 129 129 { 130 130 if (PCX_file_type(filename)!=PCX_8) return NULL; … … 152 152 } 153 153 154 void write_PCX(image *im, palette *pal, char *filename)154 void write_PCX(image *im, palette *pal, char const *filename) 155 155 { 156 156 FILE *fp=fopen(filename,"wb"); -
abuse/trunk/src/imlib/pmenu.cpp
r4 r39 45 45 } 46 46 47 pmenu_item::pmenu_item(int ID, char *Name, char*on_off_flag, int Hotkey, pmenu_item *Next)47 pmenu_item::pmenu_item(int ID, char const *Name, char const *on_off_flag, int Hotkey, pmenu_item *Next) 48 48 { 49 49 xp=-1; … … 58 58 } 59 59 60 pmenu_item::pmenu_item(char *Name, psub_menu *Sub, pmenu_item *Next, int xpos)60 pmenu_item::pmenu_item(char const *Name, psub_menu *Sub, pmenu_item *Next, int xpos) 61 61 { 62 62 xp=xpos; -
abuse/trunk/src/imlib/specs.cpp
r17 r39 20 20 #endif 21 21 22 char *spec_types[]={"Invalid type", // 0 23 "Color table", // 1 24 "Palette", // 2 25 "Invalid Type", // 3 26 "Image", // 4 27 "Fore Tile", 28 "Back Tile", 29 "Character", 30 "8 Morph", 31 "16 Morph", 32 "Grue objs", 33 "Extern WAV", 34 "DMX MUS", 35 "Patched morph", 36 "Normal file", 37 "Compress1 file", 38 "Vector Image", 39 "Light list", 40 "Grue fgmap", 41 "Grue bgmap", 42 "Data array", 43 "Character2", 44 "Particle", 45 "Extern lcache" 22 char const *spec_types[] = 23 { 24 "Invalid type", // 0 25 "Color table", // 1 26 "Palette", // 2 27 "Invalid Type", // 3 28 "Image", // 4 29 "Fore Tile", 30 "Back Tile", 31 "Character", 32 "8 Morph", 33 "16 Morph", 34 "Grue objs", 35 "Extern WAV", 36 "DMX MUS", 37 "Patched morph", 38 "Normal file", 39 "Compress1 file", 40 "Vector Image", 41 "Light list", 42 "Grue fgmap", 43 "Grue bgmap", 44 "Data array", 45 "Character2", 46 "Particle", 47 "Extern lcache" 46 48 }; 47 49 … … 61 63 static int fast_load_mode = 0; 62 64 63 void set_filename_prefix(char *prefix)65 void set_filename_prefix(char const *prefix) 64 66 { 65 67 if( spec_prefix ) … … 90 92 91 93 92 void set_save_filename_prefix(char *save_prefix)94 void set_save_filename_prefix(char const *save_prefix) 93 95 { 94 96 if( save_spec_prefix ) … … 197 199 198 200 199 int bFILE::write(void *buf, size_t count) // returns number of bytes written201 int bFILE::write(void const *buf, size_t count) // returns number of bytes written 200 202 { 201 203 if (allow_write_buffering()) … … 263 265 } 264 266 265 void set_spec_main_file(char *filename, int Search_order)267 void set_spec_main_file(char const *filename, int Search_order) 266 268 { 267 269 dprintf("Specs : main file set to %s\n",filename); … … 319 321 } 320 322 321 void jFILE::open_external(char *filename, char*mode, int flags)323 void jFILE::open_external(char const *filename, char const *mode, int flags) 322 324 { 323 325 int skip_size=0; … … 376 378 virtual int open_failure() { return 1; } 377 379 virtual int unbuffered_read(void *buf, size_t count) { return 0; } 378 virtual int unbuffered_write(void *buf, size_t count) { return 0; }380 virtual int unbuffered_write(void const *buf, size_t count) { return 0; } 379 381 virtual int unbuffered_seek(long offset, int whence) { return 0; } 380 382 … … 385 387 386 388 387 static bFILE *(*open_file_fun)(char *,char*)=NULL;388 int (*verify_file_fun)(char *,char*)=NULL;389 390 void set_file_opener(bFILE *(*open_fun)(char *, char*))389 static bFILE *(*open_file_fun)(char const *,char const *)=NULL; 390 int (*verify_file_fun)(char const *,char const *)=NULL; 391 392 void set_file_opener(bFILE *(*open_fun)(char const *, char const *)) 391 393 { 392 394 open_file_fun=open_fun; 393 395 } 394 396 395 bFILE *open_file(char *filename, char*mode)397 bFILE *open_file(char const *filename, char const *mode) 396 398 { 397 399 if (!verify_file_fun || verify_file_fun(filename,mode)) … … 403 405 } 404 406 405 void jFILE::open_internal(char *filename, char*mode, int flags)407 void jFILE::open_internal(char const *filename, char const *mode, int flags) 406 408 { 407 409 int wr=0; 408 for (char *s=mode;*s;s++)410 for (char const *s=mode;*s;s++) 409 411 if (toupper(*s)=='A' || toupper(*s)=='W') 410 412 wr=1; … … 434 436 } 435 437 436 jFILE::jFILE(char *filename, char*access_string) // same as fopen parameters438 jFILE::jFILE(char const *filename, char const *access_string) // same as fopen parameters 437 439 { 438 440 flags=access=0; 439 char *s=access_string;441 char const *s=access_string; 440 442 for (;*s;s++) 441 443 if (toupper(*s)=='R') access=O_RDONLY; … … 540 542 } 541 543 542 int jFILE::unbuffered_write(void *buf, size_t count)544 int jFILE::unbuffered_write(void const *buf, size_t count) 543 545 { 544 546 long ret = ::write(fd,(char*)buf,count); … … 684 686 } 685 687 686 spec_entry *spec_directory::find(char *name, int type)688 spec_entry *spec_directory::find(char const *name, int type) 687 689 { 688 690 int i; … … 694 696 } 695 697 696 spec_entry *spec_directory::find(char *name)698 spec_entry *spec_directory::find(char const *name) 697 699 { 698 700 int i; … … 704 706 } 705 707 706 long spec_directory::find_number(char *name)708 long spec_directory::find_number(char const *name) 707 709 { 708 710 int i; … … 842 844 }*/ 843 845 844 int write_string(bFILE *fp, char *st)846 int write_string(bFILE *fp, char const *st) 845 847 { 846 848 unsigned char length=strlen(st)+1; … … 900 902 } 901 903 902 jFILE *spec_directory::write(char *filename)904 jFILE *spec_directory::write(char const *filename) 903 905 { 904 906 jFILE *fp; … … 1005 1007 1006 1008 1007 void note_open_fd(int fd, char *str)1009 void note_open_fd(int fd, char const *str) 1008 1010 { 1009 1011 total_files_open++; -
abuse/trunk/src/imlib/status.cpp
r2 r39 12 12 visual_object *show; 13 13 int last_update; 14 text_status_node(char *Name, visual_object *Show, text_status_node *Next)14 text_status_node(char const *Name, visual_object *Show, text_status_node *Next) 15 15 { name=strcpy((char *)jmalloc(strlen(Name)+1,"status name"),Name); 16 16 show=Show; … … 29 29 } 30 30 31 void text_status_manager::push(char *name, visual_object *show)31 void text_status_manager::push(char const *name, visual_object *show) 32 32 { 33 33 level++; -
abuse/trunk/src/imlib/timage.cpp
r17 r39 51 51 } 52 52 53 trans_image::trans_image(image *im, char *name)53 trans_image::trans_image(image *im, char const *name) 54 54 { 55 55 int size=0,x,y;
Note: See TracChangeset
for help on using the changeset viewer.