home *** CD-ROM | disk | FTP | other *** search
/ Network Support Encyclopedia 96-1 / novell-nsepro-1996-1-cd2.iso / download / netware / isojb.exe / ISOBJIN.C next >
Text File  |  1995-01-09  |  5KB  |  165 lines

  1. /****************************************************************************
  2. **   DISCLAIMER  
  3. **
  4. **   Novell, Inc. makes no representations or warranties with respect to
  5. **   any NetWare software, and specifically disclaims any express or
  6. **   implied warranties of merchantability, title, or fitness for a
  7. **   particular purpose.  
  8. **   
  9. **   Distribution of any NetWare software is forbidden without the
  10. **   express written consent of Novell, Inc.  Further, Novell reserves
  11. **   the right to discontinue distribution of any NetWare software.
  12. **   
  13. **   Novell is not responsible for lost profits or revenue, loss of use
  14. **   of the software, loss of data, costs of re-creating lost data, the
  15. **   cost of any substitute equipment or program, or claims by any party
  16. **   other than you.  Novell strongly recommends a backup be made before
  17. **   any software is installed.   Technical support for this software
  18. **   may be provided at the discretion of Novell.
  19. ****************************************************************************
  20. **
  21. **   File:    ISOBJIN.c
  22. **   
  23. **   Desc:    Allows the user to scan the bindery for an object in a set.
  24. **   
  25. **
  26. **   Parameter descriptions:    > input
  27. **                              < output
  28. **
  29. **        
  30. **   Programmers:
  31. **   Init   Who               Firm
  32. **   ------------------------------------------------------------------
  33. **   ARM    A. Ray Maxwell    Novell Developer Support.
  34. **   
  35. **   History:
  36. **       
  37. **   ------------------------------------------------------------------
  38. **   11-10-94    ARM      First code.
  39. */
  40.  
  41. /****************************************************************************
  42. **   Include headers, macros, function prototypes, etc.
  43. */
  44.  
  45. /*------------------------------------------------------------------------
  46. **   ANSI
  47. */
  48.   #include <stdio.h>
  49.   #include <stdlib.h>
  50.   #include <string.h>     /* strupr() strcpy() */
  51.   #include <conio.h>      /* clrscr()            */
  52.   
  53.   /*------------------------------------------------------------------------
  54.   **   NetWare
  55.   */
  56.   #include <nwcalls.h>
  57.   
  58.   /*------------------------------------------------------------------------
  59.   **   Defines
  60.   */
  61.   #define NWDOS
  62.   #define SIZEOFOBJNAME  48
  63.   #define SIZEOFPROPNAME 48
  64.  
  65.  
  66.  
  67. /****************************************************************************
  68. **   Main program start
  69. */
  70. void main(int argc,char *argv[])
  71. {
  72. NWCONN_HANDLE   conn;
  73.  
  74.   NWOBJ_TYPE      objectType,
  75.                   memberType;
  76.     
  77.   NWOBJ_ID        objectID;
  78.   NWCCODE         ccode;
  79.   CONNECT_INFO    connInfo;
  80.   NWSTRUCT_SIZE   connInfoSize;
  81.   char            objectName[SIZEOFOBJNAME];
  82.   char              servername[SIZEOFOBJNAME];
  83.   char            memberName[SIZEOFOBJNAME];
  84.   char            propertyName[SIZEOFPROPNAME];
  85.  
  86.  
  87.   ccode=NWCallsInit(NULL,NULL);
  88.   if (ccode)
  89.     exit(1);
  90.   
  91.   if (argc > 1){
  92.     argv++;
  93.     strcpy(servername,strupr(*argv));
  94.     if (argc > 2){
  95.     argv++;
  96.     strcpy(objectName,strupr(*argv));
  97.     }
  98.   
  99.     if (argc > 3) {
  100.        ++argv;
  101.        objectType = (NWWordSwap)(atoi(*argv));
  102.     }
  103.     if (argc > 4) {
  104.        argv++;
  105.        strcpy(propertyName,strupr(*argv));
  106.     }
  107.     if (argc > 5) {
  108.        argv++;
  109.        strcpy (memberName,strupr(*argv));
  110.     }
  111.     if (argc > 6) {
  112.        argv++;
  113.        memberType = (NWWordSwap)(atoi(*argv));
  114.     }
  115.   
  116.   }
  117.   else {
  118.     clrscr();
  119.     printf ("USAGE: ISOBJIN <server name><object name><object type>\n");
  120.     printf ("       <property name><member Name><member Type>\n");
  121.     printf ("       servername=name of the NetWare server.\n");
  122.     printf ("       object name= like EVERYONE etc\n");
  123.     printf ("       object type= 2 for OT_USER_GROUP 1,2,3, etc.\n");
  124.     printf ("       property Name= GROUP_MEMBERS etc.\n");
  125.     printf ("       member Name= The member of property <username>.\n");
  126.     printf ("       member type= 1,2,3, bindery object type.\n");
  127.     printf ("EXAMPLE: isobjin moiraine EVERYONE 2 GROUP_MEMBERS RAY 1 \n");
  128.  
  129.   exit(1);
  130. }
  131.  
  132.   ccode=NWCallsInit(NULL,NULL);
  133.  
  134.   ccode = NWGetConnectionHandle(
  135.            /* > servername        */ servername,
  136.            /*   Novell Reserved1  */ 0,
  137.            /* < connection Handle */ &conn,
  138.            /*   Novell Reserved2  */ NULL);
  139.  
  140.  
  141.   ccode = NWGetConnectionStatus(
  142.            /* > connection Handle        */ conn,
  143.            /* < pointer to CONNECT_INFO  */ &connInfo,
  144.            /* > size of connStatusBuffer */ connInfoSize);
  145.  
  146.   if (ccode)
  147.       exit(1);
  148.  
  149.   ccode = NWIsObjectInSet(
  150.            /* > connection Handle     */ conn,
  151.            /* > Object Name           */ objectName,
  152.            /* > Object Type           */ objectType,
  153.            /* > Property Name         */ propertyName,
  154.            /* > Member Name           */ memberName,
  155.            /* > Member Type           */ memberType);
  156.  
  157.   if (ccode){
  158.      printf("NWIsObjectInSet failed error: %X\n",ccode);
  159.      exit(1);
  160.   }
  161.   else
  162.      printf("NWIsObjectInSet worked with %X\n",ccode);
  163. }
  164.                                                                                                                                
  165.