mail.h 962 B

12345678910111213141516171819202122232425262728293031323334
  1. struct globals {
  2. pid_t helper_pid;
  3. unsigned timeout;
  4. unsigned opts;
  5. char *user;
  6. char *pass;
  7. FILE *fp0; // initial stdin
  8. char *opt_charset;
  9. char *content_type;
  10. };
  11. #define G (*ptr_to_globals)
  12. #define timeout (G.timeout )
  13. #define opts (G.opts )
  14. //#define user (G.user )
  15. //#define pass (G.pass )
  16. //#define fp0 (G.fp0 )
  17. //#define opt_charset (G.opt_charset)
  18. //#define content_type (G.content_type)
  19. #define INIT_G() do { \
  20. SET_PTR_TO_GLOBALS(xzalloc(sizeof(G))); \
  21. G.opt_charset = (char *)CONFIG_FEATURE_MIME_CHARSET; \
  22. G.content_type = (char *)"text/plain"; \
  23. } while (0)
  24. //char FAST_FUNC *parse_url(char *url, char **user, char **pass);
  25. void FAST_FUNC launch_helper(const char **argv);
  26. void FAST_FUNC get_cred_or_die(int fd);
  27. const FAST_FUNC char *command(const char *fmt, const char *param);
  28. void FAST_FUNC encode_base64(char *fname, const char *text, const char *eol);