Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Force 4.0 Reference - initc() initialize c language support http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 initc()             Initialize C language support
------------------------------------------------------------------------------
 Declaration
   system.hdr

 Syntax
   proc initc extern

 Arguments
   None.

 Return
   None.

 Description
   The initc() function initializes support for linking C language libraries
   with a Force application. The initc() function must be called before any
   call is made to C library routines. In addition, one of the C language
   support modules supplied must be linked with the application. C support
   modules include:

   - bc31.obj for linking with Borland C++ 3.1 or later

   - msc60.obj for linking with Microsoft C 6.0 or later

   When linking with C libraries, force.lib must precede any C library
   on the linker command line. Use only large model C libraries.

 Example
   #define EXAMPLE_SYSTEM
   #include example.hdr

   /*
   Compile:        force -Gt test.prg
   Link for BC++:  flink test \force40\lib\bc31,,,force emu mathl cl
   Link for MS C:  flink test \force40\lib\msc60,,,force llibce
   */
   
   // prototypes for C library functions
   
   proc printf extern
   param const char cFormat, value long gNum
   
   func ptr( char ) strrev extern
   param char cString
   
   #pragma ESCSEQ+
   
   proc Test_initc
   vardef
      char cString
   enddef
   cString := "Force compiler"
   initc()
   printf( "\nCalling the printf() C library function: %d", -12345 )
   strrev( cString )
   ? cString
   endproc

   proc main
   Test_initc()
   endproc

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson