2004 by Marc J. Rochkind. All rights reserved. Portions marked "Open Source" may be copied under license.

 

Main Page   Modules   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

common/ec.h File Reference


Detailed Description

header for above [Sec. 1.4.2]

Definition in file ec.h.

Go to the source code of this file.

Defines

#define EC_CLEANUP_BGN
#define EC_CLEANUP_END   }
#define ec_cmp(var, errrtn)
#define ec_rv(var)
#define ec_ai(var)
#define ec_neg1(x)   ec_cmp(x, -1)
#define ec_null(x)   ec_cmp(x, 0)
#define ec_zero(x)   ec_null(x)
#define ec_false(x)   ec_cmp(x, false)
#define ec_eof(x)   ec_cmp(x, EOF)
#define ec_nzero(x)
#define EC_FAIL   ec_cmp(0, 0)
#define EC_CLEANUP   goto ec_cleanup_bgn;
#define EC_FLUSH(str)
#define EC_EINTERNAL   INT_MAX

Enumerations

enum  EC_ERRTYPE { EC_ERRNO = 0, EC_EAI = 1, EC_GETDATE = 2, EC_NONE = 3 }

Functions

void ec_push (const char *fcn, const char *file, int line, const char *str, int errno_arg, EC_ERRTYPE type)
void ec_print (void)
void ec_reinit (void)
void ec_warn (void)

Variables

const bool ec_in_cleanup


Define Documentation

#define ec_ai var   ) 
 

Value:

