; Header File ; Created 14/10/2004; 15:52:16 conflib@0000: ;long conflib::get_num_key(const char *file, const char *key, long default, const short *error) movem.l a0-a6/d1-d7,-(a7) move.l 200,a5 lea (7+7)*4+4(a7),a0 move.l (a0)+,a6; char *file move.l (a0)+,a1; char *section bsr write_section move.l (a0)+,a4; char *key move.l (a0)+,d7; long default move.l (a0)+,a3; short *error bsr get_file move.w d0,d6 beq \file_not_found bsr deref addq.l #5,a0 \loop: tst.b (a0) beq \key_not_found move.l a0,a2 bsr match_key cmp.b #1,_section_is_good bne \skip_section tst.w d0 bne \found \skip_section: bsr next_key move.l a0,d0 bne \loop \key_not_found: moveq #CONFLIB_KEY_NOT_FOUND,d1 bra \exit_on_error \exit: move.l a3,d2 beq \skip move.w d1,(a3) \skip: movem.l (a7)+,a0-a6/d1-d7 rts \found: bsr is_valid_num move.l a0,d1 beq \key_invalid moveq #conflib_OK,d1 bra \exit \key_invalid: moveq #3,d1 bra \exit_on_error \file_not_found: moveq #CONFLIB_FILE_NOT_FOUND,d1 \exit_on_error: move.l d7,d0 bra \exit