                         Using C with Clipper                       
                                                                    
    Prepared by:  Steve Rice                    Dated:  03/01/90    

Table 1 - Compiler options                                         
Ŀ  
                                                                    
                                                                    
    COMPILERS                                                       
                                                                    
    Microsoft C 5.0 or greater command line:                        
                                                                    
    CL /c /AL /Z1 /Oalt /FPa /Gs <filename.c>                       
                                                                    
    where:     CL      = the compiler command                       
               /c      = compile without linking                    
               /AL     = use the large memory model                 
               /Z1     = remove default library search records      
                         from object file                           
               /Oalt   = control optimization                       
                                                                    
               where:    a = relax alias checking                   
                         l = enable loop optimization               
                         t = favor execution speed                  
                                                                    
               /FPa    = floating point alternate library           
               /Gs     = remove calls to stack-checking routine     
                                                                    
    Microsoft QuickC 1.0 or greater command line:                   
                                                                    
    CL /c /AL /Z1 /Gs <filename.c>                                  
                                                                    
    where:     CL      = the compiler command                       
               /c      = compile without linking                    
               /AL     = use the large memory model                 
               /Z1     = remove default library search records      
                         from object file                           
               /Gs     = remove calls to stack-checking routine     
                                                                    
    Turbo C 1.0 or greater command line:                            
                                                                    
    tcc -c -ml -f- <filename.c>                                     
                                                                    
    where:     tcc     = the compiler command                       
               -c      = compile without linking                    
               -ml     = use the large memory model                 
               -f-     = do not include floating point libraries    
                                                                    
  
 
 
Table 2 - Linker options
Ŀ 
                                                                    
                                                                    
    LINKERS                                                         
                                                                    
    Microsoft Link 3.61 or greater command line:                    
                                                                    
    link /noe /noi /nod <clipper obj> <c obj>...clipper extend      
                                                 llibca             
                                                                    
    where:     /noe    = no multiply defined symbol errors          
               /noi    = no ignore case                             
               /nod    = no default library search                  
               clipper = clipper.lib                                
               extend  = extend.lib                                 
               llibca  = llibca.lib from MS C 5.0 or greater        
                                                                    
    Plink86 2.24 command line:                                      
                                                                    
    plink86 mixcase fi <clp obj>, <c obj> lib clipper, extend,      
                                            llibca                  
                                                                    
    where:     plink86 = linker command                             
               mixcase = no ignore case                             
               fi      = file directive before object module        
                          list                                      
               lib     = library directive before library list      
               clipper = clipper.lib                                
               extend  = extend.lib                                 
               llibca  = llibca.lib from MS C 5.0 or greater        
                                                                    
    Tlink 1.0 command line:                                         
                                                                    
    tlink <clp obj> <c obj>...clipper extend llibca                 
                                                                    
    where:     clipper = clipper.lib                                
               extend  = extend.lib                                 
               llibca  = llibca.lib from MS C 5.0 or greater        
                                                                    
  
 
 
Table 3 - Summary of Extend Functions
Ŀ 
                                                                    
    Clipper Type      C Prototype                                   
    ------------      ---------------------------                   
    character         char*   _parc(int[,int])                      
    date              char*   _pards(int[,int])                     
    logical           int     _parl(int[,int])                      
    numeric           int     _parni(int[,int])                     
    numeric           long    _parnl(int[,int])                     
    numeric           double  _parnd(int[,int])                     
                                                                    
                      int     _parclen(int[,int])                   
                      int     _parcsiz(int[,int])                   
                      int     _parinfa(int,int)                     
                      int     _parinfo(int)                         
                                                                    
    character         void    _retc(char*)                          
    date              void    _retds(char*)                         
    logical           void    _retl(int)                            
    numeric           void    _retni(int)                           
    numeric           void    _retnl(long)                          
    numeric           void    _retnd(double)                        
    (no value)        void    _ret(void)                            
                                                                    
                      void    _retclen(char*,int)                   
                                                                    
  
                                                             

Table 4 - Manifest Constants in Extend.h
Ŀ  
                                                                    
    Type               Returns                                      
    ------------       ------------------------------------         
    undefined     =    UNDEF                                        
                                                                    
    character     =    CHARACTER                                    
    numeric       =    NUMERIC                                      
    logical       =    LOGICAL                                      
    date          =    DATE                                         
    by reference  =    MPTR  /* or'ed with type when passed         
                                by reference */                     
    memo          =    MEMO                                         
    array         =    ARRAY                                        
                                                                    
                                                                    
                                                                    
    Table 3 - Interface Macros                                      
                                                                    
    EXTEND.H Macro      Defined as                                  
    --------------      --------------------------------            
    PCOUNT              (_parinfo(0))                               
    ISCHAR(order)       (_parinfo(order) &  CHARACTER)              
    ISNUM(order)        (_parinfo(order) &  NUMERIC)                
    ISLOG(order)        (_parinfo(order) &  LOGICAL)                
    ISDATE(order)       (_parinfo(order) &  DATE)                   
    ISMEMO(order)       (_parinfo(order) &  MEMO)                   
    ISBYREF(order)      (_parinfo(order) &  MPTR)                   
    ISARRAY(order)      (_parinfo(order) &  ARRAY)                  
    ALENGTH(order)      (_parinfa(order,0))                         
                                                                  


                                                                     