long lzw_encode(char *source,void *target,int size) { long bitpos = 0; DOUBLE_S p; int f; clear: old_value = p.group = *source++;size--; while (size-->0) { p.chr = (int)((char)(*source++-old_value));old_value += p.chr; f = find_code(&p); if (f<0) { bitpos = output_code(target,bitpos,bitsize,p.group); add_code(&p); if (nextgroup == (1<<bitsize)) bitsize++; p.group = p.chr; if (nextgroup>= LZW_MAX_CODES) { bitpos = output_code(target,bitpos,bitsize,p.group); bitpos = output_code(target,bitpos,bitsize,clear_code); do_clear_code(); goto clear; } } else p.group = f; } bitpos = output_code(target,bitpos,bitsize,p.group); bitpos = output_code(target,bitpos,bitsize,end_code); return (bitpos+8)>>3; }
void handle_breakpoint(os_context_t *context) { lispobj code; DX_ALLOC_SAP(context_sap, context); fake_foreign_function_call(context); #ifndef LISP_FEATURE_SB_SAFEPOINT unblock_gc_signals(0, 0); #endif code = find_code(context); #ifndef LISP_FEATURE_WIN32 /* Don't disallow recursive breakpoint traps. Otherwise, we can't * use debugger breakpoints anywhere in here. */ thread_sigmask(SIG_SETMASK, os_context_sigmask_addr(context), 0); #endif funcall3(StaticSymbolFunction(HANDLE_BREAKPOINT), compute_offset(context, code), code, context_sap); undo_fake_foreign_function_call(context); }
long lzw_encode(unsigned char *source,void *target,int size) //Encode LZW. zdroj, cil a velikost dat. Vraci velikost komprimovano. { long bitpos = 0; DOUBLE_S p; int f; clear: old_value = p.group = *source++;size--; while (size-->0) { p.chr = (int)((unsigned char)(*source++));old_value += p.chr; f = find_code(&p); if (f<0) { bitpos = output_code_c(target,bitpos,bitsize,p.group); add_code(&p); if (nextgroup == (1<<bitsize)) bitsize++; p.group = p.chr; if (nextgroup>= LZW_MAX_CODES) { bitpos = output_code_c(target,bitpos,bitsize,p.group); bitpos = output_code_c(target,bitpos,bitsize,clear_code); do_clear_code(); goto clear; } } else p.group = f; } bitpos = output_code_c(target,bitpos,bitsize,p.group); bitpos = output_code_c(target,bitpos,bitsize,end_code); return (bitpos+8)>>3; }
void *handle_fun_end_breakpoint(os_context_t *context) { lispobj code, lra; struct code *codeptr; DX_ALLOC_SAP(context_sap, context); fake_foreign_function_call(context); #ifndef LISP_FEATURE_SB_SAFEPOINT unblock_gc_signals(0, 0); #endif code = find_code(context); codeptr = (struct code *)native_pointer(code); #ifndef LISP_FEATURE_WIN32 /* Don't disallow recursive breakpoint traps. Otherwise, we can't * use debugger breakpoints anywhere in here. */ thread_sigmask(SIG_SETMASK, os_context_sigmask_addr(context), 0); #endif funcall3(StaticSymbolFunction(HANDLE_BREAKPOINT), compute_offset(context, code), code, context_sap); lra = codeptr->constants[REAL_LRA_SLOT]; #ifdef LISP_FEATURE_PPC /* PPC now passes LRA objects in reg_LRA during return. Other * platforms should as well, but haven't been fixed yet. */ *os_context_register_addr(context, reg_LRA) = lra; #else #ifdef reg_CODE *os_context_register_addr(context, reg_CODE) = lra; #endif #endif undo_fake_foreign_function_call(context); #ifdef reg_LRA return (void *)(lra-OTHER_POINTER_LOWTAG+sizeof(lispobj)); #else return compute_pc(lra, fixnum_value(codeptr->constants[REAL_LRA_SLOT+1])); #endif }