Novell Home

NSS02

From Developer Community

This code demonstrates how to begin tasks with NSS APIs (NetWare)

Sample Code

#include <stdio.h>
#include <stdlib.h>
#include <zPublics.h>

int main( void) {
  Key_t  root_key;
  NINT   task_id;
  STATUS ccode;
  if (( ccode = zRootKey( 0, &root_key)) != zOK) {
    printf( "zRootKey failed, ccode = %d\n", ccode);
    return EXIT_FAILURE;
  }
  if (( ccode = zBeginTask( root_key, 0, &task_id)) != zOK) {
    zClose( root_key);
    printf( "zBeginTask failed, ccode = %d\n", ccode);
    return EXIT_FAILURE;
  }
  if (( ccode = zEndTask( root_key, task_id)) != zOK) {
    zClose( root_key);
    printf( "zEndTask failed, ccode = %d\n", ccode);
    return EXIT_FAILURE;
  }
  if (( ccode = zClose( root_key)) != zOK) {
    printf( "zClose failed, ccode = %d\n", ccode);
    return EXIT_FAILURE;
  }
  return EXIT_SUCCESS;
}

--Dmitry Mityugov

Novell® Making IT Work As One

© 2008 Novell, Inc. All Rights Reserved.