amaru_proto.h

This file contains function prototypes for the AMARU library. The following is a listing of this file:

#ifndef _AMARU_PROTO_H

#define _AMARU_PROTO_H

#ifdef WIN32

#include <inc_path/ddl.h>

#include <inc_path/sc_recs.h>

#include <inc_path/am_defs.h>

#ifndef AmaruExport

#define AmaruExport

#endif

#ifdef __cplusplus

  extern "C" {

#endif

AmaruExport int amaru_add_update(

                        TCHAR *bodyptr, int bodylen, TCHAR first_seg,

                        const TCHAR *alarm_id, const TCHAR *fr_id,

                        const TCHAR *user_or_serv_id, const TCHAR *ref_id,

                        int action, int seq_num, int resp_type, int key,

                        struct cor_status *ret_stat );

AmaruExport int amaru_add_update_stamp(

                        TCHAR *bodyptr, int bodylen, TCHAR first_seg,

                        const TCHAR *alarm_id, const TCHAR *fr_id,

                        const TCHAR *user_or_serv_id, const TCHAR *ref_id,

                        int action, int seq_num, int resp_type, int key,

                        COR_STAMP stamp, struct cor_status *ret_stat );

AmaruExport int amaru_add_gen(

                        TCHAR *bodyptr, int bodylen, TCHAR first_seg,

                        const TCHAR *alarm_id, const TCHAR *fr_id,

                        const TCHAR *user_or_serv_id, const TCHAR *ref_id,

                        int resp_type, int key, struct am_msg_field *msg_field,

                        int num_fields, TCHAR reset_follows,

                        struct cor_status *ret_stat );

AmaruExport int amaru_add_gen_stamp(

                        TCHAR *bodyptr, int bodylen, TCHAR first_seg,

                        const TCHAR *alarm_id, const TCHAR *fr_id,

                        const TCHAR *user_or_serv_id, const TCHAR *ref_id,

                        int resp_type, int key, struct am_msg_field *msg_field,

                        int num_fields, TCHAR reset_follows,

                        COR_STAMP stamp, struct cor_status *ret_stat );

AmaruExport void amaru_alloc_buffer(struct IPC_datagram **buffer ,int *length,TCHAR **body_ptr );

AmaruExport void amaru_free_buffer(struct IPC_datagram *buffer);

AmaruExport int amaru_init(struct cor_status *ret_stat);

AmaruExport int amaru_purge(TCHAR *user_or_serv_id,int dg_port_index,struct IPC_datagram *send_buffer_ptr,TCHAR *send_body_ptr,int send_buffer_len,struct IPC_datagram *recv_buffer_ptr,TCHAR *recv_body_ptr,int recv_buffer_len,struct cor_status *ret_stat);

AmaruExport void amaru_get_resp(TCHAR *body_ptr,int i,struct cor_status *ret_stat);

AmaruExport int amaru_send_msg(int port_id,struct IPC_datagram *wrt_buf,struct IPC_datagram *read_buf,int read_buf_len,TCHAR *alarm_mgr_id,struct cor_status *ret_stat);

AmaruExport void amaru_terminate();

AmaruExport int amaru_num_messages(TCHAR *body_ptr,struct cor_status *ret_stat);

AmaruExport int amaru_client_init(const TCHAR *system, COR_STATUS *retstat);

AmaruExport COR_BOOLEAN amaru_is_initialized();

#define AMARU_STYLE_LOCAL_AM 0x01

#define AMARU_STYLE_ACTIVE_AM_IF_MASTER 0x02

AmaruExport void amaru_set_style(int style);

AmaruExport int amaru_send_comment (

                                    TCHAR           *bodyptr,    /* pointer to message body */

                                    int             bodylen,     /* length of message body */

                                    TCHAR           *alarm_id,

                                    TCHAR           *fr_id,

                                    TCHAR           *user_or_serv_id,

                                    TCHAR           *ref_id,

                                    TCHAR         *alarm_comment,

                                    COR_STATUS *ret_stat);

AmaruExport int amaru_setup_default (

                               TCHAR            *setup_id,

                               TCHAR            *user_id,

                               int            dg_port_index,

                               IPCDG  *send_buffer_ptr,

                               TCHAR  *send_body_ptr,

                               int  send_buffer_len,

                               IPCDG  *recv_buffer_ptr,

                               TCHAR  *recv_body_ptr,

                               int  recv_buffer_len,

                               COR_STATUS *ret_stat);

AmaruExport int amaru_setup_delete (

                               TCHAR            *setup_id,

                               TCHAR            *user_id,

                               int            dg_port_index,

                               IPCDG          *send_buffer_ptr,

                               TCHAR          *send_body_ptr,

                               int            send_buffer_len,

                               IPCDG          *recv_buffer_ptr,

                               TCHAR          *recv_body_ptr,

                               int            recv_buffer_len,

                               COR_STATUS     *ret_stat);

AmaruExport int amaru_setup_save_start (

                                       TCHAR            *setup_id,

                                       TCHAR            *user_id,

                                       int  num_rpts,

                                       AM_FILTER_TYPE primary_filter,

                                       int  dg_port_index,

                                       IPCDG  *send_buffer_ptr,

                                       TCHAR  *send_body_ptr,

                                       int  send_buffer_len,

                                       IPCDG  *recv_buffer_ptr,

                                       TCHAR  *recv_body_ptr,

                                       int  recv_buffer_len,

                                       COR_STATUS *ret_stat);

AmaruExport int amaru_setup_save_repeat (

                                   AM_FILTER_TYPE  filter_type,

                                   COR_STAMP       *start_time,

                                   TCHAR           *class_id,

                                   AM_STATE_TYPE    alarm_state,

                                   TCHAR            *fr_id,

                                   COR_STATUS *ret_stat);

/* Private internal functions - For GE Fanuc use only. */

int amaru_tls_initialize_process();

int amaru_tls_terminate_process();

int amaru_tls_initialize_thread(RECORD_PTR data);

int amaru_tls_terminate_thread();

int amaru_rcm_init(COR_STATUS *retstat);

int amaru_rcm_init_root(RECORD_PTR amaru_root, COR_STATUS *retstat);

RECORD_PTR amaru_tls_get();

void amaru_force_terminate();

void amaru_force_terminate_root(RECORD_PTR amaru_root);

AmaruExport int amaru_client_init_root(const TCHAR *sysname,

                                                 RECORD_PTR *amaru_root, COR_STATUS *retstat);

AmaruExport int amaru_purge_root (

TCHAR  user_or_serv_id [COR_MAX(USER_ID_LEN, SERVICE_ID_LEN) + 1],

int  dg_port_index,

IPCDG  *send_buffer_ptr,

TCHAR  *send_body_ptr,

int  send_buffer_len,

IPCDG  *recv_buffer_ptr,

TCHAR  *recv_body_ptr,

int  recv_buffer_len,

RECORD_PTR amaru_root,

COR_STATUS *ret_stat);

AmaruExport int amaru_setup_default_root (

TCHAR            *setup_id,

TCHAR            *user_id,

int  dg_port_index,

IPCDG  *send_buffer_ptr,

TCHAR  *send_body_ptr,

int  send_buffer_len,

IPCDG  *recv_buffer_ptr,

TCHAR  *recv_body_ptr,

int  recv_buffer_len,

RECORD_PTR amaru_root,

COR_STATUS *ret_stat);

AmaruExport int amaru_setup_delete_root (

TCHAR            *setup_id,

TCHAR            *user_id,

int  dg_port_index,

IPCDG  *send_buffer_ptr,

TCHAR  *send_body_ptr,

int  send_buffer_len,

IPCDG  *recv_buffer_ptr,

TCHAR  *recv_body_ptr,

int  recv_buffer_len,

RECORD_PTR amaru_root,

COR_STATUS *ret_stat);

AmaruExport int amaru_setup_save_start_root (

TCHAR            *setup_id,

TCHAR            *user_id,

int  num_rpts,

AM_FILTER_TYPE primary_filter,

int  dg_port_index,

IPCDG  *send_buffer_ptr,

TCHAR  *send_body_ptr,

int  send_buffer_len,

IPCDG  *recv_buffer_ptr,

TCHAR  *recv_body_ptr,

int  recv_buffer_len,

RECORD_PTR amaru_root,

COR_STATUS *ret_stat);

AmaruExport int amaru_setup_save_repeat_root (

AM_FILTER_TYPE  filter_type,

COR_STAMP       *start_time,

TCHAR            *class_id,

AM_STATE_TYPE   alarm_state,

TCHAR            *fr_id,

RECORD_PTR amaru_root,

COR_STATUS *ret_stat);

AmaruExport int amaru_add_gen_root (

TCHAR         *bodyptr,          /* pointer to message body */

int           bodylen,           /* length of message body */

COR_BOOLEAN   first_seg,         /* first segment ?  */

const TCHAR   *alarm_id,         /* [ALARM_ID_LEN+1] */

const TCHAR   *fr_id,            /* [FR_ID_LEN+1] */

const TCHAR   *user_or_serv_id,  /* [COR_MAX(USER_ID_LEN, SERVICE_ID_LEN)+1] */

const TCHAR   *ref_id,           /* [AM_REF_ID_LEN+1] */

AM_RESP_TYPE  resp_type,

AM_RESP_KEY   key,

AM_MSG_FIELD  msg_field[],

int           num_fields,

COR_BOOLEAN   reset_follows,

RECORD_PTR    amaru_root,

COR_STATUS    *ret_stat);

AmaruExport int amaru_add_gen_stamp_root (

TCHAR         *bodyptr,          /* pointer to message body */

int           bodylen,           /* length of message body */

COR_BOOLEAN   first_seg,         /* first segment ?  */

const TCHAR   *alarm_id,         /* [ALARM_ID_LEN+1] */

const TCHAR   *fr_id,            /* [FR_ID_LEN+1] */

const TCHAR   *user_or_serv_id,  /* [COR_MAX(USER_ID_LEN, SERVICE_ID_LEN)+1] */

const TCHAR   *ref_id,           /* [AM_REF_ID_LEN+1] */

AM_RESP_TYPE  resp_type,

AM_RESP_KEY   key,

AM_MSG_FIELD  msg_field[],

int           num_fields,

COR_BOOLEAN   reset_follows,

COR_STAMP     gentime,

RECORD_PTR    amaru_root,

COR_STATUS    *ret_stat);

AmaruExport int amaru_add_update_root (

TCHAR        *bodyptr,                  /* pointer to message body */

int           bodylen,                  /* length of message body */

COR_BOOLEAN   first_seg,                 /* first segment ?  */

const TCHAR alarm_id[ALARM_ID_LEN+1],

const TCHAR fr_id[FR_ID_LEN+1],

const TCHAR user_or_serv_id[COR_MAX(USER_ID_LEN, SERVICE_ID_LEN)+1],

const TCHAR ref_id[AM_REF_ID_LEN+1],

AM_STATE_TYPE action,

COR_I4       seq_num,

AM_RESP_TYPE resp_type,

AM_RESP_KEY  key,

RECORD_PTR amaru_root,

COR_STATUS    *ret_stat);

AmaruExport int amaru_add_update_ex_root (

TCHAR        *bodyptr,                   /* pointer to message body */

int          bodylen,                    /* length of message body */

COR_BOOLEAN  first_seg,                  /* first segment ?  */

const TCHAR alarm_id[ALARM_ID_LEN+1],

const TCHAR fr_id[FR_ID_LEN+1],

const TCHAR user_or_serv_id[COR_MAX(USER_ID_LEN, SERVICE_ID_LEN)+1],

const TCHAR ref_id[AM_REF_ID_LEN+1],

AM_STATE_TYPE action,

COR_I4       seq_num,

AM_RESP_TYPE resp_type,

AM_RESP_KEY  key,

RECORD_PTR amaru_root,

const TCHAR *conc_alarm_id,

COR_STATUS   *ret_stat);

AmaruExport int amaru_pass_root (

TCHAR        *bodyptr,                 /* pointer to message body */

int          bodylen,                  /* length of message body */

COR_BOOLEAN  first_seg,                /* first segment ?  */

COR_I4       seg_type ,

COR_I4       seg_len ,

TCHAR        *seg_ptr ,

AM_RESP_TYPE resp_type,

RECORD_PTR amaru_root,

COR_STATUS   *ret_stat) ;

AmaruExport int amaru_add_update_stamp_root(

TCHAR        *bodyptr,                  /* pointer to message body */

int           bodylen,                  /* length of message body */

COR_BOOLEAN first_seg,                 /* first segment ?    */

const TCHAR alarm_id[ALARM_ID_LEN+1],

const TCHAR fr_id[FR_ID_LEN+1],

const TCHAR user_or_serv_id[COR_MAX(USER_ID_LEN, SERVICE_ID_LEN)+1],

const TCHAR ref_id[AM_REF_ID_LEN+1],

AM_STATE_TYPE action,

COR_I4       seq_num,

AM_RESP_TYPE resp_type,

AM_RESP_KEY  key,

COR_STAMP upd_time,

RECORD_PTR amaru_root,

COR_STATUS   *ret_stat);

AmaruExport int amaru_send_msg_root(

int    port_id,     /* IPC port where message is sent */

IPCDG  *wrt_buf,    /* Buffer containing message to be sent */

IPCDG  *read_buf,   /* Buffer to contain message received   */

int    read_buf_len,      /* Maximum Length of read buffer  */

TCHAR  *alarm_mgr_id,     /* Identifier of Alarm Manager    */

RECORD_PTR amaru_root,

COR_STATUS   *ret_stat);

AmaruExport int amaru_send_comment_root (

TCHAR        *bodyptr,                  /* pointer to message body */

int          bodylen,                   /* length of message body */

TCHAR        *alarm_id,

TCHAR        *fr_id,

TCHAR        *user_or_serv_id,

TCHAR        *ref_id,

TCHAR            *alarm_comment,

RECORD_PTR amaru_root,

COR_STATUS   *ret_stat);

AmaruExport int amaru_send_comment_ex_root (

TCHAR        *bodyptr,                  /* pointer to message body */

int          bodylen,                   /* length of message body */

TCHAR        *alarm_id,

TCHAR        *conc_alarm_id,

TCHAR        *fr_id,

TCHAR        *user_or_serv_id,

TCHAR        *ref_id,

TCHAR            *alarm_comment,

RECORD_PTR amaru_root,

COR_STATUS   *ret_stat);

AmaruExport int amaru_send_comment2_root (

TCHAR        *bodyptr,                  /* pointer to message body */

int          bodylen,                   /* length of message body */

TCHAR        action,                    /* 'A'dd, 'D'elete */

TCHAR        *alarm_id,

TCHAR        *conc_alarm_id,

TCHAR        *fr_id,

TCHAR        *user_or_serv_id,

TCHAR        *ref_id,

TCHAR            *alarm_comment,

const COR_STAMP       *pgentime,

RECORD_PTR amaru_root,

COR_STATUS   *ret_stat);

AmaruExport int amaru_local_send_msg(

int    port_id,     /* IPC port where message is sent */

IPCDG  *wrt_buf,    /* Buffer containing message to be sent */

IPCDG  *read_buf,   /* Buffer to contain message received */

int    read_buf_len,      /* Maximum Length of read buffer */

const TCHAR   *alarm_mgr_id,      /* Identifier of Alarm Manager        */

COR_STATUS    *ret_stat) ;

AmaruExport int amaru_local_send_msg_root(

int    port_id,    /* IPC port where message is sent  */

IPCDG  *wrt_buf,   /* Buffer containing message to be sent */

IPCDG  *read_buf,  /* Buffer to contain message received   */

int    read_buf_len,/* Maximum Length of read buffer   */

const TCHAR *alarm_mgr_id,      /* Identifier of Alarm Manager         */

RECORD_PTR amaru_root,

COR_STATUS   *ret_stat) ;

AmaruExport int amaru_local_pass_msg(

int    port_id,     /* IPC port where message is sent */

IPCDG  *wrt_buf,    /* Buffer containing message to be sent */

IPCDG  *read_buf,   /* Buffer to contain message received   */

int    read_buf_len,      /* Maximum Length of read buffer  */

const TCHAR  *alarm_mgr_id,      /* Identifier of Alarm Manager          */

COR_BOOLEAN     rr,

COR_STATUS   *ret_stat) ;

AmaruExport int amaru_local_pass_msg_root(

int    port_id,     /* IPC port where message is sent */

IPCDG  *wrt_buf,    /* Buffer containing message to be sent */

IPCDG  *read_buf,   /* Buffer to contain message received   */

int    read_buf_len,      /* Maximum Length of read buffer  */

const TCHAR  *alarm_mgr_id,      /* Identifier of Alarm Manager          */

COR_BOOLEAN     rr,

RECORD_PTR amaru_root,

COR_STATUS    *ret_stat) ;

AmaruExport void amaru_terminate_root(RECORD_PTR amaru_root);

AmaruExport int amaru_delete (

TCHAR        user_or_serv_id[],

int          dg_port_index,

IPCDG        *send_buffer_ptr,

TCHAR        *send_body_ptr,

int          send_buffer_len,

IPCDG        *recv_buffer_ptr,

TCHAR        *recv_body_ptr,

int          recv_buffer_len,

COR_BOOLEAN     local_send ,

struct cor_status *ret_stat) ;

AmaruExport int amaru_delete_root (

TCHAR        user_or_serv_id[],

int          dg_port_index,

IPCDG        *send_buffer_ptr,

TCHAR        *send_body_ptr,

int          send_buffer_len,

IPCDG        *recv_buffer_ptr,

TCHAR        *recv_body_ptr,

int          recv_buffer_len,

RECORD_PTR amaru_root,

COR_BOOLEAN     local_send ,

struct cor_status *ret_stat) ;

AmaruExport COR_I4 amu_request_external_state_management(

int     port_id ,   /* IPC port where message is sent */

IPCDG   *wrt_buf ,  /* Buffer containing message to be sent */

int     wbodylen ,

IPCDG   *read_buf , /* Buffer to contain message received */

int     read_buf_len , /* maximum length of read buffer */

const TCHAR   *alarm_mgr_id , /* Identifier of alarm manager */

COR_BOOLEAN enable_support ,

const TCHAR   *proc_name ,

const TCHAR   *port_name ,    /* IPC port name for comm to AMRP */

const TCHAR   *port_name2 ,    /* IPC port name to rcv updates */

const TCHAR   *user_or_srv_id , /* assoc this id with this req. channel */

COR_STATUS  *ret_stat ) ;

AmaruExport COR_I4 amu_request_external_state_management_root(

int     port_id ,   /* IPC port where message is sent */

IPCDG   *wrt_buf ,  /* Buffer containing message to be sent */

int     wbodylen ,

IPCDG   *read_buf , /* Buffer to contain message received */

int     read_buf_len , /* maximum length of read buffer */

const TCHAR   *alarm_mgr_id , /* Identifier of alarm manager */

COR_BOOLEAN enable_support ,

const TCHAR   *proc_name ,

const TCHAR   *port_name ,    /* IPC port name for comm to AMRP */

const TCHAR   *port_name2 ,    /* IPC port name to rcv updates */

const TCHAR   *user_or_srv_id , /* assoc this id with this req. channel */

RECORD_PTR amaru_root ,

COR_STATUS  *ret_stat );

AmaruExport COR_I4 amu_get_extmgr_upd(

AMU_UPDATE_INFO *pamu_update_info ,

TCHAR           *body_ptr ,

int             i ,

COR_STATUS      *ret_stat ) ;

AmaruExport int amaru_add_verify_gen_stamp(

                        TCHAR *bodyptr, int bodylen, TCHAR first_seg,

                        const TCHAR *alarm_id, const TCHAR *fr_id,

                        const TCHAR *user_or_serv_id, const TCHAR *ref_id,

                        int resp_type, int key, struct am_msg_field *msg_field,

                        int num_fields, COR_BOOLEAN havegentime, COR_STAMP genstamp,

                        int cur_state, COR_I4 cleared_time,

                        struct cor_status *ret_stat );

AmaruExport int amaru_add_verify_gen_stamp_root (

TCHAR         *bodyptr,          /* pointer to message body */

int           bodylen,           /* length of message body */

COR_BOOLEAN   first_seg,         /* first segment ?    */

const TCHAR   *alarm_id,         /* [ALARM_ID_LEN+1] */

const TCHAR   *fr_id,            /* [FR_ID_LEN+1] */

const TCHAR   *user_or_serv_id,  /* [COR_MAX(USER_ID_LEN, SERVICE_ID_LEN)+1] */

const TCHAR   *ref_id,           /* [AM_REF_ID_LEN+1] */

AM_RESP_TYPE  resp_type,

AM_RESP_KEY   key,

AM_MSG_FIELD  msg_field[],

int           num_fields,

COR_BOOLEAN   havegentime,

COR_STAMP     gentime,

int           cur_state,

COR_I4        cleared_time,

RECORD_PTR    amaru_root,

COR_STATUS    *ret_stat);

#define DECLARE_AMARU_ROOT RECORD_PTR amaru_root = amaru_tls_get()

#ifdef __cplusplus

  } /* C++ */

