22.09.2013 Views

NetCOBOL for SPARC Architecture SAF Subroutines User's Guide

NetCOBOL for SPARC Architecture SAF Subroutines User's Guide

NetCOBOL for SPARC Architecture SAF Subroutines User's Guide

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

118 Appendix D. CGI To <strong>SAF</strong> <strong>Subroutines</strong> Conversion <strong>Guide</strong><br />

Web page <strong>for</strong> invoking applications modified <strong>for</strong> <strong>SAF</strong> applications<br />

<br />

...<br />

<br />

Note: NES checks the extensions to identify applications. Thus, each application<br />

name need not be identical to the .DLL name, but will be the name of extension<br />

(MIME type) registered on NES.<br />

Compilation and Linking Methods<br />

Compilation Method<br />

In the case of CGI applications, there are no particular options <strong>for</strong> compiling<br />

programs. The only exception is the compilation option "MAIN", which the user has<br />

to set in the main program. On the contrary, the user must not set the compilation<br />

option "MAIN" in a <strong>SAF</strong> routine because each <strong>SAF</strong> application must be created in<br />

a.DLL <strong>for</strong>mat. In addition, <strong>SAF</strong> applications require the compilation option shown<br />

below. For details of the compilation option, refer to the "<strong>NetCOBOL</strong> <strong>User's</strong> <strong>Guide</strong>."<br />

• THREAD (MULTI)<br />

<strong>SAF</strong> applications are designed <strong>for</strong> multi-threaded operation. Set the compilation<br />

option THREAD (MULTI) in every source program.<br />

Linking Method<br />

In CGI applications, object files are linked to make .EXE files as shown below.<br />

LINK Main-program.obj F3BICIMP.lib LIBC.lib F3BICWSR.lib /OUT:<br />

Execution-<strong>for</strong>mat-name.exe<br />

<strong>SAF</strong> applications, however, must be created in .DLL <strong>for</strong>mat. In addition, linked the<br />

import library are different from CGI application program as follows.<br />

Unit of Execution<br />

LINK /DLL Initial-program.obj Work-program.obj End-program.obj<br />

F3BICBDM.obj F3BINSRT.lib F3BICIMP.lib KERNEL32.lib LIBC.LIB<br />

/OUT:Execution-<strong>for</strong>mat-name.dll /ENTRY:COBDMAIN<br />

Changing CGI applications into <strong>SAF</strong> applications means changing process-based<br />

applications into thread-based applications. The user should pay attention to the<br />

following:<br />

• Compilation method<br />

• Accessing common resources

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!