home *** CD-ROM | disk | FTP | other *** search
- /*
- * CopyRight 1995. Nicholas Poljakov all rights reserved.
- */
- #include <malloc.h>
- #include <stdio.h>
- #include <dos.h>
- #include <flush.h>
- #include <state1.h>
- flush (tp_id,
- conv_id,
- p_rc)
- unsigned char tp_id[8];
- unsigned long conv_id;
-
- struct rc {
- unsigned int prim ;
- unsigned long sec ; } *p_rc;
-
- {
- union REGS inregs,outregs;
- struct SREGS segregs;
- struct flush *ptr;
- char _near *dp1;
- char _near *dp2;
- int l;
-
- l = sizeof(struct flush);
- if ((ptr = (char *)calloc(1,l)) == NULL) {
- p_rc->prim = PORT_BUSY; /* ¡ÑΓ ñ«ßΓπ»¡«⌐ »á¼∩Γ¿ */
- p_rc->sec = 0x00;
- return(0);
- }
-
- ptr->code=Flush; /* verb code */
- ptr->e_cd=0x0000; /* ex */
-
- memcpy (ptr->tp_id,tp_id,8);
-
- ptr->conv_id = conv_id;
- dp1 = FP_OFF( ptr );
- dp2 = FP_SEG( ptr );
- _asm
- {
- push ds
- mov dx, word ptr dp1[0]
- mov ax, word ptr dp2[0]
- mov ds, ax
- mov ax, Flush
- int 68h
- pop ds
- }
-
- p_rc->prim = ptr->prim_rc;
- p_rc->sec = ptr->sec_rc;
- free(ptr);
- return(0);
- }
-