{\
        int errrtn;\
        assert(!ec_in_cleanup);\
        if ((errrtn = (var)) != 0) {\
            ec_push(__func__, __FILE__, __LINE__, #var, errrtn, EC_EAI);\
            goto ec_cleanup_bgn;\
        }\
    }

Definition at line 44 of file ec.h.

Referenced by getnameinfo_ex(), main(), and make_sockaddr().

#define EC_CLEANUP   goto ec_cleanup_bgn;
 

Definition at line 70 of file ec.h.

Referenced by do_dir(), getcwdx(), main(), playback(), readany_test(), readany_test2(), readany_test3(), readdir_r_test(), and readdir_test().

#define EC_CLEANUP_BGN
 

Value:

ec_warn();\
    ec_cleanup_bgn:\
    {\
        bool ec_in_cleanup;\
        ec_in_cleanup = true;

Definition at line 15 of file ec.h.

Referenced by a1(), a3(), access_test(), asg(), asynchronous(), aup_sleep(), backward(), backward0(), backward2(), backward_test(), Bclose(), Bgetc(), biggest(), biggest_file(), Bopen_internal(), Bputc(), cget(), check_parent(), command(), copy(), copy2(), copy2a(), copy3(), copy4(), cready(), cvt(), dequeue_event(), dir_read_test(), do_dir(), do_entry(), edinvoke(), edrcv(), edsnd(), entry_sig(), ev_creat(), ev_open(), ev_read(), ev_sleep(), ev_write(), exec_redirected(), exectest(), execute3(), execvp2(), fcn(), fcntl_example(), file_ctime_test(), find_and_open_master(), forkbuf(), fpathconf_test(), fsort(), fsort0(), ftruncate_test(), get_and_incr_x(), get_client(), get_client_mqd(), get_cwd(), get_max_pathname(), get_pathlist(), getaddr(), getargs(), getblksize(), getcwdx(), gethostbyaddr_ex(), getln(), getln2(), getnameinfo_ex(), gettoken(), handle_request(), handle_signals(), ifdb(), ignore_sig(), init_semi(), invoke(), junk(), lock(), ls_one(), main(), main1(), make_sockaddr(), msg_check(), new_reg(), op_semi(), option_async_io(), option_sync_io(), pcsync_init(), pcsync_unblock_children(), pcsync_wait_for_parent(), pipe_access_mode(), pipetest(), pipewrite(), pipewrite2(), pipewrite2bug(), playback(), print_cwd(), print_statvfs(), process(), process1(), process2(), prompt(), pt_close_master(), pt_open_master(), pt_open_slave(), pt_wait_master(), push_pathlist(), pwrite_test(), queue_event(), rcvall(), readany(), readany2(), readany3(), readany_test(), readany_test2(), readany_test3(), readbuf(), readdir_r_test(), readdir_test(), readrec(), redirect(), rmdir_test(), run_client(), run_server(), runtest(), scatter(), send_header(), send_header_notfound(), send_header_OK(), setblock(), setup_fdset(), setup_posix_msg(), setup_posix_sem(), setup_process(), setup_signal(), setup_systemv_msg(), setup_systemv_sem(), show_stat(), showlimit(), showpginfo(), sig_thread(), SimpleSemClose(), SimpleSemOpen(), SimpleSemPost(), SimpleSemRemove(), SimpleSemWait(), smi_close_shm(), smi_close_skt(), smi_open_fifo(), smi_open_mq(), smi_open_pshm(), smi_open_shm(), smi_open_skt(), smi_receive_getaddr_fifo(), smi_receive_getaddr_mq(), smi_receive_getaddr_pshm(), smi_receive_getaddr_shm(), smi_receive_getaddr_skt(), smi_receive_release_pshm(), smi_receive_release_shm(), smi_send_getaddr_pshm(), smi_send_getaddr_shm(), smi_send_release_fifo(), smi_send_release_mq(), smi_send_release_pshm(), smi_send_release_shm(), smi_send_release_skt(), sorter(), ssi_close_fd(), ssi_open(), ssi_wait_server(), store(), store_char(), synchronous(), synctest(), tc_keystroke(), tc_restore(), tc_setraw(), temp_open(), test_Bfdopen(), test_setblock(), test_setblock2(), testlock(), thread_fdset(), thread_func(), thread_heartbeat(), thread_process(), thread_signal(), thread_svmsg(), thread_svsem(), timestart(), timestop(), try2(), try3(), try4(), try5(), try6(), turnaround(), uem_bgn(), uem_register_fdset(), uem_register_heartbeat(), uem_register_process(), uem_register_signal(), uem_register_svmsg(), uem_register_svsem(), uem_unregister(), uem_wait(), unlock(), wait_and_display(), who_wc(), who_wc2(), writebuf(), and writerec().

#define EC_CLEANUP_END   }
 

Definition at line 22 of file ec.h.

Referenced by a1(), a3(), access_test(), asg(), asynchronous(), aup_sleep(), backward(), backward0(), backward2(), backward_test(), Bclose(), Bgetc(), biggest(), biggest_file(), Bopen_internal(), Bputc(), cget(), check_parent(), command(), copy(), copy2(), copy2a(), copy3(), copy4(), cready(), cvt(), dequeue_event(), dir_read_test(), do_dir(), do_entry(), edinvoke(), edrcv(), edsnd(), entry_sig(), ev_creat(), ev_open(), ev_read(), ev_sleep(), ev_write(), exec_redirected(), exectest(), execute3(), execvp2(), fcn(), fcntl_example(), file_ctime_test(), find_and_open_master(), forkbuf(), fpathconf_test(), fsort(), fsort0(), ftruncate_test(), get_and_incr_x(), get_client(), get_client_mqd(), get_cwd(), get_max_pathname(), get_pathlist(), getaddr(), getargs(), getblksize(), getcwdx(), gethostbyaddr_ex(), getln(), getln2(), getnameinfo_ex(), gettoken(), handle_request(), handle_signals(), ifdb(), ignore_sig(), init_semi(), invoke(), junk(), lock(), ls_one(), main(), main1(), make_sockaddr(), msg_check(), new_reg(), op_semi(), option_async_io(), option_sync_io(), pcsync_init(), pcsync_unblock_children(), pcsync_wait_for_parent(), pipe_access_mode(), pipetest(), pipewrite(), pipewrite2(), pipewrite2bug(), playback(), print_cwd(), print_statvfs(), process(), process1(), process2(), prompt(), pt_close_master(), pt_open_master(), pt_open_slave(), pt_wait_master(), push_pathlist(), pwrite_test(), queue_event(), rcvall(), readany(), readany2(), readany3(), readany_test(), readany_test2(), readany_test3(), readbuf(), readdir_r_test(), readdir_test(), readrec(), redirect(), rmdir_test(), run_client(), run_server(), runtest(), scatter(), send_header(), send_header_notfound(), send_header_OK(), setblock(), setup_fdset(), setup_posix_msg(), setup_posix_sem(), setup_process(), setup_signal(), setup_systemv_msg(), setup_systemv_sem(), show_stat(), showlimit(), showpginfo(), sig_thread(), SimpleSemClose(), SimpleSemOpen(), SimpleSemPost(), SimpleSemRemove(), SimpleSemWait(), smi_close_shm(), smi_close_skt(), smi_open_fifo(), smi_open_mq(), smi_open_pshm(), smi_open_shm(), smi_open_skt(), smi_receive_getaddr_fifo(), smi_receive_getaddr_mq(), smi_receive_getaddr_pshm(), smi_receive_getaddr_shm(), smi_receive_getaddr_skt(), smi_receive_release_pshm(), smi_receive_release_shm(), smi_send_getaddr_pshm(), smi_send_getaddr_shm(), smi_send_release_fifo(), smi_send_release_mq(), smi_send_release_pshm(), smi_send_release_shm(), smi_send_release_skt(), sorter(), ssi_close_fd(), ssi_open(), ssi_wait_server(), store(), store_char(), synchronous(), synctest(), tc_keystroke(), tc_restore(), tc_setraw(), temp_open(), test_Bfdopen(), test_setblock(), test_setblock2(), testlock(), thread_fdset(), thread_func(), thread_heartbeat(), thread_process(), thread_signal(), thread_svmsg(), thread_svsem(), timestart(), timestop(), try2(), try3(), try4(), try5(), try6(), turnaround(), uem_bgn(), uem_register_fdset(), uem_register_heartbeat(), uem_register_process(), uem_register_signal(), uem_register_svmsg(), uem_register_svsem(), uem_unregister(), uem_wait(), unlock(), wait_and_display(), who_wc(), who_wc2(), writebuf(), and writerec().

#define ec_cmp var,
errrtn   ) 
 

Value:

{\
        assert(!ec_in_cleanup);\
        if ((intptr_t)(var) == (intptr_t)(errrtn)) {\
            ec_push(__func__, __FILE__, __LINE__, #var, errno, EC_ERRNO);\
            goto ec_cleanup_bgn;\
        }\
    }

Definition at line 25 of file ec.h.

Referenced by get_client(), main(), smi_open_mq(), and smi_open_pshm().

#define EC_EINTERNAL   INT_MAX
 

Definition at line 78 of file ec.h.

Referenced by syserrmsgline(), and syserrmsgtype().

#define ec_eof x   )     ec_cmp(x, EOF)
 

Definition at line 61 of file ec.h.

Referenced by backward_test(), copy4(), edsnd(), handle_request(), and turnaround().

#define EC_FAIL   ec_cmp(0, 0)
 

Definition at line 68 of file ec.h.

Referenced by a1(), a3(), access_test(), aup_sleep(), backward(), backward0(), backward2(), Bgetc(), Bopen_internal(), cget(), check_parent(), copy(), copy2(), copy2a(), copy3(), cready(), edinvoke(), ev_read(), execute3(), execvp2(), find_and_open_master(), fpathconf_test(), fsort(), fsort0(), get_client(), get_max_pathname(), getargs(), getcwdx(), getln(), getln2(), lock(), main(), make_sockaddr(), msg_check(), option_async_io(), option_sync_io(), pcsync_unblock_children(), pcsync_wait_for_parent(), pipewrite(), pipewrite2(), pipewrite2bug(), process2(), prompt(), pt_open_master(), pt_open_slave(), readany(), readany2(), readany3(), readrec(), run_client(), runtest(), scatter(), setup_fdset(), setup_posix_sem(), SimpleSemOpen(), SimpleSemRemove(), smi_open_fifo(), smi_open_mq(), smi_open_pshm(), smi_open_shm(), smi_receive_getaddr_fifo(), smi_receive_getaddr_skt(), smi_send_release_fifo(), ssi_open(), ssi_wait_server(), synctest(), temp_open(), test_Bfdopen(), test_setblock(), testlock(), thread_fdset(), try2(), try3(), try4(), uem_register_fdset(), who_wc(), who_wc2(), and writerec().

#define ec_false x   )     ec_cmp(x, false)
 

Definition at line 60 of file ec.h.

Referenced by Bclose(), biggest_file(), Bputc(), copy3(), copy4(), do_dir(), do_entry(), ftruncate_test(), getcwdx(), gettoken(), invoke(), junk(), main(), playback(), process(), process1(), process2(), pt_open_master(), rcvall(), runtest(), setup_fdset(), setup_posix_msg(), setup_posix_sem(), setup_process(), setup_signal(), setup_systemv_msg(), setup_systemv_sem(), show_stat(), smi_close_skt(), smi_open_fifo(), smi_receive_getaddr_skt(), ssi_open(), store(), store_char(), test_Bfdopen(), test_setblock(), test_setblock2(), testlock(), thread_fdset(), thread_heartbeat(), thread_process(), thread_signal(), thread_svmsg(), thread_svsem(), turnaround(), and uem_unregister().

#define EC_FLUSH str   ) 
 

Value:

{\
        ec_print();\
        ec_reinit();\
    }

Definition at line 72 of file ec.h.

Referenced by access_test(), asg(), asynchronous(), aup_sleep(), backward(), backward0(), backward2(), backward_test(), biggest_file(), cvt(), dir_read_test(), edinvoke(), exectest(), execute3(), fcntl_example(), file_ctime_test(), fpathconf_test(), fsort(), fsort0(), ftruncate_test(), getargs(), gethostbyaddr_ex(), getnameinfo_ex(), handle_request(), ifdb(), junk(), main(), pipe_access_mode(), pipetest(), pipewrite(), pipewrite2(), pipewrite2bug(), print_statvfs(), pwrite_test(), readany_test(), readany_test2(), readany_test3(), readdir_r_test(), readdir_test(), rmdir_test(), scatter(), send_header(), send_header_notfound(), send_header_OK(), showpginfo(), sig_thread(), synchronous(), synctest(), test_Bfdopen(), test_setblock(), test_setblock2(), testlock(), thread_fdset(), thread_func(), thread_heartbeat(), thread_process(), thread_signal(), thread_svmsg(), thread_svsem(), timestart(), timestop(), try2(), try3(), try4(), try5(), try6(), who_wc(), and who_wc2().

#define ec_neg1 x   )     ec_cmp(x, -1)
 

Definition at line 54 of file ec.h.

Referenced by asg(), asynchronous(), aup_sleep(), backward(), backward0(), backward2(), Bclose(), Bopen_internal(), check_parent(), command(), copy(), copy2(), copy2a(), cvt(), dir_read_test(), do_dir(), do_entry(), edinvoke(), entry_sig(), ev_creat(), ev_open(), ev_read(), ev_sleep(), ev_write(), exec_redirected(), exectest(), execute3(), execvp2(), fcn(), fcntl_example(), file_ctime_test(), find_and_open_master(), forkbuf(), fpathconf_test(), fsort(), fsort0(), ftruncate_test(), get_client(), get_client_mqd(), get_cwd(), getaddr(), getblksize(), getcwdx(), gethostbyaddr_ex(), handle_request(), handle_signals(), ignore_sig(), init_semi(), invoke(), junk(), lock(), ls_one(), main(), main1(), op_semi(), pcsync_init(), pcsync_unblock_children(), pcsync_wait_for_parent(), pipe_access_mode(), pipetest(), pipewrite(), pipewrite2(), pipewrite2bug(), playback(), print_statvfs(), process1(), process2(), pt_close_master(), pt_open_master(), pt_open_slave(), pt_wait_master(), pwrite_test(), readany2(), readany3(), readany_test(), readany_test2(), readany_test3(), readbuf(), readdir_r_test(), redirect(), rmdir_test(), run_client(), run_server(), runtest(), scatter(), send_header(), send_header_notfound(), send_header_OK(), setblock(), setup_fdset(), setup_posix_msg(), setup_posix_sem(), setup_signal(), setup_systemv_msg(), setup_systemv_sem(), showlimit(), showpginfo(), SimpleSemClose(), SimpleSemOpen(), SimpleSemPost(), SimpleSemRemove(), SimpleSemWait(), smi_close_shm(), smi_open_fifo(), smi_open_mq(), smi_open_pshm(), smi_open_shm(), smi_receive_getaddr_fifo(), smi_receive_getaddr_mq(), smi_receive_getaddr_pshm(), smi_receive_getaddr_shm(), smi_receive_getaddr_skt(), smi_receive_release_pshm(), smi_receive_release_shm(), smi_send_getaddr_pshm(), smi_send_getaddr_shm(), smi_send_release_fifo(), smi_send_release_mq(), smi_send_release_pshm(), smi_send_release_shm(), smi_send_release_skt(), ssi_close_fd(), ssi_open(), ssi_wait_server(), store(), synchronous(), synctest(), tc_keystroke(), tc_restore(), tc_setraw(), test_setblock(), thread_heartbeat(), thread_signal(), timestart(), timestop(), try2(), try3(), try4(), try5(), try6(), uem_bgn(), uem_register_signal(), unlock(), wait_and_display(), who_wc(), who_wc2(), and writebuf().

#define ec_null x   )     ec_cmp(x, 0)
 

Definition at line 58 of file ec.h.

Referenced by backward_test(), biggest(), Bopen_internal(), copy3(), copy4(), cvt(), edinvoke(), edrcv(), execvp2(), fcn(), get_cwd(), get_pathlist(), getcwdx(), handle_signals(), ifdb(), junk(), lock(), main(), new_reg(), print_cwd(), process1(), process2(), pt_open_master(), push_pathlist(), readdir_r_test(), readdir_test(), runtest(), scatter(), SimpleSemOpen(), smi_open_fifo(), smi_open_mq(), smi_open_pshm(), smi_open_shm(), smi_open_skt(), smi_send_getaddr_pshm(), smi_send_getaddr_shm(), smi_send_release_pshm(), ssi_open(), test_Bfdopen(), thread_fdset(), thread_heartbeat(), thread_process(), thread_signal(), thread_svmsg(), thread_svsem(), uem_register_fdset(), uem_register_heartbeat(), uem_register_process(), uem_register_signal(), uem_register_svmsg(), uem_register_svsem(), and unlock().

#define ec_nzero x   ) 
 

Value:

{\
        if ((x) != 0)\
            EC_FAIL\
    }

Definition at line 62 of file ec.h.

Referenced by readdir_test().

#define ec_rv var   ) 
 

Value:

{\
        int errrtn;\
        assert(!ec_in_cleanup);\
        if ((errrtn = (var)) != 0) {\
            ec_push(__func__, __FILE__, __LINE__, #var, errrtn, EC_ERRNO);\
            goto ec_cleanup_bgn;\
        }\
    }

Definition at line 34 of file ec.h.

Referenced by asynchronous(), dequeue_event(), get_and_incr_x(), handle_signals(), main(), queue_event(), readdir_r_test(), sig_thread(), sorter(), thread_fdset(), thread_func(), try5(), uem_bgn(), uem_register_fdset(), uem_register_heartbeat(), uem_register_process(), uem_register_signal(), uem_register_svmsg(), uem_register_svsem(), uem_unregister(), and uem_wait().

#define ec_zero x   )     ec_null(x)
 

Definition at line 59 of file ec.h.


Enumeration Type Documentation

enum EC_ERRTYPE
 

Enumeration values:
EC_ERRNO 
EC_EAI 
EC_GETDATE 
EC_NONE 

Definition at line 13 of file ec.h.

Referenced by Ux::Error::get_type().


Function Documentation

void ec_print void   ) 
 

Definition at line 110 of file ec.c.

References ec_node::ec_context, ec_node::ec_errno, ec_head, ec_mutex(), ec_node::ec_next, ec_node_emergency, ec_node::ec_type, logfmt(), and syserrmsgtype().

Referenced by ec_atexit_fcn(), and ec_push().

void ec_push const char *  fcn,
const char *  file,
int  line,
const char *  str,
int  errno_arg,
EC_ERRTYPE  type
 

Definition at line 65 of file ec.c.

References atexit(), ec_atexit_fcn(), ec_node::ec_context, EC_ERRNO, ec_node::ec_errno, ec_head, ec_mutex(), ec_node::ec_next, ec_node_emergency, ec_print(), ec_s_emergency, ec_node::ec_type, errno, SEP1, SEP2, and SEP3.

void ec_reinit void   ) 
 

Definition at line 131 of file ec.c.

References ec_node::ec_context, ec_head, ec_mutex(), ec_node::ec_next, ec_node_emergency, and ec_s_emergency.

Referenced by testlock().

void ec_warn void   ) 
 

Definition at line 149 of file ec.c.


Variable Documentation

const bool ec_in_cleanup
 

Definition at line 11 of file ec.h.


Generated on Fri Apr 23 10:57:11 2004 for AUP2 Example Source by doxygen 1.3.1