<!-- $XConsortium: f_reques.sgm /main/5 1996/08/30 14:29:08 rws $ -->
<!-- (c) Copyright 1995 Digital Equipment Corporation. -->
<!-- (c) Copyright 1995 Hewlett-Packard Company. -->
<!-- (c) Copyright 1995 International Business Machines Corp. -->
<!-- (c) Copyright 1995 Sun Microsystems, Inc. -->
<!-- (c) Copyright 1995 Novell, Inc. -->
<!-- (c) Copyright 1995 FUJITSU LIMITED. -->
<!-- (c) Copyright 1995 Hitachi. -->

<![ %CDE.C.CDE; [<RefEntry Id="CDEMX.XCDI.MAN262.rsml.1">]]>
<![ %CDE.C.XO; [<RefEntry Id="XCDI.MAN262.rsml.1">]]>
<RefMeta>
<RefEntryTitle>ttdt_file_request</RefEntryTitle>
<ManVolNum>library call</ManVolNum>
</RefMeta>
<RefNameDiv>
<RefName><Function>ttdt_file_request</Function></RefName>
<RefPurpose>create and send a standard ToolTalk request about a file
</RefPurpose>
</RefNameDiv>
<!-- $XConsortium: f_reques.sgm /main/5 1996/08/30 14:29:08 rws $-->
<!-- CDE Common Source Format, Version 1.0.0-->
<!-- (c) Copyright 1993, 1994, 1995 Hewlett-Packard Company-->
<!-- (c) Copyright 1993, 1994, 1995 International Business Machines Corp.-->
<!-- (c) Copyright 1993, 1994, 1995 Sun Microsystems, Inc.-->
<!-- (c) Copyright 1993, 1994, 1995 Novell, Inc.-->
<RefSynopsisDiv>
<FuncSynopsis Remap="ANSI">
<FuncSynopsisInfo>#include &lt;Tt/tttk.h>
</FuncSynopsisInfo>
<FuncDef>Tt_message <Function>ttdt_file_request</Function></FuncDef>
<ParamDef>Tt_message <Parameter>context</Parameter></ParamDef>
<ParamDef>Tttk_op <Parameter>op</Parameter></ParamDef>
<ParamDef>Tt_scope <Parameter>scope</Parameter></ParamDef>
<ParamDef>const char *<Parameter>pathname</Parameter></ParamDef>
<ParamDef>Ttdt_file_cb <Parameter>cb</Parameter></ParamDef>
<ParamDef>void *<Parameter>client_data</Parameter></ParamDef>
<ParamDef>int <Parameter>send_and_destroy</Parameter></ParamDef>
</FuncSynopsis>
</RefSynopsisDiv>
<RefSect1>
<Title>DESCRIPTION</Title>
<Para>The
<Function>ttdt_file_request</Function> function
is used to create (and optionally send) any of
the standard Desktop file requests
<![ %CDE.C.XO; [defined in
<XRef Linkend="XCDI.TT.anch.6" Role="2">, ]]>such as
<Symbol Role="Message">Get_Modified</Symbol>, <Symbol Role="Message">Save</Symbol>, and
<Symbol Role="Message">Revert</Symbol>.</Para>
<Para>The
<Function>ttdt_file_request</Function> function
creates a request with the specified
<Symbol Role="Variable">op</Symbol> and
<Emphasis>scope</Emphasis>, and sets its file attribute to
<Symbol Role="Variable">pathname</Symbol>. The function adds an unset argument of
<StructName Role="typedef">Tt_mode</StructName> <SystemItem Class="Constant">TT_IN</SystemItem> and
vtype
<Emphasis>File</Emphasis> to the request, per the Desktop messaging conventions.
If
<Symbol Role="Variable">op</Symbol> is
<SystemItem Class="Constant">TTDT_GET_MODIFIED</SystemItem>, <Function>ttdt_file_request</Function> also adds an unset
<SystemItem Class="Constant">TT_OUT</SystemItem> argument of
vtype
<StructName Role="typedef">Boolean</StructName> to the request.
The
<Function>ttdt_file_request</Function> function
installs
<Emphasis>cb</Emphasis> as a message callback for the created request, and ensures that
<Symbol Role="Variable">client_data</Symbol> will be passed into the callback.
(The
<StructName Role="typedef">Ttdt_file_cb</StructName> callback is described under
&cdeman.ttdt.file.join;). If
<Emphasis>send</Emphasis> is True,
<Function>ttdt_file_request</Function> sends the request before returning the handle to it;
otherwise, it only creates the request.
</Para>
<Para>The
<Symbol Role="Variable">context</Symbol> argument describes the environment to use.
If
<Symbol Role="Variable">context</Symbol> is not zero, messages created by
<Function>ttdt_file_request</Function> inherit from
<Symbol Role="Variable">context</Symbol> all contexts whose slotname begins with the characters
<SystemItem Class="Constant">ENV_</SystemItem>.</Para>
</RefSect1>
<RefSect1>
<Title>RETURN VALUE</Title>
<Para>Upon successful completion, the
<Function>ttdt_file_request</Function> function returns the created
<StructName Role="typedef">Tt_message</StructName>; otherwise, it returns an error pointer.
The application can use
&cdeman.tt.ptr.error; to extract one of the following
<StructName Role="typedef">Tt_status</StructName> values from the returned handle:
</Para>
<VariableList>
<VarListEntry>
<Term>TT_ERR_DBAVAIL</Term>
<ListItem>
<Para>The ToolTalk service could not access the ToolTalk database
needed for this operation.
</Para>
</ListItem>
</VarListEntry>
<VarListEntry>
<Term>TT_ERR_DBEXIST</Term>
<ListItem>
<Para>The ToolTalk service could not access the specified ToolTalk database
in the expected place.
</Para>
</ListItem>
</VarListEntry>
<VarListEntry>
<Term>TT_ERR_NOMEM</Term>
<ListItem>
<Para>There is insufficient memory available to perform the function.
</Para>
</ListItem>
</VarListEntry>
<VarListEntry>
<Term>TT_ERR_NOMP</Term>
<ListItem>
<Para>The
&cdeman.ttsession; process is not running and the ToolTalk service cannot restart it.
</Para>
</ListItem>
</VarListEntry>
<VarListEntry>
<Term>TT_ERR_OVERFLOW</Term>
<ListItem>
<Para>The ToolTalk service has more active messages than it can handle.
(The maximum number of active messages is
implementation specific, but is at least 2000.)
</Para>
</ListItem>
</VarListEntry>
<VarListEntry>
<Term>TT_ERR_POINTER</Term>
<ListItem>
<Para>The
<Symbol Role="Variable">pathname</Symbol> argument was
<SystemItem Class="Constant">NULL</SystemItem> or was a ToolTalk error pointer.
</Para>
</ListItem>
</VarListEntry>
<VarListEntry>
<Term>TT_ERR_PROCID</Term>
<ListItem>
<Para>The specified process identifier is out of date or invalid.
</Para>
</ListItem>
</VarListEntry>
</VariableList>
</RefSect1>
<RefSect1>
<Title>APPLICATION USAGE</Title>
<Para>The
<Function>ttdt_file_request</Function> function
is a lower-level interface than
<Function>ttdt_Get_Modified</Function>, <Function>ttdt_Save</Function>, and
<Function>ttdt_Revert</Function>, since the latter functions create and send the request and then block
on its reply.
</Para>
</RefSect1>
<RefSect1>
<Title>SEE ALSO</Title>
<Para>&cdeman.Tt.tttk.h;, &cdeman.ttdt.Get.Modified;, &cdeman.ttdt.Save;, &cdeman.ttdt.Revert;, &cdeman.ttdt.file.join;.</Para>
</RefSect1>
</RefEntry>
<!--fickle 1.12 mancsf-to-docbook 1.2 08/07/95 23:18:47-->
