Changeset 1488
- Timestamp:
- 12/15/11 13:19:56 (18 months ago)
- Location:
- branches/reyalp-flt
- Files:
-
- 11 edited
-
CHDK/Makefile (modified) (1 diff)
-
Makefile (modified) (1 diff)
-
core/gui_menu.h (modified) (1 diff)
-
core/module_load.c (modified) (1 diff)
-
core/module_load.h (modified) (3 diffs)
-
core/modules/Makefile (modified) (1 diff)
-
include/lang.h (modified) (1 diff)
-
lib/lang/lang.c (modified) (4 diffs)
-
tools/elf2flt/elfflt.c (modified) (1 diff)
-
tools/elf2flt/flt.h (modified) (1 diff)
-
tools/elf2flt/fltdump.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/reyalp-flt/CHDK/Makefile
r1007 r1488 28 28 clean: 29 29 rm -f $(GENLUA) 30 rm -f MODULES/*.flt 30 31 31 32 include $(topdir)bottom.inc -
branches/reyalp-flt/Makefile
r1481 r1488 11 11 firsub: all 12 12 mkdir -p $(topdir)bin 13 mkdir -p $(topdir)CHDK/MODULES 13 14 cp $(topdir)loader/$(PLATFORM)/main.bin $(topdir)bin/main.bin 14 15 ifndef NOZERO100K -
branches/reyalp-flt/core/gui_menu.h
r1467 r1488 50 50 typedef struct { 51 51 char symbol; 52 shorttitle;52 int title; 53 53 void (*on_change)(unsigned int item); 54 54 const CMenuItem *menu; -
branches/reyalp-flt/core/module_load.c
r1483 r1488 109 109 strcpy(tgt,name); 110 110 else 111 sprintf(tgt," A/CHDK/MODULES/%s",name);111 sprintf(tgt,"%s/%s",MODULES_PATH,name); 112 112 } 113 113 -
branches/reyalp-flt/core/module_load.h
r1483 r1488 8 8 // This is main CHDK trunk 9 9 #define CURRENT_CHDK_BRANCH 1 10 11 #define MODULES_PATH "A/CHDK/MODULES" 12 13 14 // Base typedefs 15 //------------------- 10 16 11 17 #define EXPORTLIST_MAGIC_NUMBER 0x43215678 … … 22 28 }; 23 29 30 31 // Common module functions 32 //------------------------- 33 24 34 int module_check_is_exist(char* name); 25 35 int module_find(char * name ); … … 32 42 void module_set_flags(unsigned int idx, char value); 33 43 44 void* module_get_adr(unsigned int idx); 45 46 47 // Asynchronous unloading 48 //------------------------- 34 49 void module_async_unload(unsigned int idx); 35 50 void module_async_unload_allrunned(int enforce); 36 51 void module_tick_unloader(); 37 52 38 void* module_get_adr(unsigned int idx); 39 40 53 // In-module binding to conf. 54 //--------------------------- 41 55 #define CONF_BIND_INT(idConf,var) if ( conf_getValue(idConf, &configVal) == CONF_VALUE ) { var = configVal.pInt; } else { return 1;} 42 56 #define CONF_BIND_COLOR(idConf,var) if ( conf_getValue(idConf, &configVal) == CONF_VALUE ) { var = (color*)configVal.pInt; } else { return 1;} -
branches/reyalp-flt/core/modules/Makefile
r1483 r1488 134 134 135 135 clean: 136 rm -f *.o *.elf.syms *.elf $(OBJS) $(OPT_OBJS)136 rm -f *.o *.elf.syms *.elf *.flt $(OBJS) $(OPT_OBJS) 137 137 138 138 distclean: clean -
branches/reyalp-flt/include/lang.h
r1393 r1488 5 5 extern void lang_init(int num); 6 6 7 extern void lang_parse_from_mem(char *buf);8 7 extern void lang_load_from_file(const char *filename); 9 8 extern void lang_map_preparsed_from_mem( char* gui_lang_default, int num ); 10 9 11 typedef void (*callback_process_file)(char* buf);12 extern voidload_from_file(const char *filename, callback_process_file callback) ;10 typedef int (*callback_process_file)(char* buf, int size); 11 extern int load_from_file(const char *filename, callback_process_file callback) ; 13 12 14 13 extern char* lang_str(int str); -
branches/reyalp-flt/lib/lang/lang.c
r1393 r1488 69 69 // buf - source array (content of file.lng ) 70 70 //------------------------------------------------------------------- 71 void lang_parse_from_mem(char *buf) {71 int lang_parse_from_mem(char *buf, int size) { 72 72 char *p, *s, *e; 73 73 int i; 74 75 if ( size <= 0 ) 76 return 0; 74 77 75 78 e = buf-1; … … 95 98 } 96 99 } 100 return 1; 97 101 } 98 102 … … 116 120 } 117 121 118 122 // PURPOSE: 119 123 // Universal file processor 120 124 // Load file, process by callback, unalloc/close file 125 // RETURN: 126 // Transfer return value from callback 127 // NOTE: 128 // Call callback even if fail to load/malloc (size=-1 if no file, size=0 if empty) 121 129 //------------------------------------------------------------------- 122 voidload_from_file(const char *filename, callback_process_file callback)130 int load_from_file(const char *filename, callback_process_file callback) 123 131 { 124 132 int f, size; … … 126 134 char *buf; 127 135 136 buf = 0; 137 size = -1; 138 128 139 f = open(filename, O_RDONLY, 0777); 129 if (f>=0) {140 if (f>=0) 130 141 size = (stat((char*)filename, &st)==0)?st.st_size:0; 131 if (size) {142 if (size>0 ) 132 143 buf = umalloc(size+1); 133 144 if (buf) { 134 145 size = read(f, buf, size); 135 146 buf[size]=0; 136 callback(buf); 147 } 148 149 size = callback( buf, size); 150 151 if ( buf ) 137 152 ufree(buf); 138 } 139 } 153 if (f>=0) 140 154 close(f); 141 } 155 156 return size; 142 157 } 143 158 -
branches/reyalp-flt/tools/elf2flt/elfflt.c
r1483 r1488 698 698 printf("\n"); 699 699 } 700 printf("->Module Info: %s\n", get_flat_string(_module_info-> ModuleInfo) );700 printf("->Module Info: %s\n", get_flat_string(_module_info->description) ); 701 701 } 702 702 -
branches/reyalp-flt/tools/elf2flt/flt.h
r1483 r1488 96 96 int32_t moduleName; // pointer to string with module name or -LANG_ID 97 97 uint16_t major_ver, minor_ver; 98 int32_t ModuleInfo;98 int32_t description; // pointer to string with module description 99 99 }; 100 100 -
branches/reyalp-flt/tools/elf2flt/fltdump.c
r1483 r1488 159 159 printf("\n"); 160 160 } 161 printf("->Module Info: %s\n", get_flat_string(_module_info-> ModuleInfo) );161 printf("->Module Info: %s\n", get_flat_string(_module_info->description) ); 162 162 } 163 163
Note: See TracChangeset
for help on using the changeset viewer.