index.htmlMain Page    classes.htmlAlphabetical List    annotated.htmlData Structures    files.htmlFile List    functions.htmlData Fields    globals.htmlGlobals    bbuf.c File Reference
Functions
types_8h.html#a5wmf_error_t  bbuf_8c.html#a0wmf_bbuf_input  ( types_8h.html#a22wmfAPI  *API, types_8h.html#a8wmfRead  fp_read, types_8h.html#a9wmfSeek  fp_seek, types_8h.html#a10wmfTell  fp_tell, void *user_data) types_8h.html#a5wmf_error_t  bbuf_8c.html#a1wmf_file_open  ( types_8h.html#a22wmfAPI  *API, const char *file) types_8h.html#a5wmf_error_t  bbuf_8c.html#a2wmf_file_close  ( types_8h.html#a22wmfAPI  *API) int bbuf_8c.html#a3wmf_file_read  (void *user_data) int bbuf_8c.html#a4wmf_file_seek  (void *user_data, long pos) long bbuf_8c.html#a5wmf_file_tell  (void *user_data) types_8h.html#a5wmf_error_t  bbuf_8c.html#a6wmf_mem_open  ( types_8h.html#a22wmfAPI  *API, unsigned char *mem, long length) types_8h.html#a5wmf_error_t  bbuf_8c.html#a7wmf_mem_close  ( types_8h.html#a22wmfAPI  *API) int bbuf_8c.html#a8wmf_mem_read  (void *user_data) int bbuf_8c.html#a9wmf_mem_seek  (void *user_data, long pos) long bbuf_8c.html#a10wmf_mem_tell  (void *user_data) Function Documentation
  
    
      
        
          
 types_8h.html#a5wmf_error_t  wmf_bbuf_input           
(           
types_8h.html#a22wmfAPI  *           
  API,         
        
          
          
          
types_8h.html#a8wmfRead            
  fp_read,         
        
          
          
          
types_8h.html#a9wmfSeek            
  fp_seek,         
        
          
          
          
types_8h.html#a10wmfTell            
  fp_tell,         
        
          
          
          
void *           
  user_data         
        
          
          
)           
        
      
    
  
  
    
       
    
    
Set custom metafile input-stream handler functions.
Parameters: API the API handle 
fp_read function to read a byte 
fp_seek function to set position 
fp_tell function to get position 
user_data handle for user data
libwmf has simple methods for reading either from file or from memory, but many applications will want to use customized variants of these. bbuf_8c.html#a0wmf_bbuf_input()  enables this.
typedef int  (*wmfRead) (void* user_data);
typedef int  (*wmfSeek) (void* user_data,long position);
typedef long (*wmfTell) (void* user_data);
types_8h.html#a8wmfRead  returns unsigned char cast to int, or EOF (cf. fgetc())
types_8h.html#a9wmfSeek  returns (-1) on error, otherwise 0 (cf. fseek())
types_8h.html#a10wmfTell  returns (-1) on error, otherwise current position (cf. ftell())
Returns: Returns the library error state (
wmf_E_None on success). Possible library error state of wmf_E_Glitch, if any of the three functions is zero.       
  
    
      
        
          
 types_8h.html#a5wmf_error_t  wmf_file_close           
(           
types_8h.html#a22wmfAPI  *           
  API                    
)           
        
      
    
  
  
    
       
    
    
Close metafile input file stream.
Parameters: API the API handle
Returns: Returns the library error state (
wmf_E_None on success). Possible library error state of wmf_E_Glitch.       
  
    
      
        
          
 types_8h.html#a5wmf_error_t  wmf_file_open           
(           
types_8h.html#a22wmfAPI  *           
  API,         
        
          
          
          
const char *           
  file         
        
          
          
)           
        
      
    
  
  
    
       
    
    
Open file as metafile.
Parameters: API the API handle 
file file name
Simple method for reading from file.
Returns: Returns the library error state (
wmf_E_None on success). Possible library error states of wmf_E_Glitch or wmf_E_BadFile.       
  
    
      
        
          
 int wmf_file_read           
(           
void *           
                     
)           
        
      
    
  
  
    
       
    
    
file input (wmf_file_open): fgetc()     
  
  
    
      
        
          
 int wmf_file_seek           
(           
void *           
 ,         
        
          
          
          
long           
         
        
          
          
)           
        
      
    
  
  
    
       
    
    
file input (wmf_file_open): fseek()     
  
  
    
      
        
          
 long wmf_file_tell           
(           
void *           
                     
)           
        
      
    
  
  
    
       
    
    
file input (wmf_file_open): ftell()     
  
  
    
      
        
          
 types_8h.html#a5wmf_error_t  wmf_mem_close           
(           
types_8h.html#a22wmfAPI  *           
  API                    
)           
        
      
    
  
  
    
       
    
    
Close metafile input memory stream.
Parameters: API the API handle
Returns: Returns the library error state (
wmf_E_None on success).       
  
    
      
        
          
 types_8h.html#a5wmf_error_t  wmf_mem_open           
(           
types_8h.html#a22wmfAPI  *           
  API,         
        
          
          
          
unsigned char *           
  mem,         
        
          
          
          
long           
  length         
        
          
          
)           
        
      
    
  
  
    
       
    
    
Open metafile in memory.
Parameters: API the API handle 
mem the metafile in memory 
length the length in bytes of metafile data
Simple method for reading from memory as array of unsigned char.
Returns: Returns the library error state (
wmf_E_None on success). Possible library error state of wmf_E_Glitch.       
  
    
      
        
          
 int wmf_mem_read           
(           
void *           
                     
)           
        
      
    
  
  
    
       
    
    
memory input (wmf_mem_open): fgetc() equiv.     
  
  
    
      
        
          
 int wmf_mem_seek           
(           
void *           
 ,         
        
          
          
          
long           
         
        
          
          
)           
        
      
    
  
  
    
       
    
    
memory input (wmf_mem_open): fseek() equiv.     
  
  
    
      
        
          
 long wmf_mem_tell           
(           
void *           
                     
)           
        
      
    
  
  
    
       
    
    
memory input (wmf_mem_open): ftell() equiv.     
  
Generated on Tue Dec 10 19:53:47 2002 for libwmf by
http://www.doxygen.org/index.htmldoxygen 1.2.18 