config.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /*
  2. * mbsync - mailbox synchronizer
  3. * Copyright (C) 2000-2002 Michael R. Elkins <me@mutt.org>
  4. * Copyright (C) 2002-2006,2010-2012 Oswald Buddenhagen <ossi@users.sf.net>
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation; either version 2 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  18. *
  19. * As a special exception, mbsync may be linked with the OpenSSL library,
  20. * despite that library's more restrictive license.
  21. */
  22. #ifndef CONFIG_H
  23. #define CONFIG_H
  24. #include "common.h"
  25. typedef struct {
  26. const char *file;
  27. FILE *fp;
  28. char *buf;
  29. int bufl;
  30. int line;
  31. int err;
  32. char *cmd, *val, *rest;
  33. } conffile_t;
  34. #define ARG_OPTIONAL 0
  35. #define ARG_REQUIRED 1
  36. char *get_arg( conffile_t *cfile, int required, int *comment );
  37. int parse_bool( conffile_t *cfile );
  38. int parse_int( conffile_t *cfile );
  39. int parse_size( conffile_t *cfile );
  40. int getcline( conffile_t *cfile );
  41. int merge_ops( int cops, int ops[] );
  42. int load_config( const char *filename, int pseudo );
  43. #endif