Changeset 39 for abuse/trunk
- Timestamp:
- Mar 2, 2008, 12:29:06 AM (15 years ago)
- Location:
- abuse/trunk/src
- Files:
-
- 97 edited
Legend:
- Unmodified
- Added
- Removed
-
abuse/trunk/src/ability.cpp
r2 r39 18 18 19 19 20 char *ability_names[TOTAL_ABILITIES]= 21 {"start_hp","start_accel","stop_accel", 22 "jump_xvel","jump_yvel", 23 "run_top_speed","jump_top_speed", 20 char const *ability_names[TOTAL_ABILITIES] = 21 { 22 "start_hp", "start_accel", "stop_accel", 23 "jump_xvel", "jump_yvel", 24 "run_top_speed", "jump_top_speed", 24 25 "tint_color", 25 26 "push_xrange", 26 "walk_top_speed"}; 27 "walk_top_speed" 28 }; 27 29 28 30 -
abuse/trunk/src/cache.cpp
r17 r39 11 11 #include "status.hpp" 12 12 #include "crc.hpp" 13 #include "dev.hpp" 13 14 #include "specache.hpp" 14 15 … … 23 24 if ((x)->last_access<0) { normalize(); (x)->last_access=1; } } 24 25 25 extern char *symbol_str(char *name);26 27 26 crc_manager crc_man; 28 27 29 28 int past_startup=0; 30 29 31 int crc_man_write_crc_file(char *filename)30 int crc_man_write_crc_file(char const *filename) 32 31 { 33 32 return crc_man.write_crc_file(filename); 34 33 } 35 34 36 int crc_manager::write_crc_file(char *filename) // return 0 on failure35 int crc_manager::write_crc_file(char const *filename) // return 0 on failure 37 36 { 38 37 char msg[100]; … … 87 86 } 88 87 89 int crc_manager::load_crc_file(char *filename)88 int crc_manager::load_crc_file(char const *filename) 90 89 { 91 90 bFILE *fp=open_file(filename,"rb"); … … 126 125 } 127 126 128 crced_file::crced_file(char *name)127 crced_file::crced_file(char const *name) 129 128 { 130 129 filename=strcpy((char *)jmalloc(strlen(name)+1,"crc_file"),name); … … 138 137 } 139 138 140 int crc_manager::get_filenumber(char *filename)139 int crc_manager::get_filenumber(char const *filename) 141 140 { 142 141 for (int i=0;i<total_files;i++) … … 660 659 } 661 660 662 FILE *open_FILE(char *filename, char *mode);663 661 extern char *macify_name(char *s); 664 662 … … 668 666 char *prefix="c:\\"; 669 667 #else 670 char *prefix="/tmp/"; // for UNIX store lisp cache in tmp dir671 int flags =O_CREAT | O_RDWR;668 char const *prefix = "/tmp/"; // for UNIX store lisp cache in tmp dir 669 int flags = O_CREAT | O_RDWR; 672 670 #endif 673 671 … … 898 896 } 899 897 900 int32_t cache_list::reg_object(char *filename, void *object, int type, int rm_dups)898 int32_t cache_list::reg_object(char const *filename, void *object, int type, int rm_dups) 901 899 { 902 900 char *name; … … 912 910 extern int total_files_open; 913 911 914 int32_t cache_list::reg(char *filename, char*name, int type, int rm_dups)912 int32_t cache_list::reg(char const *filename, char const *name, int type, int rm_dups) 915 913 { 916 914 int id=alloc_id(),i,fn=crc_man.get_filenumber(filename); -
abuse/trunk/src/chars.cpp
r4 r39 20 20 int *weapon_types=NULL; // maps 0..total_weapons into 'real' weapon type 21 21 22 char *state_names[MAX_STATE]= { 23 "dead", 24 "dieing", 25 "stopped", 26 "start_run_jump","run_jump","run_jump_fall","end_run_jump", 27 "flinch_up","flinch_down", 28 "morph_pose", 29 "running" }; 22 char const *state_names[MAX_STATE] = 23 { 24 "dead", 25 "dieing", 26 "stopped", 27 "start_run_jump", "run_jump", "run_jump_fall", "end_run_jump", 28 "flinch_up", "flinch_down", 29 "morph_pose", 30 "running" 31 }; 30 32 31 33 /* "start_still_jump","still_jump","still_jump_fall","end_still_jump", … … 53 55 54 56 55 char *cflag_names[TOTAL_CFLAGS]={"hurt_all","is_weapon","stoppable","can_block", 56 "hurtable","pushable","unlistable", 57 "add_front","cached_in","need_cache_in","unactive_shield"}; 58 char *ofun_names[TOTAL_OFUNS]={"ai_fun","move_fun","draw_fun","map_draw_fun","damage_fun", 59 "next_state_fun","user_fun", 60 "constructor","reload_fun","get_cache_list_fun", 61 "type_change_fun"}; 57 char const *cflag_names[TOTAL_CFLAGS] = 58 { 59 "hurt_all", "is_weapon", "stoppable", "can_block", 60 "hurtable", "pushable", "unlistable", 61 "add_front", "cached_in", "need_cache_in", "unactive_shield" 62 }; 63 64 char const *ofun_names[TOTAL_OFUNS] = 65 { 66 "ai_fun", "move_fun", "draw_fun", "map_draw_fun", "damage_fun", 67 "next_state_fun", "user_fun", 68 "constructor", "reload_fun", "get_cache_list_fun", 69 "type_change_fun" 70 }; 62 71 63 72 int character_type::add_state(void *symbol) // returns index into seq to use -
abuse/trunk/src/chat.cpp
r2 r39 1 1 #include "chat.hpp" 2 3 extern char *symbol_str(char *name); 2 #include "dev.hpp" 4 3 5 4 chat_console::chat_console(window_manager *WM, JCFont *font, int width, int height) : -
abuse/trunk/src/clisp.cpp
r17 r39 68 68 extern int registered; 69 69 70 view *lget_view(void *arg, char*msg)70 static view *lget_view(void *arg, char const *msg) 71 71 { 72 72 game_object *o=(game_object *)lpointer_value(arg); … … 81 81 } 82 82 83 extern int get_option(char *name);84 extern void set_login(char *name);83 extern int get_option(char const *name); 84 extern void set_login(char const *name); 85 85 86 86 void clisp_init() // call by lisp_init, defines symbols and functions -
abuse/trunk/src/compiled.cpp
r17 r39 28 28 int compile_error=0; 29 29 30 int32_t c_state(char*name)30 static int32_t c_state(char const *name) 31 31 { 32 32 void *sym=find_symbol(name); -
abuse/trunk/src/config.cpp
r2 r39 7 7 #include "game.hpp" 8 8 9 extern int get_key_binding( char *dir, int i);9 extern int get_key_binding(char const *dir, int i); 10 10 11 11 extern window_manager *eh; … … 37 37 38 38 /* 39 int get_key_binding(char *dir, int i)39 int get_key_binding(char const *dir, int i) 40 40 { 41 41 char tmp[100], kn[50]; … … 220 220 // Returns -1 for an invalid key code 221 221 // 222 int get_keycode( char *str)222 int get_keycode(char const *str) 223 223 { 224 224 if( !str[0] ) -
abuse/trunk/src/console.cpp
r2 r39 7 7 extern window_manager *eh; 8 8 9 void console::put_string(char *st)9 void console::put_string(char const *st) 10 10 { 11 11 while (*st) … … 63 63 } 64 64 65 console::console(window_manager *WM, JCFont *font, int width, int height, char *Name)65 console::console(window_manager *WM, JCFont *font, int width, int height, char const *Name) 66 66 { 67 67 wm=WM; … … 161 161 162 162 163 shell_term::shell_term(window_manager *WM, JCFont *font, int width, int height, char *Name) :163 shell_term::shell_term(window_manager *WM, JCFont *font, int width, int height, char const *Name) : 164 164 console(WM,font,width,height,Name) 165 165 { … … 173 173 } 174 174 175 void shell_term::execute(char *st)175 void shell_term::execute(char const *st) 176 176 { 177 177 put_string(st); -
abuse/trunk/src/cop.cpp
r17 r39 8 8 #include "clisp.hpp" 9 9 #include "ant.hpp" 10 #include "dev.hpp" 10 11 11 12 enum { point_angle, fire_delay1 }; … … 120 121 return 0; 121 122 } 122 123 extern char *symbol_str(char *name);124 123 125 124 void *top_ai() … … 1048 1047 1049 1048 int y=(y1+y2)/2-(tp+2)*fnt->height()/2,x=x1+10; 1050 char *header_str=symbol_str("score_header");1049 char const *header_str = symbol_str("score_header"); 1051 1050 fnt->put_string(screen,x,y,header_str,eh->bright_color()); 1052 1051 y+=fnt->height(); -
abuse/trunk/src/dev.cpp
r17 r39 1 #include <ctype.h> 2 1 3 #include "dev.hpp" 2 4 #include "input.hpp" … … 19 21 #include "compiled.hpp" 20 22 #include "chat.hpp" 21 #include <ctype.h>22 23 23 24 #define make_above_tile(x) ((x)|0x4000) … … 28 29 raise_all; 29 30 30 char *symbol_str(char*name)31 char const *symbol_str(char const *name) 31 32 { 32 33 void *sym=make_find_symbol(name); … … 41 42 42 43 char prog[50]; 43 char *cs=prog;44 char const *cs=prog; 44 45 strcpy(prog,"(setq section 'game_section)\n"); 45 46 eval(compile(cs)); … … 109 110 dev_forward,dev_backward; 110 111 111 char *dev_mode_icon_names[DEV_MODES]={"pixel_mode","pick_mode", /* "fill_mode", 112 "line_mode","rect_mode","bar_mode", */ "area_select"}; 112 char const *dev_mode_icon_names[DEV_MODES] = 113 { 114 "pixel_mode", "pick_mode", /* "fill_mode", 115 "line_mode","rect_mode","bar_mode", */ "area_select" 116 }; 113 117 114 118 int dev_mode_ids[DEV_MODES]={ID_DMODE_DRAW,ID_DMODE_PICK, ID_DMODE_AREA}; … … 317 321 void load_dev_icons() 318 322 { 319 char *artf="art/dev.spe";323 char const *artf="art/dev.spe"; 320 324 dev_del=cash.reg(artf,"dev_del",SPEC_IMAGE,0); 321 325 dev_move=cash.reg(artf,"dev_move",SPEC_IMAGE,0); … … 824 828 825 829 826 int get_option(char *name);830 int get_option(char const *name); 827 831 828 832 … … 970 974 if (dev & EDIT_MODE) 971 975 { 972 char prog[100],*cs; 976 char prog[100]; 977 char const *cs; 973 978 strcpy(prog,"(compile-file \"edit.lsp\")"); 974 979 cs=prog; … … 983 988 } 984 989 985 void dev_controll::do_command(char *command, event &ev) 986 { 987 char fword[50],*st; 990 void dev_controll::do_command(char const *command, event &ev) 991 { 992 char fword[50]; 993 char const *st; 988 994 int l,h,x,y,i; 989 995 if (command[0]=='(') // is this a lisp command? … … 2055 2061 if (!mess_win) 2056 2062 { 2057 mess_win=file_dialog(eh,symbol_str("level_name"),current_level ? current_level->name() : (char *)"",2063 mess_win=file_dialog(eh,symbol_str("level_name"),current_level ? current_level->name() : "", 2058 2064 ID_LEVEL_LOAD_OK,symbol_str("ok_button"),ID_CANCEL,symbol_str("cancel_button"), 2059 2065 symbol_str("FILENAME"),ID_MESS_STR1); … … 2326 2332 atoi(mess_win->read(ID_MESS_STR1)), 2327 2333 atoi(mess_win->read(ID_MESS_STR2))); 2328 char *s=name;2334 char const *s=name; 2329 2335 eval(compile(s)); 2330 2336 eh->push_event(new event(ID_CANCEL,NULL)); // close window … … 3218 3224 3219 3225 } 3220 3221 FILE *open_FILE(char *filename, char *mode);3222 3226 3223 3227 void dev_controll::save() … … 3370 3374 } 3371 3375 3372 void dev_controll::show_char_mem(char *name)3376 void dev_controll::show_char_mem(char const *name) 3373 3377 { 3374 3378 int find=-1; … … 3446 3450 struct pmi 3447 3451 { 3448 char *name;3452 char const *name; 3449 3453 int id; 3450 char *on_off;3454 char const *on_off; 3451 3455 int key; 3452 3456 } ; -
abuse/trunk/src/director.cpp
r17 r39 25 25 26 26 27 int text_draw(int y, int x1, int y1, int x2, int y2, char *buf, JCFont *font, uint8_t *cmap, char color)27 int text_draw(int y, int x1, int y1, int x2, int y2, char const *buf, JCFont *font, uint8_t *cmap, char color) 28 28 { 29 29 short cx1,cy1,cx2,cy2,word_size,word_len; … … 32 32 int h=font->height()+2,w=font->width(),x=x1,dist; 33 33 y+=y1; 34 char *word_start;34 char const *word_start; 35 35 36 36 while (buf && *buf) -
abuse/trunk/src/endgame.cpp
r17 r39 26 26 27 27 28 int text_draw(int y, int x1, int y1, int x2, int y2, char*buf, JCFont *font, uint8_t *cmap, char color);28 extern int text_draw(int y, int x1, int y1, int x2, int y2, char const *buf, JCFont *font, uint8_t *cmap, char color); 29 29 30 30 mask_line *make_mask_lines(image *mask, int map_width) -
abuse/trunk/src/game.cpp
r17 r39 83 83 tcpip_protocol tcpip; 84 84 85 FILE *open_FILE(char *filename, char*mode)85 FILE *open_FILE(char const *filename, char const *mode) 86 86 { 87 87 /* char *prefix=get_filename_prefix() ? get_filename_prefix() : "",*c; … … 109 109 void handle_no_space() 110 110 { 111 char *no_space_msg= "\nYou are out of disk space or the game\n" 112 "was unable to write to disk for some reason\n" 113 "The game cannot continue, please check this out\n" 114 "and try again.\n"; 111 char const *no_space_msg = 112 "\nYou are out of disk space or the game\n" 113 "was unable to write to disk for some reason\n" 114 "The game cannot continue, please check this out\n" 115 "and try again.\n"; 115 116 if (eh) 116 117 { … … 188 189 } 189 190 190 int get_option( char *name)191 int get_option(char const *name) 191 192 { 192 193 int i; … … 505 506 506 507 507 void game::show_help(char *st)508 void game::show_help(char const *st) 508 509 { 509 510 strcpy(help_text,st); … … 526 527 } 527 528 528 void game::load_level(char *name)529 void game::load_level(char const *name) 529 530 { 530 531 if (current_level) … … 1248 1249 } 1249 1250 1250 int text_draw(int y, int x1, int y1, int x2, int y2, char *buf, JCFont *font, uint8_t *cmap, char color);1251 int text_draw(int y, int x1, int y1, int x2, int y2, char const *buf, JCFont *font, uint8_t *cmap, char color); 1251 1252 1252 1253 void do_title() … … 2224 2225 if( scene_mode ) 2225 2226 { 2226 char *helpstr = "ARROW KEYS CHANGE TEXT SPEED";2227 char const *helpstr = "ARROW KEYS CHANGE TEXT SPEED"; 2227 2228 eh->font()->put_string(screen,screen->width()/2-(eh->font()->width()*strlen(helpstr))/2+1, 2228 2229 screen->height()-eh->font()->height()-5+1,helpstr,eh->dark_color()); … … 2370 2371 { 2371 2372 lisp_init(0xf000,0x30000); 2372 char *prog="(load \"lisp/upgrade.lsp\")",*cs;2373 c s=prog;2373 char const *prog="(load \"lisp/upgrade.lsp\")"; 2374 char const *cs = prog; 2374 2375 if (!eval(compile(cs))) 2375 2376 printf("file does not exists : lisp/upgrade.lsp, cannot upgrade\n"); … … 2386 2387 { 2387 2388 lisp_init(0xf000,0x30000); 2388 char *eof_char = "CTRL-D";2389 char const *eof_char = "CTRL-D"; 2389 2390 fprintf(stderr, 2390 2391 " CLIVE (C) 1995 Jonathan Clark, all rights reserved\n" … … 2395 2396 { 2396 2397 fprintf(stderr,"Lisp> "); 2397 char *l =get_line(0);2398 char *s=l;2398 char *l = get_line(0); 2399 char const *s = l; 2399 2400 while (*s) 2400 2401 { -
abuse/trunk/src/gamma.cpp
r17 r39 1 #include <math.h> 2 1 3 #include "jwindow.hpp" 2 4 #include "lisp.hpp" 5 #include "game.hpp" 3 6 #include "scroller.hpp" 4 7 #include "id.hpp" … … 7 10 #include "dprint.hpp" 8 11 #include "loader2.hpp" 9 #include <math.h>10 12 11 13 extern window_manager *eh; … … 44 46 45 47 46 FILE *open_FILE( char *filename, char *mode );47 48 48 void gamma_correct(palette *&pal, int force_menu) 49 49 { -
abuse/trunk/src/gui.cpp
r2 r39 1 1 #include "cache.hpp" 2 2 #include "gui.hpp" 3 #include "dev.hpp" 3 4 #include "loader2.hpp" 4 5 extern char *symbol_str(char *name);6 5 7 6 void ico_button::set_act_id(int id) … … 128 127 } 129 128 130 ico_button::ico_button(int X, int Y, int ID, int Up, int down, int upa, int downa, ifield *Next, int act_id, char *help_key)129 ico_button::ico_button(int X, int Y, int ID, int Up, int down, int upa, int downa, ifield *Next, int act_id, char const *help_key) 131 130 { 132 131 if (help_key) -
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; -
abuse/trunk/src/include/ability.hpp
r2 r39 17 17 18 18 #define TOTAL_ABILITIES (walk_top_speed+1) 19 extern char *ability_names[TOTAL_ABILITIES];19 extern char const *ability_names[TOTAL_ABILITIES]; 20 20 long get_ability(int who, ability a); 21 21 long get_ability_default(ability a); -
abuse/trunk/src/include/cache.hpp
r17 r39 37 37 uint32_t crc; 38 38 char *filename; 39 crced_file(char *name);39 crced_file(char const *name); 40 40 ~crced_file(); 41 41 } ; … … 47 47 public : 48 48 crc_manager(); 49 int get_filenumber(char *filename);49 int get_filenumber(char const *filename); 50 50 uint32_t get_crc(int32_t filenumber, int &failed); 51 51 void set_crc(int32_t filenumber, uint32_t crc); … … 53 53 void clean_up(); 54 54 int total_filenames() { return total_files; } 55 int write_crc_file(char *filename);56 int load_crc_file(char *filename);55 int write_crc_file(char const *filename); 56 int load_crc_file(char const *filename); 57 57 } ; 58 58 … … 87 87 int in_use() { if (used) { used=0; return 1; } else return 0; } 88 88 int full() { if (ful) { ful=0; return 1; } else return 0; } 89 int32_t reg_object(char *filename, void *object, int type, int rm_dups); // lisp object90 int32_t reg(char *filename, char*name, int type=-1, int rm_dups=0); // returns id to item89 int32_t reg_object(char const *filename, void *object, int type, int rm_dups); // lisp object 90 int32_t reg(char const *filename, char const *name, int type=-1, int rm_dups=0); // returns id to item 91 91 int32_t reg_lisp_block(Cell *block); 92 92 int loaded(int id); -
abuse/trunk/src/include/chars.hpp
r2 r39 24 24 25 25 #define MAX_STATE (running+1) 26 extern char *state_names[];26 extern char const *state_names[]; 27 27 28 28 class named_field … … 55 55 // then objects will not draw a damage when hitting it 56 56 }; 57 extern char *cflag_names[TOTAL_CFLAGS];57 extern char const *cflag_names[TOTAL_CFLAGS]; 58 58 59 59 // all object functions default to NULL … … 71 71 OFUN_CHANGE_TYPE 72 72 } ; 73 extern char *ofun_names[TOTAL_OFUNS];73 extern char const *ofun_names[TOTAL_OFUNS]; 74 74 75 75 -
abuse/trunk/src/include/config.hpp
r2 r39 12 12 void get_movement(int player, int &x, int &y, int &b1, int &b2, int &b3, int &b4); 13 13 void config_cleanup(); // free any memory allocated 14 int get_keycode(char *str); // -1 means not a valid key code14 int get_keycode(char const *str); // -1 means not a valid key code 15 15 16 16 #endif -
abuse/trunk/src/include/console.hpp
r2 r39 14 14 public : 15 15 16 console(window_manager *WM, JCFont *font, int width, int height, char *Name);16 console(window_manager *WM, JCFont *font, int width, int height, char const *Name); 17 17 int showing() { return con_win!=NULL; } 18 18 void show(); … … 26 26 int wy() { return con_win->y1(); } 27 27 void draw_cursor(); 28 void put_string(char *st);28 void put_string(char const *st); 29 29 void draw_char(int x, int y, char ch); 30 30 void toggle() { if (con_win) hide(); else show(); } 31 void print_f(c onst char*format, ...);31 void print_f(char const *format, ...); 32 32 ~console(); 33 33 } ; … … 37 37 char shcmd[300]; 38 38 public : 39 shell_term(window_manager *WM, JCFont *font, int width, int height, char *Name);39 shell_term(window_manager *WM, JCFont *font, int width, int height, char const *Name); 40 40 virtual ~shell_term() {}; 41 41 int handle_event(event &ev, window_manager *wm); 42 42 virtual void prompt(); 43 virtual void execute(char *st);43 virtual void execute(char const *st); 44 44 } ; 45 45 -
abuse/trunk/src/include/dev.hpp
r16 r39 15 15 void dev_cleanup(); 16 16 void toggle_edit_mode(); 17 char *symbol_str(char*name);17 char const *symbol_str(char const *name); 18 18 19 19 class pal_win … … 85 85 void toggle_light_window(); 86 86 void toggle_search_window(); 87 void show_char_mem(char *name);87 void show_char_mem(char const *name); 88 88 void close_oedit_window(); 89 89 void show_mem(); 90 90 dev_controll(); 91 91 void handle_event(event &ev); 92 void do_command(char *st, event &ev);92 void do_command(char const *st, event &ev); 93 93 int is_pal_win(jwindow *win); 94 94 void dev_draw(view *v); -
abuse/trunk/src/include/extend.hpp
r17 r39 41 41 morph_char *mc; 42 42 int total_vars(); 43 char *var_name(int x);44 int 43 char const *var_name(int x); 44 int var_type(int x); 45 45 void set_var(int x, uint32_t v); 46 46 int32_t get_var(int x); -
abuse/trunk/src/include/game.hpp
r17 r39 50 50 extern int demo_start,idle_ticks; 51 51 52 extern FILE *open_FILE(char const *filename, char const *mode); 53 52 54 class game 53 55 { … … 80 82 game(int argc, char **argv); 81 83 void step(); 82 void show_help(char *st);84 void show_help(char const *st); 83 85 void draw_value(image *screen, int x, int y, int w, int h, int val, int max); 84 86 unsigned char get_color(int x) { return x; } … … 120 122 121 123 int in_area(event &ev, int x1, int y1, int x2, int y2); 122 void load_level(char *name);124 void load_level(char const *name); 123 125 void set_level(level *nl); 124 126 void show_time(); -
abuse/trunk/src/include/gui.hpp
r2 r39 10 10 char key[16]; 11 11 public : 12 ico_button(int X, int Y, int ID, int Up, int down, int upa, int downa, ifield *Next, int act_id=-1, char *help_key=NULL);12 ico_button(int X, int Y, int ID, int Up, int down, int upa, int downa, ifield *Next, int act_id=-1, char const *help_key=NULL); 13 13 14 14 virtual void area(int &x1, int &y1, int &x2, int &y2, window_manager *wm); -
abuse/trunk/src/include/items.hpp
r17 r39 14 14 { 15 15 public : 16 boundary(bFILE *fp,char *er_name);16 boundary(bFILE *fp,char const *er_name); 17 17 uint8_t *inside; // tells which side of the line is on the inside 18 18 boundary(boundary *p); // flips the *inside list -
abuse/trunk/src/include/language.hpp
r2 r39 1 char *lang_string(char*symbol);1 char const *lang_string(char const *symbol); -
abuse/trunk/src/include/level.hpp
r17 r39 85 85 uint16_t background_height() { return bg_height; } 86 86 int load_failed() { return map_fg==NULL; } 87 level(spec_directory *sd, bFILE *fp, char *lev_name);87 level(spec_directory *sd, bFILE *fp, char const *lev_name); 88 88 void load_fail(); 89 level(int width, int height, char *name);90 int save(char *filename, int save_all); // save_all includes player and view information (1 = success)91 void set_name(char *name) { Name=strcpy((char *)jrealloc(Name,strlen(name)+1,"map name"),name); }89 level(int width, int height, char const *name); 90 int save(char const *filename, int save_all); // save_all includes player and view information (1 = success) 91 void set_name(char const *name) { Name=strcpy((char *)jrealloc(Name,strlen(name)+1,"map name"),name); } 92 92 void set_size(int w, int h); 93 93 void remove_light(light_source *which); -
abuse/trunk/src/include/light.hpp
r17 r39 55 55 int32_t inner, int32_t outer, int32_t xshift, int32_t yshift); 56 56 57 void add_light_spec(spec_directory *sd, char *level_name);57 void add_light_spec(spec_directory *sd, char const *level_name); 58 58 void write_lights(bFILE *fp); 59 void read_lights(spec_directory *sd, bFILE *fp, char *level_name);59 void read_lights(spec_directory *sd, bFILE *fp, char const *level_name); 60 60 61 61 -
abuse/trunk/src/include/lisp.hpp
r19 r39 139 139 void *lisp_eq(void *n1, void *n2); 140 140 void *lisp_equal(void *n1, void *n2); 141 lisp_symbol *find_symbol(char *name);141 lisp_symbol *find_symbol(char const *name); 142 142 long list_length(void *i); 143 143 void lprint(void *i); … … 146 146 void *eval_function(lisp_symbol *sym, void *arg_list); 147 147 void *eval_user_fun(lisp_symbol *sym, void *arg_list); 148 void *compile(char *&s);148 void *compile(char const *&s); 149 149 void *symbol_value(void *symbol); 150 150 void *symbol_function(void *symbol); … … 155 155 void resize_tmp(int new_size); 156 156 void resize_perm(int new_size); 157 lisp_symbol *make_find_symbol(char *name);157 lisp_symbol *make_find_symbol(char const *name); 158 158 159 159 void push_onto_list(void *object, void *&list); 160 160 lisp_symbol *add_c_object(void *symbol, int16_t number); 161 lisp_symbol *add_c_function(char *name, short min_args, short max_args, short number);162 lisp_symbol *add_c_bool_fun(char *name, short min_args, short max_args, short number);163 lisp_symbol *add_lisp_function(char *name, short min_args, short max_args, short number);161 lisp_symbol *add_c_function(char const *name, short min_args, short max_args, short number); 162 lisp_symbol *add_c_bool_fun(char const *name, short min_args, short max_args, short number); 163 lisp_symbol *add_lisp_function(char const *name, short min_args, short max_args, short number); 164 164 int read_ltoken(char *&s, char *buffer); 165 165 cons_cell *new_cons_cell(); … … 170 170 lisp_pointer *new_lisp_pointer(void *addr); 171 171 lisp_character *new_lisp_character(uint16_t ch); 172 lisp_string *new_lisp_string(char *string);173 lisp_string *new_lisp_string(char *string, int length);172 lisp_string *new_lisp_string(char const *string); 173 lisp_string *new_lisp_string(char const *string, int length); 174 174 lisp_string *new_lisp_string(int length); 175 175 lisp_fixed_point *new_lisp_fixed_point(int32_t x); -
abuse/trunk/src/include/lisp2.hpp
r2 r39 82 82 void lisp_init (long a, long b); 83 83 void lisp_uninit (void); 84 char * lstring_value (void* x);84 char * lstring_value (void* x); 85 85 long lnumber_value (void* x); 86 86 char lcharacter_value (void* x); -
abuse/trunk/src/include/loadgame.hpp
r2 r39 3 3 4 4 int show_load_icon(); 5 int load_game(int show_all, char *title);5 int load_game(int show_all, char const *title); 6 6 void get_savegame_name(char *buf); // buf should be at least 50 bytes 7 7 void last_savegame_name(char *buf); -
abuse/trunk/src/include/netcfg.hpp
r2 r39 24 24 net_configuration(); 25 25 int input(); // pulls up dialog box and input fileds 26 void cfg_error(char *msg);26 void cfg_error(char const *msg); 27 27 int confirm_inputs(jwindow *j, int server); 28 void error(char *message);28 void error(char const *message); 29 29 int confirm_inputs(input_manager *i, int server); 30 30 ifield *center_ifield(ifield *i,int x1, int x2, ifield *place_below); -
abuse/trunk/src/include/nfserver.hpp
r2 r39 15 15 16 16 int net_start(); 17 bFILE *open_nfs_file(char *filename,char*mode);17 bFILE *open_nfs_file(char const *filename, char const *mode); 18 18 19 19 int net_init(int argc, char **argv); 20 int NF_open_file(char *filename, char*mode);20 int NF_open_file(char const *filename, char const *mode); 21 21 long NF_close(int fd); 22 22 long NF_read(int fd, void *buf, long size); … … 30 30 void net_reload(); 31 31 void read_new_views(); 32 int set_file_server(char *name);32 int set_file_server(char const *name); 33 33 int set_file_server(net_address *addr); 34 34 -
abuse/trunk/src/include/objects.hpp
r18 r39 37 37 38 38 #define TOTAL_OBJECT_VARS 28 39 struct obj_desc { char *name; int type; } ;39 struct obj_desc { char const *name; int type; } ; 40 40 extern obj_desc object_descriptions[TOTAL_OBJECT_VARS]; 41 41 int RC_type_size(int type); -
abuse/trunk/src/include/property.hpp
r2 r39 6 6 { 7 7 property *first; 8 property *find(char *name);8 property *find(char const *name); 9 9 public : 10 10 property_manager() { first=0; } 11 void load(char *filename);12 void save(char *filename);11 void load(char const *filename); 12 void save(char const *filename); 13 13 14 int getd(char *name, int def) { return (int)get(name,def); }15 int get(char *name, int def);16 char *get(char *name, char*def);14 int getd(char const *name, int def) { return (int)get(name,def); } 15 int get(char const *name, int def); 16 char const *get(char const *name, char const *def); 17 17 18 void setd(char *name, int def) { set(name,def); }19 void set(char *name, double def);20 void set(char *name, char*def);18 void setd(char const *name, int def) { set(name,def); } 19 void set(char const *name, double def); 20 void set(char const *name, char const *def); 21 21 ~property_manager(); 22 22 } ; -
abuse/trunk/src/include/specache.hpp
r2 r39 14 14 spec_directory *sd; 15 15 char *filename() { return fn; } 16 filename_node(char *filename, spec_directory *dir)16 filename_node(char const *filename, spec_directory *dir) 17 17 { 18 18 fn=(char *)memcpy(jmalloc(strlen(filename)+1,"spec_dir cache"),filename,strlen(filename)+1); … … 25 25 long size; 26 26 public : 27 spec_directory *get_spec_directory(char *filename, bFILE *fp=NULL);27 spec_directory *get_spec_directory(char const *filename, bFILE *fp=NULL); 28 28 spec_directory_cache() { fn_root=0; size=0; } 29 29 void clear(); // frees up all allocated memory -
abuse/trunk/src/include/view.hpp
r17 r39 119 119 object_node *make_player_onodes(int player_num=-1); 120 120 int total_view_vars(); 121 char *get_view_var_name(int num);121 char const *get_view_var_name(int num); 122 122 ushort make_sync(); 123 123 -
abuse/trunk/src/innet.cpp
r17 r39 12 12 13 13 */ 14 #include <stdio.h> 15 14 16 #include "demo.hpp" 15 17 #include "macs.hpp" … … 17 19 #include "level.hpp" 18 20 #include "game.hpp" 19 #include <stdio.h>21 #include "dev.hpp" 20 22 #include "timing.hpp" 21 23 #include "fileman.hpp" … … 26 28 #include "dprint.hpp" 27 29 #include "netcfg.hpp" 28 29 extern char *symbol_str(char *name);30 30 31 31 #ifdef __WATCOMC__ … … 44 44 join_struct *join_array=NULL; // points to an array of possible joining clients 45 45 extern char *get_login(); 46 extern void set_login(char *name);46 extern void set_login(char const *name); 47 47 48 48 … … 145 145 { 146 146 dprintf("Attempting to locate server %s, please wait\n",main_net_cfg->server_name); 147 char *sn=main_net_cfg->server_name;147 char const *sn=main_net_cfg->server_name; 148 148 net_server=prot->get_node_address(sn,DEFAULT_COMM_PORT,0); 149 149 if (!net_server) … … 219 219 } 220 220 221 int NF_set_file_server(char *name)221 int NF_set_file_server(char const *name) 222 222 { 223 223 if (prot) … … 234 234 235 235 236 int NF_open_file(char *filename, char*mode)236 int NF_open_file(char const *filename, char const *mode) 237 237 { 238 238 if (prot) -
abuse/trunk/src/items.cpp
r17 r39 6 6 extern palette *pal; 7 7 8 boundary::boundary(bFILE *fp, char *er_name) : point_list(fp)8 boundary::boundary(bFILE *fp, char const *er_name) : point_list(fp) 9 9 { 10 10 int x1,y1,x2,y2,checkx,checky,i; -
abuse/trunk/src/language.cpp
r2 r39 1 1 #include "lisp.hpp" 2 2 3 char *lang_string(char*symbol)3 char const *lang_string(char const *symbol) 4 4 { 5 5 void *v=find_symbol(symbol); -
abuse/trunk/src/level.cpp
r18 r39 1264 1264 } 1265 1265 1266 level::level(spec_directory *sd, bFILE *fp, char *lev_name)1266 level::level(spec_directory *sd, bFILE *fp, char const *lev_name) 1267 1267 { 1268 1268 spec_entry *e; … … 1744 1744 for (i=0;i<total_view_vars();i++) 1745 1745 { 1746 char *find_name=get_view_var_name(i);1746 char const *find_name = get_view_var_name(i); 1747 1747 se=sd->find(find_name); 1748 1748 … … 2186 2186 2187 2187 2188 int level::save(char *filename, int save_all)2188 int level::save(char const *filename, int save_all) 2189 2189 { 2190 2190 char name[255], bkname[255]; … … 2340 2340 } 2341 2341 2342 level::level(int width, int height, char *name)2342 level::level(int width, int height, char const *name) 2343 2343 { 2344 2344 the_game->need_refresh(); … … 3240 3240 } 3241 3241 3242 FILE *open_FILE(char *filename, char *mode);3243 3244 3242 void level::write_object_info(char *filename) 3245 3243 { -
abuse/trunk/src/light.cpp
r31 r39 1185 1185 1186 1186 1187 void add_light_spec(spec_directory *sd, char *level_name)1187 void add_light_spec(spec_directory *sd, char const *level_name) 1188 1188 { 1189 1189 int32_t size=4+4; // number of lights and minimum light levels … … 1213 1213 1214 1214 1215 void read_lights(spec_directory *sd, bFILE *fp, char *level_name)1215 void read_lights(spec_directory *sd, bFILE *fp, char const *level_name) 1216 1216 { 1217 1217 delete_all_lights(); -
abuse/trunk/src/lisp.cpp
r20 r39 42 42 int current_space; // normally set to TMP_SPACE, unless compiling or other needs 43 43 44 inline int streq(char *s1, char *s2) // when you don't need as much as strcmp, this is faster... 44 // when you don't need as much as strcmp, this is faster... 45 inline int streq(char const *s1, char const *s2) 45 46 { 46 47 while (*s1) … … 98 99 } 99 100 100 void lbreak(c onst char*format, ...)101 void lbreak(char const *format, ...) 101 102 { 102 103 break_level++; … … 136 137 else 137 138 { 138 char *s=st;139 char const *s=st; 139 140 do 140 141 { … … 151 152 } 152 153 153 void need_perm_space(char *why)154 void need_perm_space(char const *why) 154 155 { 155 156 if (current_space!=PERM_SPACE && current_space!=GC_SPACE) … … 299 300 } 300 301 301 struct lisp_string *new_lisp_string(char *string)302 struct lisp_string *new_lisp_string(char const *string) 302 303 { 303 304 int size=sizeof(lisp_string)+strlen(string)+1; … … 311 312 } 312 313 313 struct lisp_string *new_lisp_string(char *string, int length)314 struct lisp_string *new_lisp_string(char const *string, int length) 314 315 { 315 316 int size=sizeof(lisp_string)+length+1; … … 451 452 452 453 453 char *lerror(char *loc, char*cause)454 char *lerror(char const *loc, char const *cause) 454 455 { 455 456 int lines; … … 780 781 781 782 /* 782 lisp_symbol *find_symbol(char *name)783 lisp_symbol *find_symbol(char const *name) 783 784 { 784 785 cons_cell *cs; … … 792 793 793 794 794 lisp_symbol *make_find_symbol(char *name) // find a symbol, if it doesn't exsist it is created795 lisp_symbol *make_find_symbol(char const *name) // find a symbol, if it doesn't exsist it is created 795 796 { 796 797 lisp_symbol *s=find_symbol(name); … … 814 815 */ 815 816 816 lisp_symbol *find_symbol(char *name)817 lisp_symbol *find_symbol(char const *name) 817 818 { 818 819 lisp_symbol *p=lsym_root; … … 829 830 830 831 831 lisp_symbol *make_find_symbol(char *name)832 lisp_symbol *make_find_symbol(char const *name) 832 833 { 833 834 lisp_symbol *p=lsym_root; … … 992 993 } 993 994 994 lisp_symbol *add_sys_function(char *name, short min_args, short max_args, short number)995 lisp_symbol *add_sys_function(char const *name, short min_args, short max_args, short number) 995 996 { 996 997 need_perm_space("add_sys_function"); … … 1018 1019 } 1019 1020 1020 lisp_symbol *add_c_function(char *name, short min_args, short max_args, short number)1021 lisp_symbol *add_c_function(char const *name, short min_args, short max_args, short number) 1021 1022 { 1022 1023 total_user_functions++; … … 1032 1033 } 1033 1034 1034 lisp_symbol *add_c_bool_fun(char *name, short min_args, short max_args, short number)1035 lisp_symbol *add_c_bool_fun(char const *name, short min_args, short max_args, short number) 1035 1036 { 1036 1037 total_user_functions++; … … 1047 1048 1048 1049 1049 lisp_symbol *add_lisp_function(char *name, short min_args, short max_args, short number)1050 lisp_symbol *add_lisp_function(char const *name, short min_args, short max_args, short number) 1050 1051 { 1051 1052 total_user_functions++; … … 1061 1062 } 1062 1063 1063 void skip_c_comment(char *&s)1064 void skip_c_comment(char const *&s) 1064 1065 { 1065 1066 s+=2; … … 1073 1074 } 1074 1075 1075 long str_token_len(char *st)1076 long str_token_len(char const *st) 1076 1077 { 1077 1078 long x=1; … … 1084 1085 } 1085 1086 1086 int read_ltoken(char *&s, char *buffer)1087 int read_ltoken(char const *&s, char *buffer) 1087 1088 { 1088 1089 // skip space … … 1127 1128 char n[MAX_LISP_TOKEN_LEN]; // assume all tokens will be < 200 characters 1128 1129 1129 int end_of_program(char *s)1130 int end_of_program(char const *s) 1130 1131 { 1131 1132 return !read_ltoken(s,n); … … 1144 1145 void *comp_optimize(void *list); 1145 1146 1146 void *compile(char *&s)1147 void *compile(char const *&s) 1147 1148 { 1148 1149 void *ret=NULL; … … 1198 1199 do 1199 1200 { 1200 char *tmp=s;1201 char const *tmp=s; 1201 1202 if (!read_ltoken(tmp,n)) // check for the end of the list 1202 1203 lerror(NULL,"unexpected end of program"); … … 1299 1300 1300 1301 1301 static void lprint_string(char *st)1302 static void lprint_string(char const *st) 1302 1303 { 1303 1304 if (current_print_file) 1304 1305 { 1305 for (char *s=st;*s;s++)1306 for (char const *s=st;*s;s++) 1306 1307 { 1307 1308 /* if (*s=='\\') … … 2435 2436 s[l]=0; 2436 2437 delete fp; 2437 char *cs=s;2438 char const *cs=s; 2438 2439 #ifndef NO_LIBS 2439 2440 char msg[100]; … … 3097 3098 3098 3099 #define TOTAL_SYS_FUNCS 99 3099 // 0 1 2 3 4 5 6 7 3100 char *sys_funcs[TOTAL_SYS_FUNCS]={"print","car","cdr","length","list","cons","quote","eq", 3101 // 8 9 10 11 12 13 14 15 16 3102 "+","-","if","setf","symbol-list","assoc","null","acons","pairlis", 3103 // 17 18 19 20 21 22 23 24 3104 "let","defun","atom","not", "and", "or","progn","equal", 3105 // 25 26 27 28 29 30 31 3106 "concatenate","char-code","code-char","*","/","cond","select", 3107 // 32 33 34 35 36 37 3108 "function", "mapcar", "funcall", ">", "<", "tmp-space", 3109 // 38 39 40 41 42 3110 "perm-space","symbol-name","trace","untrace","digstr", 3111 // 43 44 45 46 47 48 49 3112 "compile-file","abs","min","max",">=","<=","backquote", 3113 // 50 51 52 53 54 55 56 3114 "comma","nth","resize-tmp","resize-perm","cos","sin","atan2", 3115 // 57 58 59 60 61 62 63 3116 "enum", "quit","eval","break","mod","write_profile","setq", 3117 // 64 65 66 67 68 69 70 3118 "for", "open_file","load","bit-and","bit-or","bit-xor","make-array", 3119 // 71 72 73 74 75 76 3120 "aref","if-1progn","if-2progn","if-12progn","eq0","preport", 3121 // 77 78 79 80 81 82 83 3122 "search","elt", "listp", "numberp", "do", "gc", "schar", 3123 // 84 85 86 87 88 89 90 3124 "symbolp","num2str","nconc","first","second","third","fourth", 3125 // 91 92 93 94 95 96 3126 "fifth", "sixth", "seventh","eighth","ninth","tenth", 3127 "substr", // 97 3128 "local_load" // 98, filename 3129 }; 3100 char const *sys_funcs[TOTAL_SYS_FUNCS] = 3101 { 3102 // 0 1 2 3 4 5 6 7 3103 "print","car","cdr","length","list","cons","quote","eq", 3104 // 8 9 10 11 12 13 14 15 16 3105 "+","-","if","setf","symbol-list","assoc","null","acons","pairlis", 3106 // 17 18 19 20 21 22 23 24 3107 "let","defun","atom","not", "and", "or","progn","equal", 3108 // 25 26 27 28 29 30 31 3109 "concatenate","char-code","code-char","*","/","cond","select", 3110 // 32 33 34 35 36 37 3111 "function", "mapcar", "funcall", ">", "<", "tmp-space", 3112 // 38 39 40 41 42 3113 "perm-space","symbol-name","trace","untrace","digstr", 3114 // 43 44 45 46 47 48 49 3115 "compile-file","abs","min","max",">=","<=","backquote", 3116 // 50 51 52 53 54 55 56 3117 "comma","nth","resize-tmp","resize-perm","cos","sin","atan2", 3118 // 57 58 59 60 61 62 63 3119 "enum", "quit","eval","break","mod","write_profile","setq", 3120 // 64 65 66 67 68 69 70 3121 "for", "open_file","load","bit-and","bit-or","bit-xor","make-array", 3122 // 71 72 73 74 75 76 3123 "aref","if-1progn","if-2progn","if-12progn","eq0","preport", 3124 // 77 78 79 80 81 82 83 3125 "search","elt", "listp", "numberp", "do", "gc", "schar", 3126 // 84 85 86 87 88 89 90 3127 "symbolp","num2str","nconc","first","second","third","fourth", 3128 // 91 92 93 94 95 96 3129 "fifth", "sixth", "seventh","eighth","ninth","tenth", 3130 "substr", // 97 3131 "local_load" // 98, filename 3132 }; 3130 3133 3131 3134 /* select, digistr, load-file are not a common lisp functions! */ -
abuse/trunk/src/loader2.cpp
r17 r39 222 222 for (fl=file_list;!NILP(fl);fl=lcdr(fl)) 223 223 { 224 char *fn=lstring_value(lcar(fl));224 char const *fn=lstring_value(lcar(fl)); 225 225 fp=open_file(fn,"rb"); 226 226 if (!fp->open_failure()) … … 321 321 exit(0); 322 322 } 323 char prog[100],*cs; 323 char prog[100]; 324 char const *cs; 324 325 325 326 c_mouse1=cash.reg("art/dev.spe","c_mouse1",SPEC_IMAGE,0); … … 355 356 356 357 357 char *ff;358 char const *ff; 358 359 if (DEFINEDP(symbol_value(make_find_symbol("frame_file")))) 359 360 ff=lstring_value(symbol_value(make_find_symbol("frame_file"))); -
abuse/trunk/src/loadgame.cpp
r4 r39 1 #include <string.h> 2 1 3 #include "specs.hpp" 2 4 #include "jwindow.hpp" … … 8 10 #include "cache.hpp" 9 11 #include "gui.hpp" 12 #include "dev.hpp" 10 13 #include "id.hpp" 11 14 #include "demo.hpp" 12 15 #include "game.hpp" 13 #include <string.h>14 16 15 17 extern void *save_order; // load from "saveordr.lsp", contains a list ordering the save games … … 18 20 19 21 extern window_manager *eh; 20 extern char *symbol_str(char *name);21 22 22 23 #define MAX_SAVE_GAMES 5 … … 64 65 return eh->new_window(mx,yres/2-(WINDOW_FRAME_TOP+ih*5)/2,-1,-1,buts[0]); 65 66 } 66 67 FILE *open_FILE(char *filename, char *mode);68 67 69 68 int get_save_spot() … … 141 140 } 142 141 143 int load_game(int show_all, char *title) // return 0 if the player escapes, else return the number of the game to load142 int load_game(int show_all, char const *title) // return 0 if the player escapes, else return the number of the game to load 144 143 { 145 144 int total_saved=0; -
abuse/trunk/src/menu.cpp
r2 r39 1 #include <math.h> 2 1 3 #include "menu.hpp" 2 4 #include "lisp.hpp" … … 16 18 #include "scroller.hpp" 17 19 #include "netcfg.hpp" 18 #include <math.h>19 20 #include "sock.hpp" 20 21 … … 298 299 299 300 300 char *ff="art/frame.spe";301 char const *ff = "art/frame.spe"; 301 302 int t=SPEC_IMAGE; 302 303 int u_u=cash.reg(ff,"u_u",t,1), … … 349 350 if (sfx_volume>127) sfx_volume=127; 350 351 draw_sfx_vol(slider); 351 char *s="sfx/ambtech1.wav";352 char const *s = "sfx/ambtech1.wav"; 352 353 if (sound_avail&SFX_INITIALIZED) 353 354 cash.sfx(cash.reg(s,s,SPEC_EXTERN_SFX,1))->play(sfx_volume); … … 360 361 if (sfx_volume<0) sfx_volume=0; 361 362 draw_sfx_vol(slider); 362 char *s="sfx/ambtech1.wav";363 char const *s = "sfx/ambtech1.wav"; 363 364 if (sound_avail&SFX_INITIALIZED) 364 365 cash.sfx(cash.reg(s,s,SPEC_EXTERN_SFX,1))->play(sfx_volume); … … 393 394 } 394 395 395 396 FILE *open_FILE(char *filename, char *mode);397 396 398 397 void save_difficulty() … … 433 432 // char *prog="((\"art/help.spe\" . \"sell2\")(\"art/help.spe\" . \"sell4\")(\"art/help.spe\" . \"sell3\")(\"art/endgame.spe\" . \"credit\"))"; 434 433 // char *prog="((\"art/endgame.spe\" . \"credit\") (\"art/help.spe\" . \"sell6\"))"; 435 char *prog="((\"art/endgame.spe\" . \"credit\"))";434 char const *prog="((\"art/endgame.spe\" . \"credit\"))"; 436 435 set_symbol_value(ss,compile(prog)); 437 436 current_space=sp; … … 580 579 void *current_demo=NULL; 581 580 582 static ico_button *load_icon(int num, int id, int x, int y, int &h, ifield *next, char *key)581 static ico_button *load_icon(int num, int id, int x, int y, int &h, ifield *next, char const *key) 583 582 { 584 583 char name[20]; 585 char *base="newi";584 char const *base = "newi"; 586 585 int a,b,c; 587 586 sprintf(name,"%s%04d.pcx",base,num*3+1); -
abuse/trunk/src/net/fileman.cpp
r17 r39 269 269 270 270 271 void file_manager::remote_file::r_close(char *reason)271 void file_manager::remote_file::r_close(char const *reason) 272 272 { 273 273 // if (reason) fprintf(stderr,"remote_file : %s\n",reason); … … 281 281 } 282 282 283 file_manager::remote_file::remote_file(net_socket *sock, char *filename, char*mode, remote_file *Next) : sock(sock)283 file_manager::remote_file::remote_file(net_socket *sock, char const *filename, char const *mode, remote_file *Next) : sock(sock) 284 284 { 285 285 next=Next; … … 382 382 { r_close(NULL); } 383 383 384 int file_manager::rf_open_file(char *&filename, char*mode)384 int file_manager::rf_open_file(char const *&filename, char const *mode) 385 385 { 386 386 net_address *fs_server_addr=NULL; -
abuse/trunk/src/net/gserver.cpp
r17 r39 8 8 #include "jwindow.hpp" 9 9 #include "input.hpp" 10 #include "dev.hpp" 10 11 11 12 extern base_memory_struct *base; … … 16 17 extern join_struct *join_array; 17 18 extern window_manager *eh; 18 extern char *symbol_str(char *name);19 19 extern void service_net_request(); 20 20 -
abuse/trunk/src/net/include/fileman.hpp
r17 r39 32 32 public : 33 33 net_socket *sock; 34 void r_close(char *reason);34 void r_close(char const *reason); 35 35 int32_t size; // server tells us the size of the file when we open it 36 36 int open_local; 37 37 remote_file *next; 38 remote_file(net_socket *sock, char *filename, char*mode, remote_file *Next);38 remote_file(net_socket *sock, char const *filename, char const *mode, remote_file *Next); 39 39 40 40 int unbuffered_read(void *buffer, size_t count); 41 int unbuffered_write(void *buf, size_t count) { return 0; } // not supported41 int unbuffered_write(void const *buf, size_t count) { return 0; } // not supported 42 42 int32_t unbuffered_tell(); 43 43 int32_t unbuffered_seek(int32_t offset); … … 63 63 64 64 65 int rf_open_file(char *&filename, char*mode);65 int rf_open_file(char const *&filename, char const *mode); 66 66 int32_t rf_tell(int fd); 67 67 int32_t rf_seek(int fd, int32_t offset); -
abuse/trunk/src/net/include/sock.hpp
r5 r39 29 29 virtual int ready_to_read() = 0; 30 30 virtual int ready_to_write() = 0; 31 virtual int write(void *buf, int size, net_address *addr=0) = 0;31 virtual int write(void const *buf, int size, net_address *addr=0) = 0; 32 32 virtual int read(void *buf, int size, net_address **addr=0) = 0; 33 33 virtual int get_fd() = 0; … … 66 66 67 67 virtual net_address *get_local_address() = 0; 68 virtual net_address *get_node_address(char *&server_name, int def_port, int force_port) = 0;68 virtual net_address *get_node_address(char const *&server_name, int def_port, int force_port) = 0; 69 69 virtual net_socket *connect_to_server(net_address *addr, 70 70 net_socket::socket_type sock_type=net_socket::SOCKET_SECURE) =0; 71 71 virtual net_socket *create_listen_socket(int port, net_socket::socket_type sock_type) = 0; 72 72 virtual int installed() = 0; 73 virtual char *name() = 0;73 virtual char const *name() = 0; 74 74 virtual int select(int block) = 0; // return # of sockets available for read & writing 75 75 virtual void cleanup() { ; } // should do any needed pre-exit cleanup stuff 76 net_socket *connect_to_server(char *&server_name, int port, int force_port=0,76 net_socket *connect_to_server(char const *&server_name, int port, int force_port=0, 77 77 net_socket::socket_type sock_type=net_socket::SOCKET_SECURE); 78 78 -
abuse/trunk/src/net/include/tcpip.hpp
r4 r39 101 101 tcpip_protocol(); 102 102 net_address *get_local_address(); 103 net_address *get_node_address(char *&server_name, int def_port, int force_port);103 net_address *get_node_address(char const *&server_name, int def_port, int force_port); 104 104 net_socket *connect_to_server(net_address *addr, 105 105 net_socket::socket_type sock_type=net_socket::SOCKET_SECURE); 106 106 net_socket *create_listen_socket(int port, net_socket::socket_type sock_type); 107 107 int installed() { return 1; } // always part of unix 108 char *name() { return "UNIX generic TCPIP"; }108 char const *name() { return "UNIX generic TCPIP"; } 109 109 void cleanup(); 110 110 int select(int block); // return # of sockets available for read & writing … … 139 139 return FD_ISSET(fd,&write_check); 140 140 } 141 virtual int write(void *buf, int size, net_address *addr=NULL);141 virtual int write(void const *buf, int size, net_address *addr=NULL); 142 142 virtual int read(void *buf, int size, net_address **addr); 143 143 … … 212 212 return tr; 213 213 } 214 virtual int write(void *buf, int size, net_address *addr=NULL)214 virtual int write(void const *buf, int size, net_address *addr=NULL) 215 215 { 216 216 if (addr) -
abuse/trunk/src/net/sock.cpp
r2 r39 12 12 // in sub-classes 13 13 14 net_socket *net_protocol::connect_to_server(char *&server_name, int port, int force_port, net_socket::socket_type sock_type)14 net_socket *net_protocol::connect_to_server(char const *&server_name, int port, int force_port, net_socket::socket_type sock_type) 15 15 { 16 16 net_address *a=get_node_address(server_name,port,force_port); -
abuse/trunk/src/net/tcpip.cpp
r4 r39 60 60 //}}}/////////////////////////////////// 61 61 62 int unix_fd::write(void *buf, int size, net_address *addr)62 int unix_fd::write(void const *buf, int size, net_address *addr) 63 63 //{{{ 64 64 { … … 120 120 } 121 121 122 char tmp[4],*np; 123 sockaddr_in host; 122 char tmp[4]; 123 char const *np; 124 sockaddr_in host; 124 125 125 126 np = my_name; … … 150 151 //}}}/////////////////////////////////// 151 152 152 net_address *tcpip_protocol::get_node_address(char *&server_name,153 net_address *tcpip_protocol::get_node_address(char const *&server_name, 153 154 int def_port, int force_port) 154 155 //{{{ 155 156 { 156 sockaddr_in host; 157 158 if (server_name[0]>='0' && server_name[0]<='9') 159 { 160 char tmp[4],*np; 157 sockaddr_in host; 158 159 if (server_name[0]>='0' && server_name[0]<='9') 160 { 161 char tmp[4]; 162 char const *np; 161 163 162 164 np = server_name; … … 193 195 else 194 196 { 195 char name[256], *np;197 char name[256], *np; 196 198 197 199 np=name; -
abuse/trunk/src/netcfg.cpp
r17 r39 6 6 #include "light.hpp" 7 7 8 #include "dev.hpp" 9 8 10 extern char *get_login(); 9 11 extern window_manager *eh; 10 12 net_configuration *main_net_cfg=NULL; 11 13 extern char lsf[256]; 12 char *symbol_str(char *name);13 14 14 15 extern net_protocol *prot; … … 37 38 38 39 39 void net_configuration::cfg_error(char *msg)40 void net_configuration::cfg_error(char const *msg) 40 41 { 41 42 jwindow *j=eh->new_window(-1,0,-1,-1,new info_field(WINDOW_FRAME_LEFT,WINDOW_FRAME_TOP,0,msg, … … 243 244 244 245 245 void net_configuration::error(char *message)246 void net_configuration::error(char const *message) 246 247 { 247 248 image *screen_backup=screen->copy(); … … 267 268 268 269 { 269 char *ok=symbol_str("ok_button");270 char const *ok = symbol_str("ok_button"); 270 271 271 272 int bx=x+ns_w/2-strlen(ok)*fnt->width()/2-3, … … 435 436 int x=(xres+1)/2-ns_w/2,y=(yres+1)/2-ns_h/2; 436 437 ns->put_image(screen,x,y); 437 char *nw_s=symbol_str("Networking");438 char const *nw_s = symbol_str("Networking"); 438 439 JCFont *fnt=eh->font(); 439 440 … … 443 444 { 444 445 445 char *server_str=symbol_str("server");446 char const *server_str = symbol_str("server"); 446 447 button *sb=new button(x+40,y+ns_h-23-fnt->height(),NET_SERVER,server_str,NULL); 447 448 -
abuse/trunk/src/newlight.cpp
r17 r39 819 819 820 820 821 void read_lights(spec_directory *sd, jFILE *fp, char *level_name)821 void read_lights(spec_directory *sd, jFILE *fp, char const *level_name) 822 822 { 823 823 delete_all_lights(); -
abuse/trunk/src/nfclient.cpp
r17 r39 29 29 int offset; 30 30 public : 31 nfs_file(char *filename, char*mode);31 nfs_file(char const *filename, char const *mode); 32 32 virtual int open_failure(); 33 33 virtual int unbuffered_read(void *buf, size_t count); // returns number of bytes read 34 34 int new_read(void *buf, size_t count); // returns number of bytes read 35 virtual int unbuffered_write(void *buf, size_t count); // returns number of bytes written35 virtual int unbuffered_write(void const *buf, size_t count); // returns number of bytes written 36 36 virtual int unbuffered_seek(long offset, int whence); // whence=SEEK_SET, SEEK_CUR, SEEK_END, ret=0=success 37 37 virtual int unbuffered_tell(); … … 40 40 } ; 41 41 42 bFILE *open_nfs_file(char *filename,char*mode)42 bFILE *open_nfs_file(char const *filename, char const *mode) 43 43 { 44 44 return new nfs_file(filename,mode); … … 46 46 47 47 48 nfs_file::nfs_file(char *filename, char*mode)48 nfs_file::nfs_file(char const *filename, char const *mode) 49 49 { 50 50 local=NULL; … … 52 52 53 53 int local_only=0; 54 char *s=mode;54 char const *s=mode; 55 55 for (;*s;s++) // check to see if writeable file, if so don't go through nfs 56 56 if (*s=='w' || *s=='W' || *s=='a' || *s=='A') 57 57 local_only=1; 58 58 59 char name[256],*c,*f=filename; 60 c=name; 59 char name[256], *c; 60 char const *f = filename; 61 c = name; 61 62 while (*f) { *c=*(f++); *c=toupper(*c); c++; } *c=0; 62 63 if (strstr(name,"REGISTER")) … … 66 67 { 67 68 int fail1,fail2,fail3=0; 68 char *local_filename=filename;69 char const *local_filename = filename; 69 70 if (filename[0]=='/' && filename[1]=='/') 70 71 { local_filename+=2; … … 144 145 } 145 146 146 int nfs_file::unbuffered_write(void *buf, size_t count) // returns number of bytes written147 int nfs_file::unbuffered_write(void const *buf, size_t count) // returns number of bytes written 147 148 { 148 149 if (local) … … 216 217 217 218 218 int set_file_server(char *name)219 int set_file_server(char const *name) 219 220 { 220 221 if (prot) -
abuse/trunk/src/objects.cpp
r18 r39 45 45 46 46 47 obj_desc object_descriptions[TOTAL_OBJECT_VARS] ={48 {"fade_dir", RC_8 }, 49 {"frame_dir",RC_8 },50 {"direction", RC_8 },51 {"gravity_on",RC_8 },52 {"fade_count", RC_8 },53 54 {"fade_max", RC_8 }, 55 {"active",RC_8 },56 {"flags",RC_8 },57 {"aitype",RC_8 },58 {"xvel", RC_32},59 60 {"fxvel", RC_8 }, 61 {"yvel", RC_32},62 {"fyvel", RC_8},63 {"xacel", RC_32},64 {"fxacel", RC_8},65 66 {"yacel", RC_32 }, 67 {"fyacel", RC_8},68 {"x", RC_32},69 {"fx", RC_8},70 {"y", RC_32},71 72 {"fy", RC_8 }, 73 {"hp", RC_16},74 {"mp", RC_16 },75 {"fmp",RC_16 },76 {"cur_frame",RC_16 },77 78 {"aistate", RC_16 }, 79 {"aistate_time",RC_16 },80 {"targetable", RC_8 } 81 82 47 obj_desc object_descriptions[TOTAL_OBJECT_VARS] = 48 { 49 {"fade_dir", RC_8 }, 50 {"frame_dir", RC_8 }, 51 {"direction", RC_8 }, 52 {"gravity_on", RC_8 }, 53 {"fade_count", RC_8 }, 54 55 {"fade_max", RC_8 }, 56 {"active", RC_8 }, 57 {"flags", RC_8 }, 58 {"aitype", RC_8 }, 59 {"xvel", RC_32 }, 60 61 {"fxvel", RC_8 }, 62 {"yvel", RC_32 }, 63 {"fyvel", RC_8 }, 64 {"xacel", RC_32 }, 65 {"fxacel", RC_8 }, 66 67 {"yacel", RC_32 }, 68 {"fyacel", RC_8 }, 69 {"x", RC_32 }, 70 {"fx", RC_8 }, 71 {"y", RC_32 }, 72 73 {"fy", RC_8 }, 74 {"hp", RC_16 }, 75 {"mp", RC_16 }, 76 {"fmp", RC_16 }, 77 {"cur_frame", RC_16 }, 78 79 {"aistate", RC_16 }, 80 {"aistate_time", RC_16 }, 81 {"targetable", RC_8 } 82 }; 83 83 84 84 int32_t game_object::get_var_by_name(char *name, int &error) … … 133 133 134 134 135 char *simple_object::var_name(int x)135 char const *simple_object::var_name(int x) 136 136 { 137 137 return object_descriptions[x].name; -
abuse/trunk/src/property.cpp
r2 r39 1 #include <stdio.h> 2 #include <string.h> 3 1 4 #include "property.hpp" 2 5 #include "jmalloc.hpp" 3 #include <stdio.h>4 6 #include "dprint.hpp" 5 #include <string.h>7 #include "game.hpp" 6 8 7 9 class property … … 11 13 char *def_str; 12 14 int def_num; 13 property(char *Name, int Def)15 property(char const *Name, int Def) 14 16 { name=strcpy((char *)jmalloc(strlen(Name)+1,"Property Name"),Name); 15 17 def_num=Def; … … 18 20 } 19 21 20 property(char *Name, char*Def)22 property(char const *Name, char const *Def) 21 23 { name=strcpy((char *)jmalloc(strlen(Name)+1,"Property Name"),Name); 22 24 def_str=strcpy((char *)jmalloc(strlen(Def)+1,"Property text"),Def); … … 33 35 } 34 36 35 void set(char *x)37 void set(char const *x) 36 38 { 37 39 if (def_str) … … 52 54 } ; 53 55 54 property *property_manager::find(char *name)56 property *property_manager::find(char const *name) 55 57 { 56 58 for (property *i=first;i;i=i->next) … … 71 73 } 72 74 73 int property_manager::get(char *name, int def)75 int property_manager::get(char const *name, int def) 74 76 { 75 77 property *f=find(name); … … 80 82 81 83 82 char *property_manager::get(char *name,char*def)84 char const *property_manager::get(char const *name,char const *def) 83 85 { 84 86 property *f=find(name); … … 89 91 90 92 91 void property_manager::set(char *name, double def)93 void property_manager::set(char const *name, double def) 92 94 { 93 95 property *f=find(name); … … 102 104 } 103 105 104 void property_manager::set(char *name, char*def)106 void property_manager::set(char const *name, char const *def) 105 107 { 106 108 property *f=find(name); … … 116 118 117 119 118 FILE *open_FILE(char *filename, char *mode); 119 120 void property_manager::save(char *filename) 120 void property_manager::save(char const *filename) 121 121 { 122 122 FILE *fp=open_FILE(filename,"wb"); … … 138 138 139 139 140 void property_manager::load(char *filename)140 void property_manager::load(char const *filename) 141 141 { 142 142 char buf[100],*c1,*c2,name[100],str[100]; -
abuse/trunk/src/scene.cpp
r2 r39 363 363 364 364 365 int text_draw(int y, int x1, int y1, int x2, int y2, char *buf,365 int text_draw(int y, int x1, int y1, int x2, int y2, char const *buf, 366 366 text_blocker *first, JCFont *font) 367 367 { … … 371 371 int h=font->height()+2,w=font->width(),x=x1,dist; 372 372 y+=y1; 373 char *word_start;373 char const *word_start; 374 374 375 375 while (*buf) -
abuse/trunk/src/sdlport/event.cpp
r23 r39 19 19 20 20 extern int confirm_quit(); 21 extern int get_key_binding( char *dir, int i );21 extern int get_key_binding( char const *dir, int i ); 22 22 extern int mouse_xscale, mouse_yscale; 23 23 short mouse_buttons[5] = { 0, 0, 0, 0, 0 }; -
abuse/trunk/src/sdlport/setup.cpp
r6 r39 17 17 #include <GL/gl.h> 18 18 #include <GL/glu.h> 19 #endif 20 #endif 19 #endif /* __APPLE__ */ 20 #endif /* HAVE_OPENGL */ 21 21 #include "specs.hpp" 22 22 #include "keys.hpp" … … 34 34 void showHelp() 35 35 { 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 36 printf( "\n" ); 37 printf( "Usage: abuse.sdl [options]\n" ); 38 printf( "Options:\n\n" ); 39 printf( "** Abuse Options **\n" ); 40 printf( " -size <arg> Set the size of the screen\n" ); 41 printf( " -edit Startup in editor mode\n" ); 42 printf( " -a <arg> Use addon named <arg>\n" ); 43 printf( " -f <arg> Load map file named <arg>\n" ); 44 printf( " -lisp Startup in lisp interpreter mode\n" ); 45 printf( " -nodelay Run at maximum speed\n" ); 46 printf( "\n" ); 47 printf( "** Abuse-SDL Options **\n" ); 48 printf( " -datadir <arg> Set the location of the game data to <arg>\n" ); 49 printf( " -doublebuf Enable double buffering\n" ); 50 printf( " -fullscreen Enable fullscreen mode\n" ); 51 51 #ifdef HAVE_OPENGL 52 53 52 printf( " -gl Enable OpenGL\n" ); 53 printf( " -antialias Enable anti-aliasing (with -gl only)\n" ); 54 54 #endif 55 56 57 58 59 // 60 // 61 62 63 55 printf( " -h, --help Display this text\n" ); 56 printf( " -mono Disable stereo sound\n" ); 57 printf( " -nosound Disable sound\n" ); 58 printf( " -scale <arg> Scale to <arg>\n" ); 59 // printf( " -x <arg> Set the width to <arg>\n" ); 60 // printf( " -y <arg> Set the height to <arg>\n" ); 61 printf( "\n" ); 62 printf( "Anthony Kruize <trandor@labyrinth.net.au>\n" ); 63 printf( "\n" ); 64 64 } 65 65 … … 69 69 void createRCFile( char *rcfile ) 70 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 71 FILE *fd = NULL; 72 73 if( (fd = fopen( rcfile, "w" )) != NULL ) 74 { 75 fputs( "; Abuse-SDL Configuration file\n\n", fd ); 76 fputs( "; Location of the datafiles\ndatadir=/var/games/abuse\n\n", fd ); 77 fputs( "; Startup fullscreen\nfullscreen=0\n\n", fd ); 78 fputs( "; Use DoubleBuffering\ndoublebuf=0\n\n", fd ); 79 fputs( "; Use mono audio only\nmono=0\n\n", fd ); 80 fputs( "; Grab the mouse to the window\ngrabmouse=0\n\n", fd ); 81 fputs( "; Set the scale factor\nscale=2\n\n", fd ); 82 fputs( "; Use OpenGL\ngl=0\n\n", fd ); 83 fputs( "; Use anti-aliasing (with gl=1 only)\nantialias=1\n\n", fd ); 84 // fputs( "; Set the width of the window\nx=320\n\n", fd ); 85 // fputs( "; Set the height of the window\ny=200\n\n", fd ); 86 fputs( "; Disable the SDL parachute in the case of a crash\nnosdlparachute=0\n\n", fd ); 87 fputs( "; Key mappings\n", fd ); 88 fputs( "left=LEFT\nright=RIGHT\nup=UP\ndown=DOWN\n", fd ); 89 fputs( "fire=SPACE\nweapprev=CTRL_R\nweapnext=INSERT\n", fd ); 90 fclose( fd ); 91 } 92 else 93 { 94 printf( "Unable to create 'abuserc' file.\n" ); 95 } 96 96 } 97 97 … … 101 101 void readRCFile() 102 102 { 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 // 140 // 141 142 /* 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 103 FILE *fd = NULL; 104 char *rcfile; 105 char buf[255]; 106 char *result; 107 108 rcfile = (char *)jmalloc( strlen( get_save_filename_prefix() ) + 9, "rcfile" ); 109 sprintf( rcfile, "%s/abuserc", get_save_filename_prefix() ); 110 if( (fd = fopen( rcfile, "r" )) != NULL ) 111 { 112 while( fgets( buf, sizeof( buf ), fd ) != NULL ) 113 { 114 result = strtok( buf, "=" ); 115 if( strcasecmp( result, "fullscreen" ) == 0 ) 116 { 117 result = strtok( NULL, "\n" ); 118 flags.fullscreen = atoi( result ); 119 } 120 else if( strcasecmp( result, "doublebuf" ) == 0 ) 121 { 122 result = strtok( NULL, "\n" ); 123 flags.doublebuf = atoi( result ); 124 } 125 else if( strcasecmp( result, "mono" ) == 0 ) 126 { 127 result = strtok( NULL, "\n" ); 128 flags.mono = atoi( result ); 129 } 130 else if( strcasecmp( result, "grabmouse" ) == 0 ) 131 { 132 result = strtok( NULL, "\n" ); 133 flags.grabmouse = atoi( result ); 134 } 135 else if( strcasecmp( result, "scale" ) == 0 ) 136 { 137 result = strtok( NULL, "\n" ); 138 scale = atoi( result ); 139 // flags.xres = xres * atoi( result ); 140 // flags.yres = yres * atoi( result ); 141 } 142 /* else if( strcasecmp( result, "x" ) == 0 ) 143 { 144 result = strtok( NULL, "\n" ); 145 flags.xres = atoi( result ); 146 } 147 else if( strcasecmp( result, "y" ) == 0 ) 148 { 149 result = strtok( NULL, "\n" ); 150 flags.yres = atoi( result ); 151 }*/ 152 else if( strcasecmp( result, "gl" ) == 0 ) 153 { 154 // We leave this in even if we don't have OpenGL so we can 155 // at least inform the user. 156 result = strtok( NULL, "\n" ); 157 flags.gl = atoi( result ); 158 } 159 159 #ifdef HAVE_OPENGL 160 161 162 163 164 165 166 167 160 else if( strcasecmp( result, "antialias" ) == 0 ) 161 { 162 result = strtok( NULL, "\n" ); 163 if( atoi( result ) ) 164 { 165 flags.antialias = GL_LINEAR; 166 } 167 } 168 168 #endif 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 169 else if( strcasecmp( result, "nosdlparachute" ) == 0 ) 170 { 171 result = strtok( NULL, "\n" ); 172 flags.nosdlparachute = atoi( result ); 173 } 174 else if( strcasecmp( result, "datadir" ) == 0 ) 175 { 176 result = strtok( NULL, "\n" ); 177 set_filename_prefix( result ); 178 } 179 else if( strcasecmp( result, "left" ) == 0 ) 180 { 181 result = strtok( NULL,"\n" ); 182 keys.left = key_value( result ); 183 } 184 else if( strcasecmp( result, "right" ) == 0 ) 185 { 186 result = strtok( NULL,"\n" ); 187 keys.right = key_value( result ); 188 } 189 else if( strcasecmp( result, "up" ) == 0 ) 190 { 191 result = strtok( NULL,"\n" ); 192 keys.up = key_value( result ); 193 } 194 else if( strcasecmp( result, "down" ) == 0 ) 195 { 196 result = strtok( NULL,"\n" ); 197 keys.down = key_value( result ); 198 } 199 else if( strcasecmp( result, "fire" ) == 0 ) 200 { 201 result = strtok( NULL,"\n" ); 202 keys.b2 = key_value( result ); 203 } 204 else if( strcasecmp( result, "special" ) == 0 ) 205 { 206 result = strtok( NULL,"\n" ); 207 keys.b1 = key_value( result ); 208 } 209 else if( strcasecmp( result, "weapprev" ) == 0 ) 210 { 211 result = strtok( NULL,"\n" ); 212 keys.b3 = key_value( result ); 213 } 214 else if( strcasecmp( result, "weapnext" ) == 0 ) 215 { 216 result = strtok( NULL,"\n" ); 217 keys.b4 = key_value( result ); 218 } 219 } 220 fclose( fd ); 221 } 222 else 223 { 224 // Couldn't open the abuserc file so let's create a default one 225 createRCFile( rcfile ); 226 } 227 jfree( rcfile ); 228 228 } 229 229 … … 233 233 void parseCommandLine( int argc, char **argv ) 234 234 { 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 /* 263 264 265 266 /* 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 235 for( int ii = 1; ii < argc; ii++ ) 236 { 237 if( !strcasecmp( argv[ii], "-fullscreen" ) ) 238 { 239 flags.fullscreen = 1; 240 } 241 else if( !strcasecmp( argv[ii], "-doublebuf" ) ) 242 { 243 flags.doublebuf = 1; 244 } 245 else if( !strcasecmp( argv[ii], "-size" ) ) 246 { 247 if( !sscanf( argv[++ii], "%d", &xres ) ) 248 { 249 xres = 320; 250 } 251 if( !sscanf( argv[++ii], "%d", &yres ) ) 252 { 253 yres = 200; 254 } 255 } 256 else if( !strcasecmp( argv[ii], "-scale" ) ) 257 { 258 int result; 259 if( sscanf( argv[++ii], "%d", &result ) ) 260 { 261 scale = result; 262 /* flags.xres = xres * scale; 263 flags.yres = yres * scale;*/ 264 } 265 } 266 /* else if( !strcasecmp( argv[ii], "-x" ) ) 267 { 268 int x; 269 if( sscanf( argv[++ii], "%d", &x ) ) 270 { 271 flags.xres = x; 272 } 273 } 274 else if( !strcasecmp( argv[ii], "-y" ) ) 275 { 276 int y; 277 if( sscanf( argv[++ii], "%d", &y ) ) 278 { 279 flags.yres = y; 280 } 281 }*/ 282 else if( !strcasecmp( argv[ii], "-nosound" ) ) 283 { 284 flags.nosound = 1; 285 } 286 else if( !strcasecmp( argv[ii], "-gl" ) ) 287 { 288 // We leave this in even if we don't have OpenGL so we can 289 // at least inform the user. 290 flags.gl = 1; 291 } 292 292 #ifdef HAVE_OPENGL 293 294 295 296 293 else if( !strcasecmp( argv[ii], "-antialias" ) ) 294 { 295 flags.antialias = GL_LINEAR; 296 } 297 297 #endif 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 298 else if( !strcasecmp( argv[ii], "-mono" ) ) 299 { 300 flags.mono = 1; 301 } 302 else if( !strcasecmp( argv[ii], "-datadir" ) ) 303 { 304 char datadir[255]; 305 if( sscanf( argv[++ii], "%s", datadir ) ) 306 { 307 set_filename_prefix( datadir ); 308 } 309 } 310 else if( !strcasecmp( argv[ii], "-h" ) || !strcasecmp( argv[ii], "--help" ) ) 311 { 312 showHelp(); 313 exit( 0 ); 314 } 315 } 316 316 } 317 317 … … 321 321 void setup( int argc, char **argv ) 322 322 { 323 324 flags.fullscreen = 0;// Start in a window325 flags.doublebuf = 0;// No double buffering326 flags.mono = 0;// Enable stereo sound327 flags.nosound = 0;// Enable sound328 flags.grabmouse = 0;// Don't grab the mouse329 flags.nosdlparachute = 0;// SDL error handling330 flags.xres = xres = 320;// Default window width331 flags.yres = yres = 200;// Default window height332 flags.gl = 0;// Don't use opengl323 // Initialise default settings 324 flags.fullscreen = 0; // Start in a window 325 flags.doublebuf = 0; // No double buffering 326 flags.mono = 0; // Enable stereo sound 327 flags.nosound = 0; // Enable sound 328 flags.grabmouse = 0; // Don't grab the mouse 329 flags.nosdlparachute = 0; // SDL error handling 330 flags.xres = xres = 320; // Default window width 331 flags.yres = yres = 200; // Default window height 332 flags.gl = 0; // Don't use opengl 333 333 #ifdef HAVE_OPENGL 334 flags.antialias = GL_NEAREST;// Don't anti-alias334 flags.antialias = GL_NEAREST; // Don't anti-alias 335 335 #endif 336 keys.up= key_value( "UP" );337 keys.down= key_value( "DOWN" );338 keys.left= key_value( "LEFT" );339 keys.right= key_value( "RIGHT" );340 keys.b3= key_value( "CTRL_R" );341 keys.b4= key_value( "INSERT" );342 scale = 2;// Default scale amount343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 336 keys.up = key_value( "UP" ); 337 keys.down = key_value( "DOWN" ); 338 keys.left = key_value( "LEFT" ); 339 keys.right = key_value( "RIGHT" ); 340 keys.b3 = key_value( "CTRL_R" ); 341 keys.b4 = key_value( "INSERT" ); 342 scale = 2; // Default scale amount 343 344 // Display our name and version 345 printf( "%s %s\n", PACKAGE, VERSION ); 346 347 // Initialize SDL with video and audio support 348 if( SDL_Init( SDL_INIT_VIDEO | SDL_INIT_AUDIO ) < 0 ) 349 { 350 printf( "Unable to initialise SDL : %s\n", SDL_GetError() ); 351 exit( 1 ); 352 } 353 atexit( SDL_Quit ); 354 355 // Set the savegame directory 356 char *homedir; 357 char *savedir; 358 FILE *fd = NULL; 359 360 if( (homedir = getenv( "HOME" )) != NULL ) 361 { 362 savedir = (char *)jmalloc( strlen( homedir ) + 9, "savedir" ); 363 sprintf( savedir, "%s/.abuse/", homedir ); 364 // Check if we already have a savegame directory 365 if( (fd = fopen( savedir, "r" )) == NULL ) 366 { 367 // FIXME: Add some error checking here 368 mkdir( savedir, S_IRUSR | S_IWUSR | S_IXUSR ); 369 } 370 else 371 { 372 fclose( fd ); 373 } 374 set_save_filename_prefix( savedir ); 375 jfree( savedir ); 376 } 377 else 378 { 379 // Warn the user that we couldn't set the savename prefix 380 printf( "WARNING: Unable to get $HOME environment variable.\n" ); 381 printf( " Savegames will probably fail.\n" ); 382 // Just use the working directory. 383 // Hopefully they have write permissions.... 384 set_save_filename_prefix( "" ); 385 } 386 387 // Set the datadir to a default value 388 // (The current directory) 389 set_filename_prefix( EXPDATADIR ); 390 391 // Load the users configuration 392 readRCFile(); 393 394 // Handle command-line parameters 395 parseCommandLine( argc, argv ); 396 397 // Calculate the scaled window size. 398 flags.xres = xres * scale; 399 flags.yres = yres * scale; 400 401 // Stop SDL handling some errors 402 if( flags.nosdlparachute ) 403 { 404 // segmentation faults 405 signal( SIGSEGV, SIG_DFL ); 406 // floating point errors 407 signal( SIGFPE, SIG_DFL ); 408 } 409 409 } 410 410 … … 412 412 // Get the key binding for the requested function 413 413 // 414 int get_key_binding( char *dir, int i ) 415 { 416 if( strcasecmp( dir, "left" ) == 0 ) 417 { 418 return keys.left; 419 } 420 else if( strcasecmp( dir, "right" ) == 0 ) 421 { 422 return keys.right; 423 } 424 else if( strcasecmp( dir, "up" ) == 0 ) 425 { 426 return keys.up; 427 } 428 else if( strcasecmp( dir, "down" ) == 0 ) 429 { 430 return keys.down; 431 } 432 else if( strcasecmp( dir, "b1" ) == 0 ) 433 { 434 return keys.b1; 435 } 436 else if( strcasecmp( dir, "b2" ) == 0 ) 437 { 438 return keys.b2; 439 } 440 else if( strcasecmp( dir, "b3" ) == 0 ) 441 { 442 return keys.b3; 443 } 444 else if( strcasecmp( dir, "b4" ) == 0 ) 445 { 446 return keys.b4; 447 } 448 return 0; 449 } 414 int get_key_binding(char const *dir, int i) 415 { 416 if( strcasecmp( dir, "left" ) == 0 ) 417 return keys.left; 418 else if( strcasecmp( dir, "right" ) == 0 ) 419 return keys.right; 420 else if( strcasecmp( dir, "up" ) == 0 ) 421 return keys.up; 422 else if( strcasecmp( dir, "down" ) == 0 ) 423 return keys.down; 424 else if( strcasecmp( dir, "b1" ) == 0 ) 425 return keys.b1; 426 else if( strcasecmp( dir, "b2" ) == 0 ) 427 return keys.b2; 428 else if( strcasecmp( dir, "b3" ) == 0 ) 429 return keys.b3; 430 else if( strcasecmp( dir, "b4" ) == 0 ) 431 return keys.b4; 432 433 return 0; 434 } -
abuse/trunk/src/sdlport/sound.cpp
r11 r39 278 278 // 279 279 280 song::song( char * filename )280 song::song( char const * filename ) 281 281 { 282 282 data = NULL; -
abuse/trunk/src/server2.cpp
r17 r39 9 9 #include "dev.hpp" 10 10 11 char*get_username();11 extern char const *get_username(); 12 12 int start_running=0; 13 13 -
abuse/trunk/src/setup.cpp
r2 r39 45 45 46 46 47 int get_option(char *name);47 int get_option(char const *name); 48 48 49 49 JCFont *cfg_font; … … 54 54 extern int jmalloc_max_size; 55 55 56 FILE *open_FILE(char *filename, char *mode);57 56 void setup(int argc, char **argv) 58 57 { -
abuse/trunk/src/specache.cpp
r17 r39 35 35 36 36 37 spec_directory *spec_directory_cache::get_spec_directory(char *filename, bFILE *fp)37 spec_directory *spec_directory_cache::get_spec_directory(char const *filename, bFILE *fp) 38 38 { 39 39 filename_node **parent=0,*p=fn_root; -
abuse/trunk/src/text_gui.cpp
r2 r39 426 426 t=eval(t); msg=eval(msg); y=eval(y); n=eval(n); 427 427 int c; 428 char *yes=lstring_value(y);429 char *no=lstring_value(n);428 char const *yes = lstring_value(y); 429 char const *no = lstring_value(n); 430 430 do 431 431 { -
abuse/trunk/src/unixnfc.cpp
r17 r39 37 37 #endif 38 38 39 extern int crc_man_write_crc_file(char *filename);39 extern int crc_man_write_crc_file(char const *filename); 40 40 int net_installed=0,net_out_fd,net_in_fd; 41 41 int net_child=-1; … … 180 180 } 181 181 182 int NF_open_file(char *filename, char*mode)182 int NF_open_file(char const *filename, char const *mode) 183 183 { 184 184 if (net_installed) -
abuse/trunk/src/username.cpp
r2 r39 1 1 #ifdef __WATCOMC__ 2 char *get_username() { return "DOS user"; }2 char const *get_username() { return "DOS user"; } 3 3 #elif (defined(__APPLE__) && !defined(__MACH__)) 4 char *get_username() { return "Mac user"; }4 char const *get_username() { return "Mac user"; } 5 5 #else 6 6 … … 10 10 #include <unistd.h> 11 11 12 char *get_username()12 char const *get_username() 13 13 { 14 struct passwd 15 char 14 struct passwd *pw; 15 char const *name; 16 16 17 17 if (!(name = getlogin())) -
abuse/trunk/src/version.cpp
r29 r39 7 7 uint8_t minor_version=00; 8 8 9 extern int get_option(char *name);9 extern int get_option(char const *name); 10 10 11 11 #ifdef __WATCOMC__ -
abuse/trunk/src/view.cpp
r17 r39 19 19 #define SHIFT_RIGHT_DEFAULT 0 20 20 21 extern int get_key_binding( char *dir, int i );21 extern int get_key_binding( char const *dir, int i ); 22 22 extern window_manager *eh; 23 23 view *player_list=NULL; … … 184 184 #endif 185 185 186 void set_login(char *name)186 void set_login(char const *name) 187 187 { strncpy(cur_user_name,name,20); } 188 188 … … 950 950 #define TVV (V_FREEZE_TIME+1) 951 951 952 static char *vv_names[TVV]={ 953 "view.cx1", "view.cy1", "view.cx2", "view.cy2", 954 "view.shift_down", "view.shift_right", 955 "view.god", 956 "view.player_number", 957 "view.draw_solid", 958 "view.lives", 959 "view.current_weapon", 960 "view.x_suggestion", "view.y_suggestion", 961 "view.b1_suggestion", "view.b2_suggestion", "view.b3_suggestion", "view.b4_suggestion", 962 "view.pan_x", "view.pan_y", 963 "view.no_xleft", "view.no_xright", "view.no_ytop", "view.no_ybottom", 964 "view.last_x", "view.last_y", "view.last_left", "view.last_right", "view.last_up", "view.last_down", 965 "view.last_b1", "view.last_b2", "view.last_b3", "view.last_b4", 966 "view.last_hp", 967 "view.secrets", "view.kills", "view.tsecrets", "view.tkills", 968 "view.ambient", 969 "view.pointer_x", "view.pointer_y", 970 "view.last_last_x", "view.last_last_y", 971 "view.freeze_time" 952 static char const *vv_names[TVV] = 953 { 954 "view.cx1", "view.cy1", "view.cx2", "view.cy2", 955 "view.shift_down", "view.shift_right", 956 "view.god", 957 "view.player_number", 958 "view.draw_solid", 959 "view.lives", 960 "view.current_weapon", 961 "view.x_suggestion", "view.y_suggestion", 962 "view.b1_suggestion", "view.b2_suggestion", "view.b3_suggestion", "view.b4_suggestion", 963 "view.pan_x", "view.pan_y", 964 "view.no_xleft", "view.no_xright", "view.no_ytop", "view.no_ybottom", 965 "view.last_x", "view.last_y", "view.last_left", "view.last_right", "view.last_up", "view.last_down", 966 "view.last_b1", "view.last_b2", "view.last_b3", "view.last_b4", 967 "view.last_hp", 968 "view.secrets", "view.kills", "view.tsecrets", "view.tkills", 969 "view.ambient", 970 "view.pointer_x", "view.pointer_y", 971 "view.last_last_x", "view.last_last_y", 972 "view.freeze_time" 972 973 }; 973 974 … … 977 978 } 978 979 979 char *get_view_var_name(int num)980 char const *get_view_var_name(int num) 980 981 { return vv_names[num]; } 981 982
Note: See TracChangeset
for help on using the changeset viewer.