"Fossies" - the Fresh Open Source Software Archive

Member "dosemu-1.4.0/src/plugin/commands/builtins.h" (24 Oct 2006, 1804 Bytes) of package /linux/misc/old/dosemu-1.4.0.tgz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "builtins.h" see the Fossies "Dox" file reference documentation.

    1 #ifndef __BUILTINS_H
    2 #define __BUILTINS_H
    3 
    4 #include "emu.h"
    5 #include "bios.h"
    6 #include "dos2linux.h"
    7 
    8 #define COM_PSP_SEG (REG(es))
    9 #define COM_PSP_ADDR    ((struct PSP *)LINEAR2UNIX(SEG2LINEAR(COM_PSP_SEG)))
   10 
   11 typedef int com_program_type(int argc, char **argv);
   12 
   13 struct com_program_entry {
   14     struct com_program_entry *next;
   15     char * name;
   16     com_program_type *program;
   17 };
   18 
   19 struct  REGPACK {
   20     unsigned short r_ax, r_bx, r_cx, r_dx;
   21     unsigned short r_bp, r_si, r_di, r_ds, r_es, r_flags;
   22 } __attribute__((packed));
   23 #define REGPACK_INIT (regs_to_regpack(&_regs))
   24 
   25 struct WORDREGS {
   26     unsigned short ax, bx, cx, dx, si, di, cflag, flags;
   27 } __attribute__((packed));
   28 
   29 struct BYTEREGS {
   30     unsigned char al, ah, bl, bh, cl, ch, dl, dh;
   31 } __attribute__((packed));
   32 
   33 union com_REGS {
   34     struct WORDREGS x;
   35     struct BYTEREGS h;
   36 } __attribute__((packed));
   37 
   38 struct SREGS {
   39     unsigned short es;
   40     unsigned short cs;
   41     unsigned short ss;
   42     unsigned short ds;
   43 } __attribute__((packed));
   44 
   45 /* ============= libc equlivalents ============== */
   46 
   47 #define com_stdin   0
   48 #define com_stdout  1
   49 #define com_stderr  2
   50 
   51 int com_error(char *format, ...);
   52 char *com_getenv(char *keyword);
   53 int com_system(char *command, int quit);
   54 char * com_strdup(char *s);
   55 unsigned short get_dos_ver(void);
   56 void com_strfree(char *s);
   57 int com_dosgetdrive(void);
   58 int com_dossetdrive(int drive);
   59 int com_dossetcurrentdir(char *path);
   60 void com_intr(int intno, struct REGPACK *regpack);
   61 void call_msdos(void);
   62 void call_msdos_interruptible(void);
   63 char *lowmem_alloc(int size);
   64 void lowmem_free(char *p, int size);
   65 void register_com_program(char *name, com_program_type *program);
   66 char *skip_white_and_delim(char *s, int delim);
   67 struct REGPACK regs_to_regpack(struct vm86_regs *regs);
   68 struct vm86_regs regpack_to_regs(struct REGPACK *regpack);
   69 
   70 extern int com_errno;
   71 
   72 #endif