Mercurial > dovecot > original-hg > dovecot-1.2
view src/master/common.h @ 195:db6e288be0e9 HEAD
Replaced INT_TO_POINTER and POINTER_TO_INT macros with POINTER_CAST and
POINTER_CAST_TO macros, the CAST_TO takes a parameter to which type we're
casting to. Also POINTER_CAST should be valid ANSI-C now.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Sun, 08 Sep 2002 18:34:27 +0300 |
parents | 3b1985cbc908 |
children | 0903ba071661 |
line wrap: on
line source
#ifndef __COMMON_H #define __COMMON_H #include "lib.h" #include "hash.h" #include "settings.h" #include "../auth/auth-interface.h" #include "master-interface.h" enum { PROCESS_TYPE_UNKNOWN, PROCESS_TYPE_AUTH, PROCESS_TYPE_LOGIN, PROCESS_TYPE_IMAP, PROCESS_TYPE_MAX }; const char *process_type_names[PROCESS_TYPE_MAX]; extern HashTable *pids; extern int null_fd, imap_fd, imaps_fd; /* processes */ #define PID_GET_PROCESS_TYPE(pid) \ POINTER_CAST_TO(hash_lookup(pids, POINTER_CAST(pid)), pid_t) #define PID_ADD_PROCESS_TYPE(pid, type) \ hash_insert(pids, POINTER_CAST(pid), POINTER_CAST(type)) #define PID_REMOVE_PROCESS_TYPE(pid) \ hash_remove(pids, POINTER_CAST(pid)) void clean_child_process(void); MasterReplyResult create_imap_process(int socket, const char *user, uid_t uid, gid_t gid, const char *home, int chroot, const char *env[]); void imap_process_destroyed(pid_t pid); /* misc */ #define VALIDATE_STR(str) \ validate_str(str, sizeof(str)) int validate_str(const char *str, int max_len); #endif