Chapter Contents

Previous

Next
osdltok

osdltok



Delete a token associated with a given name

Portability: SASC


SYNOPSIS
DESCRIPTION
RETURN VALUE
IMPLEMENTATION
EXAMPLE
RELATED FUNCTIONS


SYNOPSIS

#include <osnamtok.h>	
int osdltok(char _ _near *name);


DESCRIPTION

The osdltok function uses a name (up to 16 characters) to delete the associated token. Although IEANTDL can be called in assembler with the bytes of the name consisting of any value, this function expects the name to be a null-terminated character string. The actual name passed to the IEANTDL service will consist of the character string truncated to 16 bytes, or padded with blanks. IBM has reserved names starting with the letters A through I (uppercase) and the null character ('\0'). The level of the name/token will be 2 (home).


RETURN VALUE

osdltok returns either -1 if the service cannot be called or the return value from the service.


IMPLEMENTATION

The osdltok function is implemented by the source module L$UNMTK.


EXAMPLE

This SPE example retrieves the address of storage that had previously been allocated in another task and then frees it.

#include <osnamtok.h>
#include <getmain.h>
#include <oswto.h>

char *name = "Z Global"; 

typedef struct
{
	    char eye[16];			// eyecatcher
	    long long lock;			// lockword
	    char *data;				// data chain
} GLOBAL, *PGLOBAL;


void osmain()
{
		PGLOBAL pGlobal;
     char token[16];
	   int rc;

	   if ((rc = osgttok(name, token)) != 0)
	   {
		      WTP("osgttok failed.");
 		      return;
	   }
	   memcpy(&pGlobal, token, 4);	// only the first 4 bytes of
						                 //  the token are used.
	   if (strcmp(pGlobal->eye, "Z Global EYE")
	   {
		     WTP("Global storage corrupt.");
		     return;
	   }

	   // now delete the token

	   if ((rc = osdltok(name)) != 0)
	   {
		     WTP("osdltok failed.");
 		     return;
	   }

	   // and free the common storage

	   FREEMAIN(pGlobal, sizeof(GLOBAL), 131, UNCOND);  

}


RELATED FUNCTIONS

ossttok, osgttok


Chapter Contents

Previous

Next

Top of Page

Copyright © 2004 by SAS Institute Inc., Cary, NC, USA. All rights reserved.