ProFTPD Developer's Guide: API Structs

ProFTPD Version 1.2

Class

Declaration:
 struct Class {

   char *Class;
   unsigned long Count;

  };
Source File: src/ftpcount.c

IO_Buffer

Declaration:
 struct IO_Buffer {

   char *buf, *cp;
   int left, bufsize;

 };
Source File: include/io.h

IO_File

Declaration:
 struct IO_File {

   /* memory pool for this object */
   pool *pool;
   int fd;

   /* 0 == read, 1 == write */
   int mode;

   /* errno, if applicable */
   int xerrno;

   int flags;
   unsigned int restart_secs;
 
   IOBUF *buf;
    
   /* request buffer size */
   IOREQ *req;

   /* default size of the request buffer */
   int bufsize;

 };
Source File: include/io.h

IO_Request

Comments: (*cl_read) can be used during write operations to asynchronously gather data from a function. If (*cl_read) returns -1, an error is assumed, otherwise 0 == EOF (ie, the write completed).

Declaration:
 struct IO_Request {

   IOREQ *next, *prev;

   /* memory pool for this object */
   pool *pool;

   /* read or write */
   int req_type;

   /* request flags */
   int req_flags;
       
   IOFILE *file;

   char *buf;
   char *bp, *bufnext;

   /* buffer size */
   int bufsize;

   /* client buffer, and head pointer */
   char *cl_buf, *cl_bp;

   /* bytes remaining in the client buffer */
   int cl_bytes;

   /* client IO funtion (for async operations) */
   int (*cl_io)(IOREQ *, char *, int);

   /* error occurred */
   void (*cl_err)(IOREQ *, int);

   /* remote side closed */
   void (*cl_close)(IOREQ *);

 };
Source File: include/io.h

XAset

Declaration:
 struct XAset {
    
   xasetmember_t *xas_list;

   /* memory pool for this object */
   pool *mempool;

   XASET_COMPARE xas_compare;

 };
Source File: include/sets.h

XAsetmember

Declaration:
 struct XAsetmember {

   xasetmember_t *next, *prev;

 };
Source File: include/sets.h

cleanup

Declaration:
 struct cleanup {

   void *data;
   void (*plain_cleanup)(void *);
   void (*child_cleanup)(void *);
   struct cleanup *next;

 };
Source File: src/pool.c

config_struc

Declaration:
 struct config_struc {

   struct config_struc *next, *prev;
 
   /* this will be one of the CONF_* types */
   int config_type;

   /* memory pool for this object */
   pool *pool;

   /* the set in which we're stored */
   xaset_t *set;

   char *name;
   int argc;
   void **argv;

   /* override classes */
   long overrides;

   /* flags */
   long flags;

   /* server to which this config element is attached */
   server_rec *server;

   /* parent configuration record */
   config_rec *parent;

   /* sub-configuration */
   xaset_t *subset;

 };
Source File: include/dirtree.h

filename

Declaration:
 struct filename {

   struct filename *down;
   struct filename *right;
   int top;
   char line[1];

 };
Source File: modules/mod_ls.c

fs_dir_handler

Declaration:
 struct fs_dir_handler {

   fsdir_t *next;
   char *name;

   /* parent handlers */
   fsdir_t *parent;
   void *private;

   /* actual handler functions */
   int (*stat)(fsdir_t *, const char *, struct stat *);
   int (*lstat)(fsdir_t *, const char *, struct stat *);
   int (*rename)(fsdir_t *, const char *, const char *);
   int (*unlink)(fsdir_t *, const char *);
   int (*open)(fsdir_t *, const char *, int);
   int (*creat)(fsdir_t *, const char *, mode_t);
   int (*close)(fsdir_t *, int);
   int (*read)(fsdir_t *, int, char *, size_t);
   int (*write)(fsdir_t *, int, char char *, size_t);
   off_t (*lseek)(fsdir_t *, int, off_t, int);
   int (*link)(fsdir_t *, const char *, const char *);
   int (*symlink)(fsdir_t *, const char *, const char *);
   int (*readlink)(fsdir_t *, const char *, char *, size_t);
   int (*chmod)(fsdir_t *, const char *, mode_t);
   int (*chown)(fsdir_t *, const char *, uid_t, gid_t);
   int (*chdir)(fsdir_t *, const char *);

   /* for actual operations on the directory (or subdirs)
    * we cast the return from opendir to DIR * in src/fs.c
    * so modules can use their own data type
    */
   void *(*opendir)(fsdir_t *, const char *);

   int (*closedir)(fsdir_t *, void *);
   struct dirent *(*readdir)(fsdir_t *, void *);

 };
