Open dataset – HP XP P9500 Storage User Manual

Page 138

Advertising
background image

• When this function ends abnormally, it returns a 0. For further information, see

Chapter

7

on page 149.

Example:

void *memptr;

/* global memory area */

long err;

/* global err information */

int retcode;

:

retcode = dataset_AllocGlobal(&memptr, &err, malloc, free);

:

retcode = dataset_FreeGlobal(&memptr, &err)

Open Dataset

Format: datasetError=dataset_Open(global,g_error,devname,dsname,voltype,mode)

Table 53 Arguments, Types, and Descriptions for Open Dataset

Description

Type

Argument

Global memory area

void

1

global

An error information stored area

long

1

g_error

raw device name

char

1

devname

dataset name

char

1

dsname

volume emulation type

char

1

voltype

open mod

char

1

mode

long

datasetError

Return value:

Abnormal end

-1

1

When you issue this function, you must issue dataset_ Close() in the end process.

You must issue this function before dataset_Open(), Get(), dataset_Get2(), dataset_Put(),
dataset_Put2()

, dataset_Rewind(), and dataset_GetFileInformation().

This function opens a specified dataset (file) with a specified open mode.

Argument:
• global: Global memory area (specify a global memory area gotten by dataset_AllocG-

lobal

).

• g_error: Specify an address to store FAL error code.
• devname: Raw device name (special file).
• dsname: Dataset name.
• voltype: Device emulation type (3390-3A/9A/LA, 3390-3B/9B/LB, 3380-3A, and 3380-

3B).

• mode: “r”: Read only, “w” Write only
• Return Value: When this function ends abnormally, it returns -1.

Example:

Performing FAL Operations

138

Advertising