home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 2 BBS / 02-BBS.zip / FHEXP.ZIP / ARGS.C next >
Text File  |  1992-11-22  |  925b  |  38 lines

  1. /* this program displays the arguments passed to it */
  2. /* Author: LaVern R. Ogden */
  3. /*   Date: 11/22/92 */
  4.  
  5. #define INCL_DOSFILEMGR
  6.  
  7. #include <os2.h>
  8. #include <stdio.h>
  9.  
  10.  
  11. void main(int argc, char *argv[]) {
  12.   int index;
  13.   LONG ReqCount;  /* number to add to maximum handle count */
  14.   ULONG CurMaxFH; /* new count of handles */
  15.   APIRET rc;      /* return code */
  16.  
  17.   printf("Argument count is %d\n",argc);
  18.  
  19.   for (index=1;index<argc;index++) {
  20.     printf("Argument %d is %s\n",index,argv[index]);
  21.   }
  22.  
  23.   ReqCount=0;
  24.   rc=DosSetRelMaxFH(&ReqCount,&CurMaxFH);
  25.         /* on successful return, the CurMaxFH */
  26.         /*   variable will contain the total */
  27.         /*   number of allocated file handles */
  28.         /*   for this process */
  29.  
  30.   if (rc!=0) {
  31.     printf("DosSetRelMaxFH error: return code = %ld",rc);
  32.     return;
  33.   }
  34.  
  35.   printf("Number of available handles: %d\n",CurMaxFH);
  36. }
  37.  
  38.