Source File: include/fs.h

fs_dir_match

Declaration:
 struct fs_dir_match {

   fsmatch_t *next;
   char *name;
   int opmask;

   int (*dir_hit)(fsdir_t *, const char *, int);
   int (*file_hit)(fsdir_t *, const char *, int);

 };
Source File: include/fs.h

logfile_struc

Declaration:
 struct logfile_struc {

   logfile_t *next, *prev;
       
   int lf_fd;
   int lf_classes;
   char *lf_filename;
   logformat_t *lf_format;

   /* pointer to the "owning" configuration */
   config_rec *lf_conf;

 };
Source File: modules/mod_log.c

logformat_struc

Declaration:
 struct logformat_struc {

   logformat_t *next, *prev;

   char *lf_nickname;
   unsigned char *lf_format;
 
 };
Source File: modules/mod_log.c

modret_struc

Declaration:
 struct modret_struc {

   /* which module handled this? */
   module *mr_handler_module;

   /* not zero if there was an error */
   int mr_error;

   /* numeric error code */
   char *mr_numeric;

   /* text message */
   char *mr_message;

   /* additional data -- undefined */
   void *data;

 };
Source File: include/modules.h

module_struc

Declaration:
 struct module_struc {

   module *next, *prev;

   /* module API version -- NOT module version */
   int ver;

   /* module name */
   char *name;

   /* configuration directive table */
   conftable *conftable;

   /* command handler table */
   cmdtable *cmdtable;

   /* authentication handler table */
   authtable *authtable;

   /* module initialization */
   int (*module_init)();

   /* post-fork initialization */
   int (*module_init_child)();

   /* internal use, greater number == higher priority */
   int priority;

 };
Source File: include/modules.h

opendir_struct

Declaration:
 struct opendir_struct {

   opendir_t *next, *prev;
   DIR *dir;
   fsdir_t *fsdir;

 };
Source File: src/fs.c

option

Declaration:
 struct option

#if __STDC__
   const char *name;
#else
   char *name;
#endif

   /* has_arg can't be enum because some compilers complain
    * about type mismatches in all the code that assumes
    * it is an int.
    */
   int has_arg;

   int *flag;
   int val;

 };
Source File: lib/getopt.h

option_help

Declaration:
 struct option_help {

   char *long_opt, *short_opt, *desc;

 };
Source File: src/ftpcount.c

pool

Comments: Pool internals and management

Declaration:
 struct pool {

   union block_hdr *first;
   union block_hdr *last;
   struct clean *cleanups;
   struct pool *sub_pools;
   struct pool *sub_next;
   struct pool *sub_prev;
   struct pool *parent;
   char *free_first_avail;
   char symbol;

 }
Source File: src/pool.c

privdata

Declaration:
 struct privdata {

   char *tag;
 
   union {

     void *ptr_val;
     int int_val;
     long long_val;
     char *str_val;

   } value;

   module *m;

 };
Source File: include/modules.h

rehash

Declaration:
 struct rehash {

   struct rehash *next;
   void *data;
   void (*rehash)(void *);

 };
Source File: src/main.c

sort_filename

Declaration:
 struct sort_filename {

   time_t mtime;
   char *name, *suffix;

 };
Source File: modules/mod_ls.c

symbol_hash

Declaration:
 struct symbol_hash {

   struct symbol_hash *next, *prev;

   /* pointer to the directive, command, or other symbol */
   char *sym_name;

   /* one of the SYM_* macros */
   char sym_type;

   module *sym_module;

   union {

     conftable *sym_conf;
     cmdtable *sym_cmd;
     authtable *sym_auth;
     void *sym_generic;

   } ptr;

 };
Source File: src/modules.c


Author: $Author: castaglia $
Last Updated: $Date: 2003/01/02 17:39:30 $


© Copyright 2000-2003 TJ Saunders
All Rights Reserved