Annotation of pmsdk/samples/newcard/pmdiff.c, revision 1.1.1.1

1.1       root        1: #include "cardfile.h"
                      2: 
                      3: /*********************************************************************/
                      4: /*  Windows/PM Cardfile Shared Code                                  */
                      5: /*                                                                   */
                      6: /*  (c) Copyright Microsoft Corp. 1987,1988 - All Rights Reserved    */
                      7: /*********************************************************************/
                      8: 
                      9: 
                     10: /*********************************************************************/
                     11: /* This file contains routines which were present in the Windows     */
                     12: /* version in assembly language, but which utilize system interrupts */
                     13: /* and can't be written as shared code.                              */
                     14: /*********************************************************************/
                     15: 
                     16: 
                     17: int   Frename( SrcName, DestName )
                     18: PSTR  SrcName;
                     19: PSTR  DestName;
                     20: {
                     21:    return( DosMove( SrcName, DestName, 0L ) );
                     22: }
                     23:    
                     24: 
                     25: int FAR Fdelete( FileName )
                     26: PSTR  FileName;
                     27: {
                     28:    return( DosDelete( FileName, (DWORD) 0 ) );
                     29: }
                     30: 
                     31: 
                     32: int   mylread( Handle, Buffer, NumBytes )
                     33: int   Handle;
                     34: LPSTR Buffer;
                     35: int   NumBytes;
                     36: {
                     37:    int   Temp;
                     38: 
                     39:    return( DosRead( Handle, Buffer, NumBytes, &Temp ) );
                     40: }
                     41: 
                     42: 
                     43: int   myread( Handle, Buffer, NumBytes )
                     44: int   Handle;
                     45: PSTR  Buffer;
                     46: int   NumBytes;
                     47: {
                     48:    int   Temp;
                     49: 
                     50:    return( DosRead( Handle, Buffer, NumBytes, &Temp ) );
                     51: }   
                     52: 
                     53: 
                     54: int   mylwrite( Handle, Buffer, NumBytes )
                     55: int   Handle;
                     56: LPSTR Buffer;
                     57: int   NumBytes;
                     58: {
                     59:    int   NumWritten;
                     60: 
                     61:    if (DosWrite( Handle, Buffer, NumBytes, &NumWritten ))
                     62:       return( -1 );
                     63:    else 
                     64:       return( NumWritten );
                     65: }
                     66: 
                     67: 
                     68: int   mywrite( Handle, Buffer, NumBytes )
                     69: int   Handle;
                     70: PSTR  Buffer;
                     71: int   NumBytes;
                     72: {
                     73:    int   NumWritten;
                     74: 
                     75:    if (DosWrite( Handle, Buffer, NumBytes, &NumWritten ) )
                     76:       return( -1 );
                     77:    else
                     78:       return( NumWritten );
                     79: }
                     80: 
                     81: 
                     82: int FAR MyOpen( FileName, mode )
                     83: LPSTR FileName;
                     84: int   mode;
                     85: {
                     86:    int   Action, Handle;
                     87: 
                     88:    if (DosOpen( FileName, (PHFILE) &Handle, &Action, 50L, 0, 1, mode, 0L ))
                     89:       return( -1 );
                     90:    else
                     91:       return( Handle );
                     92: }
                     93: 
                     94: 
                     95: void FAR MyClose( Handle )
                     96: int   Handle;
                     97: {
                     98:    DosClose( Handle );
                     99: }
                    100: 
                    101: 
                    102: long FAR MyLseek( Handle, Offset, mode )
                    103: int   Handle;
                    104: long  Offset;
                    105: int   mode;
                    106: {
                    107:    long  NewOffset;
                    108: 
                    109:    if (DosChgFilePtr( Handle, Offset, mode, &NewOffset ))
                    110:       return( -1 );
                    111:    else
                    112:       return( NewOffset );
                    113: }
                    114: 
                    115: 
                    116: 
                    117: 
                    118: 

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.