The c8compiler.h file contains function prototypes for the Sybase CEP Compiler API, a set of functions that enable you to compile a Sybase CEP project file (.ccp) or schema file.
The primary functions in this API are the C8Compile() function and the C8RemoteCompile()C8RemoteCompile() function, which perform the same actions as the Sybase CEP compiler (c8_compiler on UNIX or c8_compiler.exe on Microsoft Windows). They translate a group of CCL statements into a form the server can use. You can specify the same options for C8Compile() as you can specify on the command line of the Sybase CEP compiler. (For a description of the command-line parameters of the c8_compiler program, see Compile a Project or a Schema File.)
The API provides additional functions that you may find useful if you want to specify options for the compiler, such as turning warning messages on or off. For a full description of these options, see Compile a Project or a Schema File, and especially the first table in that section.
Prior to calling any function from the client SDK, the SDK initialization function C8ClientSDKInitialize() must be called. See the descriptions of the C8ClientSDKInitialize() and C8ClientSDKShutdown() functions for more information.
The functions in the compiler API can be called from any out-of-process program. These functions may not be called from inside an in-process task, such as an in-process adapter or an in-process UDF.
The Sybase CEP CCL compiler API is shown below.
If non-default compiler options are needed, create an instance of C8CompilerOptions with C8CompilerOptionsCreate. Use the C8CompilerOptionsSet... methods to modify the options then pass the options to the C8Compile call and destroy them afterwards with the C8CompilerOptionsDestroy call. In general, the calls to manipulate compiler options match the compiler options as shown by executing c8_compiler --help and described in the Sybase CEP documentation.
Parameters:
i_input_file: The CCL project file to compile. Includes the path as well as the complete file name. The function does not assume a particular filename extension such as .ccp or .ccl.
i_output_file : Where to write the compiled ccx program. Includes the path as well as the complete file name. The function does not assume a particular filename extension such as .ccx. Specify a location at which the c8_client program or Sybase CEP Studio can find the file. All relative paths are relative to the current working directory of the process that calls the C8Compile function.
i_workspace: The workspace name.
i_load_name: The load name for the module. This name should be unique within the workspace. For a description of the load name, see the description of the "--name=progname" c8_compiler option in the first table in Compile a Project or a Schema File.
i_opts: The compiler options to use, or NULL for defaults.
Returns: C8_OK if successful, C8_FAIL otherwise.
If non-default compiler options are needed, create an instance of C8CompilerOptions with C8CompilerOptionsCreate use the C8CompilerOptionsSet... methods to modify the options, pass the options to the C8Compile call, and destroy them afterwards with the C8CompilerOptionsDestroy call. In general, the calls to manipulate compiler options match the compiler options as shown by executing c8_compiler --help and described in the Sybase CEP documentation.
Parameters:
i_input_file: The CCL project file to compile. This may include the path as well as the complete file name. The function does not assume a particular filename extension such as .ccp or .ccl. This is the path and name of a file on the client, not the server. The client reads the file and sends the text to the server to be compiled.
i_output_file: Where to write the compiled ccx program. This should include the path as well as the complete file name. The function does not assume a particular filename extension such as .ccx. You should specify a location at which the c8_client program (or Sybase CEP Studio) can find the file. All relative paths are relative to the current working directory of the process that calls the C8Compile() function. Note that this is the path and name of a file on the client, not the server.
i_compiler_flags: The compiler options to use, or NULL for defaults.
i_workspac: The workspace name.
i_load_name: The load name for the module. This name should be unique within the workspace. For a description of the load name, see the description of the "--name=progname" c8_compiler option in the first table in Compile a Project or a Schema File.
i_compiler_uri: The string containing the URI of the compiler service. Since the URI is being compiled on a remote server, this string contains the URI of that remote server in the usual form: http://hostname:port. For example, "http://Mgr1:6789".
Returns: C8_OK if successful, C8_FAIL otherwise.
Parameters:
i_input_file: The name (optionally including the path) of the input file, or schema file. By convention, the filename extension is normally .ccs.
i_output_file: The name (optionally including the path) of the output file, or schema file. By convention, the filename extension is normally .ccx.
Returns: C8_OK if successful, C8_FAIL otherwise.
Parameters: None.
Returns: The pointer to the new structure or NULL if the structure could not be allocated.
Parameters:
i_opts: The pointer to a C8CompilerOptions structure.
Returns: Nothing.
Parameters:
i_opts: The pointed to a C8CompilerOptions structure.
o_res: The location to write the result (the repository path) to.
Returns: C8_OK if successful, C8_FAIL otherwise.
Parameters:
i_opts: The pointed to a C8CompilerOptions structure.
value: The new path.
Returns: C8_OK on success; C8_Fail otherwise.
Parameters:
i_opts: The valid pointer to a compiler option's structure.
o_res: The location to write the result to.
Returns: C8_TRUE if debug mode is set; C8_FALSE otherwise.
Parameters:
i_opts: The pointed to a C8CompilerOptions structure.
value: C8_TRUE to set debug mode, C8_FALSE to clear debug mode.
Returns: C8_OK on success; C8_Fail otherwise.
Parameters:
i_opts: Is a valid pointer to a compiler options structure.
o_res: The location to write the result to.
Returns: C8_OK on success; C8_Fail otherwise.
Parameters:
i_opts: The pointed to a C8CompilerOptions structure.
value: The new playback rate.
Returns: C8_OK on success; C8_Fail otherwise.
Parameters:
i_opts: The pointed to a C8CompilerOptions structure.
o_res: The location to write the result to.
Returns: C8_OK on success; C8_Fail otherwise.
Parameters:
i_opts: The pointed to a C8CompilerOptions structure.
value: C8_TRUE to enable, C8_FALSE to disable.
Returns: C8_OK on success; C8_Fail otherwise.
Parameters:
i_opts: The pointed to a C8CompilerOptions structure.
o_res: The location to write the result to.
Returns: C8_OK on success; C8_Fail otherwise.
Parameters:
i_opts: The pointed to a C8CompilerOptions structure.
value: C8_TRUE to enable, C8_FALSE to disable.
Returns: C8_OK on success; C8_Fail otherwise.
Parameters:
i_opts: The pointed to a C8CompilerOptions structure.
o_res: The location to write the result to.
Returns: C8_OK on success; C8_Fail otherwise.
Parameters:
i_opts: Valid pointer to a compiler options structure.
value: C8_TRUE to enable, C8_FALSE to disable.
Returns: C8_OK on success; C8_Fail otherwise.
Parameters:
i_opts: The pointed to a C8CompilerOptions structure.
o_res: The location to write the result to.
Returns: C8_OK on success; C8_Fail otherwise.
Parameters:
i_opts: The pointed to a C8CompilerOptions structure.
value: C8_TRUE to enable, C8_FALSE to disable.
Returns: C8_OK on success; C8_Fail otherwise.
Parameters:
i_opts: Valid pointer to a compiler options structure.
o_res: Location to write the result to.
Returns: C8_OK on success; C8_Fail otherwise.
Parameters:
i_opts: Valid pointer to a compiler options structure.
value: C8_TRUE to enable, C8_FALSE to disable.
Returns: C8_OK on success; C8_Fail otherwise.
Parameters:
i_opts: Valid pointer to a compiler options structure.
o_res: Location to write the result to.
Returns: C8_OK on success; C8_Fail otherwise.
Parameters:
i_opts: Valid pointer to a compiler options structure.
value: C8_TRUE to enable, C8_FALSE to disable.
Returns: C8_OK on success; C8_Fail otherwise.