#endif

#ifdef __cplusplus

#include <inc_path/ipc.hpp>

  AmaruExport int amaru_remote_send_msg(CIPC *system,DADDR *daddr,COR_STATUS *retstat);

  AmaruExport int amaru_remote_send_msg(CIPC *ipc, const TCHAR *system, COR_STATUS *retstat);

AmaruExport int amaru_remote_send_msg_root(CIPC *ipc, DADDR *daddr, RECORD_PTR amaru_root,

                                     COR_STATUS *retstat);

AmaruExport int amaru_remote_send_msg_root(CIPC *ipc, const TCHAR *system, RECORD_PTR amaru_root,

                                     COR_STATUS *retstat);

inline

AmaruExport int amaru_add_comment2_root (

TCHAR        *bodyptr,                  /* pointer to message body */

int          bodylen,                   /* length of message body  */

TCHAR        *alarm_id,

TCHAR        *conc_alarm_id,

TCHAR        *fr_id,

TCHAR        *user_or_serv_id,

TCHAR        *ref_id,

TCHAR            *alarm_comment,

const COR_STAMP        *pgentime,

RECORD_PTR amaru_root,

COR_STATUS   *ret_stat,

TCHAR        action=AM_COMMENT_ACT_ADD /* 'A'dd, 'D'elete */

)

{ return amaru_send_comment2_root(bodyptr, bodylen, action, alarm_id,

                          conc_alarm_id, fr_id, user_or_serv_id,

                          ref_id, alarm_comment, pgentime, amaru_root, ret_stat) ;

}

inline

AmaruExport int amaru_del_comment2_root (

TCHAR        *bodyptr,                  /* pointer to message body */

int          bodylen,                   /* length of message body */

TCHAR        *alarm_id,

TCHAR        *conc_alarm_id,

TCHAR        *fr_id,

TCHAR        *user_or_serv_id,

TCHAR        *ref_id,

TCHAR            *alarm_comment,

const COR_STAMP     *pgentime,

RECORD_PTR amaru_root,

COR_STATUS   *ret_stat,

TCHAR        action=AM_COMMENT_ACT_DELETE          /* 'A'dd, 'D'elete */

)

{ return amaru_send_comment2_root(bodyptr, bodylen, action, alarm_id,

                          conc_alarm_id, fr_id, user_or_serv_id,

                          ref_id, alarm_comment, pgentime, amaru_root, ret_stat) ;

}

#endif

#endif

#endif

More information

Alarm Management definitions header files.