home *** CD-ROM | disk | FTP | other *** search
/ Piper's Pit BBS/FTP: ibm 0020 - 0029 / ibm0020-0029 / ibm0028.tar / ibm0028 / GRLF-C-2.ZIP / GFUNC / SETPRSU.ASM < prev    next >
Encoding:
Assembly Source File  |  1990-05-30  |  2.4 KB  |  107 lines

  1. ;/*
  2. ;** setprsu.asm
  3. ;** contains:    setprsup(), getprsup()
  4. ;*/
  5.  
  6. SETPRINTERSETUP     equ    05e02h        ;Set Printer setup function
  7. GETPRINTERSETUP     equ    05e03h        ;Get Printer setup function
  8. DOSCALL         equ    021h        ;DOS Software Interrupt
  9.  
  10.         include model.h
  11.         include prologue.h
  12.  
  13.         pseg    cSetPrinterSetup
  14.  
  15. ;/*
  16. ;**  int
  17. ;** setprsup(int index, int stringlength, char *string)
  18. ;**
  19. ;** ARGUMENT(s)
  20. ;**    index    -    Redirection list index.
  21. ;**    stringlength -    Length of setup string (maximum length is 64 bytes).
  22. ;**    string         -    Pointer to printer setup string.
  23. ;**
  24. ;** DESCRIPTION
  25. ;**  Specifies an initial string for printer files.  The IBM PC
  26. ;**  Network Program must be loaded for the function call to execute
  27. ;**  properly.
  28. ;**
  29. ;** RETURNS
  30. ;**  0 if successful, else a DOS error code
  31. ;**
  32. ;** AUTHOR
  33. ;**  ""   Fri 11-Nov-1988    16:19:24
  34. ;**   Copyright (C)1988-1990 Greenleaf Software Inc. All Rights Reserved.
  35. ;**
  36. ;** MODIFICATIONS
  37. ;**
  38. ;*/
  39.         cproc    setprsup
  40.         mov    ax,SETPRINTERSETUP    ;ax=dos function number
  41.         mov    bx,parm1_        ;bx=index
  42.         mov    cx,parm2_        ;cx=length of string
  43.         if    _LDATA
  44.          push    ds
  45.          lds    si,parm3_        ;DS:SI points to buffer
  46.         else
  47.          mov    si,parm3_        ;DS:SI points to buffer
  48.         endif
  49.         int    DOSCALL
  50.         jc    setprtexit        ;if error leave with it
  51.         xor    ax,ax            ;else indicate success
  52. setprtexit:
  53.         cproce
  54.  
  55.  
  56. ;/*
  57. ;**  int
  58. ;** getprsup(int index, int *stringlength, char *string)
  59. ;**
  60. ;** ARGUMENT(s)
  61. ;**    index    -    Redirection list index.
  62. ;**    stringlength -    Pointer to variable to receive length of string.
  63. ;**    string         -    Pointer to variable to receive string. (Maximum
  64. ;**            possible length is 64 bytes).
  65. ;**
  66. ;** DESCRIPTION
  67. ;**  Returns the printer setup string for printer files.  The IBM PC
  68. ;**  Network Program must be loaded for the function call to execute
  69. ;**  properly.
  70. ;**
  71. ;** RETURNS
  72. ;**  0 if successful, else a DOS error code
  73. ;**
  74. ;** AUTHOR
  75. ;**  "" Fri 11-Nov-1988 16:19:24
  76. ;**   Copyright (C)1988-1990 Greenleaf Software Inc. All Rights Reserved.
  77. ;**
  78. ;** MODIFICATIONS
  79. ;**
  80. ;*/
  81.         cproc    getprsup
  82.         mov    ax,GETPRINTERSETUP    ;ax=dos function number
  83.         mov    bx,parm1_        ;bx=index
  84.         if    _LDATA
  85.          push    ds
  86.          lds    di,parm4_
  87.         else
  88.          mov    di,parm3_
  89.         endif
  90.         int    DOSCALL         ;call dos
  91.         jc    getexit
  92.         if    _LDATA
  93.          lds    bx,parm2_
  94.         else
  95.          mov    bx,parm2_
  96.         endif
  97.         mov    [bx],cx         ;save length
  98.         xor    ax,ax            ;indicate success
  99. getexit:
  100.         if    _LDATA
  101.          pop    ds
  102.         endif
  103.         cproce
  104.  
  105.         endps
  106.         end
  107.