<< Click to Display Table of Contents >>

 

zetafax_logo

ZfxCreateCtlFile

 


 

Create a CONTROL file from SUBMIT format file.

 

Syntax

 

ZFERR FAR ZfxCreateCtlFile( ZFSESSIONHANDLE hSession, char FAR *lpszSubmitFile,  char FAR *lpszControlFile, char FAR *lpszBody, char FAR *lpszDataExtn, char FAR  *lpszDataExtnBuf, char FAR *lpszCommentBuf)

 

Parameters

 

 

Parameter

Description

hSession

API session handle, as returned by ZfxAPIInit  call lpsz

SubmitFile

Name of submit file (with path if not in current directory)

lpszControl

FileName of new CONTROL file (with path if not in current  directory)

lpszBody

Data file extension for the required format, or NULL to use  the default (or to allow the Syntax line in the SUBMIT file to overwrite the  default).

lpszDataExtn

lpszDataExtnBufAddress of buffer of length 4 bytes. On return this will  contain the data file extension to use. If the lpszDataExtn parameter was given  as NULL then this will give the data format specified in the Syntax line in the  SUBMIT file (or the default value of TXT for straight ASCII text if this line  is not specified). If the lpszDataExtn was specified then an error is returned  if the SUBMIT file contains a Syntax line which contradicts this.

lpszCommentBuf

Address of buffer of length ZFMSG_COMMENT_LEN+1 used to return  the message comment for specifying in a subsequent ZfxSendMsg call.

 

 

Description

 

This routine interprets the %%[MESSAGE] of a given SUBMIT format file, writing  the details to the given CONTROL file. It is used where the ZfxSendSubmitFile function does not give sufficient flexibility - for example when wishing to  send an existing data file.

 

NOTE - this function is supplied for compatibility with version 5 of the  Zetafax API only. Version 6 API applications should use ZfxCreateCtlFileEx.

 

Return value

 

The routine returns 0 if successful, otherwise one of the following:

 

ZFERR_NOT_INITIALISED

ZFERR_INVALID_PARAMETERS

ZFERR_FILE_ERROR

ZFERR_FILE_OPEN_ERROR

ZFERR_FILE_CREATE_ERROR

ZFERR_SUBMIT_FILE_INVALID

 

Example

 

#include  <stdio.h>

#include <zfapi.h>

...

/* create .CTL file in user's OUT directory */

ZfxGetUserOutDir(hSession, szOutDir, sizeof(szOutDir);

ZfxCreateAutoFile(hSession, "XSUB", "CTL", szOutDir, szBody); continued.

/* get name of the CTL file we've just created  */

sprintf(szPath, "%s%s.CTL", szOutDir, szBody);

/* interpret the SUBMIT file created earlier */

/* to send an existing file of format G3F */

ZfxCreateCtlFile(hSession, "MYFILE.SUB", szPath, szBody, "G3F", szDataExtn,  szComment);

/* Create data file in OUT directory */

sprintf(szPath, "%s%s.G3F", szOutDir, szBody);

...

/* submit files */

ZfxSendMsg(hSession, szBody, "G3F", szComment);

 

Related topics

Alphabetical reference

Function error returns and reference