119 lines
7.6 KiB
HTML
119 lines
7.6 KiB
HTML
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||
|
<html>
|
||
|
<head>
|
||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||
|
<meta name="Copyright" content="Copyright (c) 2006 by IBM Corporation">
|
||
|
<title>Standard HFS API and Exit Program Functions</title>
|
||
|
<!-- All rights reserved. Licensed Materials Property of IBM -->
|
||
|
<!-- US Government Users Restricted Rights -->
|
||
|
<!-- Use, duplication or disclosure restricted by -->
|
||
|
<!-- GSA ADP Schedule Contract with IBM Corp. -->
|
||
|
<!-- Change History: -->
|
||
|
<!-- YYMMDD USERID Change description -->
|
||
|
<!--File Edited November 2001 -->
|
||
|
<link rel="stylesheet" type="text/css" href="../rzahg/ic.css">
|
||
|
</head>
|
||
|
<body>
|
||
|
<!--End Header Records -->
|
||
|
<!--Java sync-link-->
|
||
|
<script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
|
||
|
|
||
|
<h2>Standard HFS API and Exit Program Functions</h2>
|
||
|
|
||
|
<p>The HFS APIs and the file system's exit programs share the responsibility for validating input data, performing the functions requested by the application, reporting errors, and so on. The two sections that follow describe the standard functions that the HFS APIs perform for you and the standard functions that your exit programs must perform. A few APIs perform additional functions, and a few exit programs have additional requirements; these additions are listed at the end of each exit program description.</p>
|
||
|
|
||
|
<br>
|
||
|
<h3><a name="HDRSTDAPI">Standard HFS API Functions</a></h3>
|
||
|
|
||
|
<p>This section describes the functions that the HFS APIs and HFS support perform for your file system. When an application calls an HFS API, it appears to the application that the HFS API performs all the resulting functions. In reality, the API and HFS support perform only some of the functions. The file system exit program performs the rest.</p>
|
||
|
|
||
|
<p>Use this information to plan and create exit programs to support the HFS APIs in new file systems. You do not need this information to use the HFS APIs in your applications.</p>
|
||
|
|
||
|
<p>In general, every HFS API performs these functions for your file system:</p>
|
||
|
|
||
|
<ul>
|
||
|
<li>Automatically calls the file system's Start Job Session exit program the first time a job refers to the file system in a call to an HFS API. For a detailed explanation, see <a href="xstjbssn.htm">Start Job Session Exit Program</a>.<br><br></li>
|
||
|
|
||
|
<li>Processes the path name parameter as follows:
|
||
|
<ul>
|
||
|
<li>Extracts the file system name from the path name parameter.</li>
|
||
|
<li>Verifies that the file system is registered for use with the HFS APIs.</li>
|
||
|
<li>Passes the part of the path name that follows the file system name to the file system. For example, if the path name received from the application is /QDLS/A/B/C, then /A/B/C is passed to file system QDLS.
|
||
|
|
||
|
<p>There is one exception to this: The Open Directory (QHFOPNDR) API allows jobs to open the directory representing the file system itself. In that case, the path name consists of a slash and a single element, such as /QDLS, and the API passes just the slash (/) to the file system.</p></li>
|
||
|
|
||
|
<li>Recomputes the length of the path name by subtracting the length of the extracted file system name, and passes the new length to the file system.</li>
|
||
|
<li>Verifies that there is at least one valid byte (the leading /) in the rest of the path name parameter.</li>
|
||
|
</ul><br></li>
|
||
|
|
||
|
<li>Verifies that a directory or file handle passed from the application to the API is valid, and looks up the corresponding directory or file handle to pass from the API to the file system.<br><br></li>
|
||
|
|
||
|
<li>Verifies that API parameters contain allowable values, and that reserved portions are set to blanks. API parameters include all fixed-length character fields like the open information parameter of the Open Stream File (QHFOPNSF) API.<br><br></li>
|
||
|
|
||
|
<li>Verifies that length parameters contain allowable values. These length parameters are verified:<br><br>
|
||
|
|
||
|
<ul>
|
||
|
<li>Length of attribute selection table</li>
|
||
|
<li>Length of attribute information table</li>
|
||
|
<li>Length of data buffer to read directory entries into</li>
|
||
|
</ul>
|
||
|
|
||
|
<li>Verifies that numeric or counting parameters contain a valid value. These parameters are verified:<br><br>
|
||
|
|
||
|
<ul>
|
||
|
<li>Number of directory entries to read</li>
|
||
|
<li>Number of bytes to read</li>
|
||
|
<li>Number of bytes to write</li>
|
||
|
</ul><br></li>
|
||
|
|
||
|
<li>Calls the appropriate file system exit program to perform the operation.<br><br></li>
|
||
|
|
||
|
<li>Monitors for valid exceptions from the file system, and either returns these to the application or maps them into an error code, as the application requests in the API's error code parameter.<br><br></li>
|
||
|
|
||
|
<li>Signals successful completion of the operation to the application by not returning any errors.<br><br></li>
|
||
|
|
||
|
<li>Returns control to the application.</li>
|
||
|
</ul>
|
||
|
|
||
|
<br>
|
||
|
<h3><a name="HDRSTDFS">Standard HFS Exit Program Requirements</a></h3>
|
||
|
|
||
|
<p>In general, every exit program you provide to support an HFS API must perform these functions:</p>
|
||
|
|
||
|
<ul>
|
||
|
<li>Verifies that the application has authority to perform the request ed operation on the specified objects.<br><br></li>
|
||
|
|
||
|
<li>Verifies that parameter values meet the file system's criteria.<br><br></li>
|
||
|
|
||
|
<li>Verifies that directories and files named in the path name parameter either exist in the file system or, during operations like create and rename, that new names conform to the file system's naming conventions.
|
||
|
|
||
|
<p>The path name that the API passes to the file system does not include the file system's name but only the rest of the path name. If an application calls the Open Directory (QHFOPNDR) API and passes a path name specifying only the directory consisting of the file system, such as /QDLS, the API passes only the slash (/) to the file system.</p></li>
|
||
|
|
||
|
<li>Maintains API INPUT parameters as is, without changing their contents. If the file system must change these parameters, it must move them to another storage location. INPUT parameters must have the same value on entry to the file system exit program as on exit from the exit program. The file system can change OUTPUT parameters when the requested operation succeeds.<br><br></li>
|
||
|
|
||
|
<li>Accepts attributes in the attribute selection and information tables used by HFS support, validates the data contained in the tables, and returns the appropriate data in the appropriate format.
|
||
|
|
||
|
<p>HFS support uses two common formats for passing attribute information between the application and the file system. These formats are described in <a href="hfs1c.htm#HDRATTSEL">AFS Attribute Selection Table</a> and <a href="hfs1c.htm#HDRATTTAB">HFS Attribute Information Table</a>.</p></li>
|
||
|
|
||
|
<li>Performs the requested operation and returns any requested status information or data to the API.<br><br></li>
|
||
|
|
||
|
<li>If the operation does not succeed, returns an exception describing the error to the API.
|
||
|
|
||
|
<p>The file system should return only the exceptions defined for the API because HFS support monitors only for those messages. If the file system sends any other message, the message <samp>Internal file system error occurred</samp> is returned to the application.</p>
|
||
|
|
||
|
<p>If the file system needs to send its own messages, it can use the message <samp>Exception specific to file system occurred</samp> defined for each API. The file system's message ID is sent as insert data.</p></li>
|
||
|
</ul>
|
||
|
|
||
|
<hr>
|
||
|
<center>
|
||
|
<table cellpadding="2" cellspacing="2">
|
||
|
<tr align="center"><td valign="middle" align="center">
|
||
|
<a href="#Top_Of_Page">Top</a>
|
||
|
| <a href="hfs1.htm">Hierarchical File System APIs</a>
|
||
|
| <a href="aplist.htm">APIs by category</a>
|
||
|
</td></tr>
|
||
|
</table>
|
||
|
</center>
|
||
|
<br>
|
||
|
</body></html>
|