Definitions in pps.h

Preprocessor macro definitions for the pps.h header file in the libhnm library.


#define PPS_OBJECT_BASE pps_ObjectId    type ;                                          \
        int             fd ;                                            \
        char            path[ 517 ] ;                                   \
        struct pollfd*  pollfd ;                                        \
        void*           object_data ;                                   \
        void            (*pps_handler)( pps_Object* object ) ;          \
        void            (*pps_update)( pps_Object* object ) ;           \
        int             (*open)( pps_Object* self, const char* basename ) ; \
        void            (*close)( pps_Object* self ) ;                  \
        int             (*read)( pps_Object* self, char** buffer ) ;    \
        int             (*write)( pps_Object* self, const char* pps_data, unsigned pps_data_size ) ; \
        int             (*addToPollList)( pps_Object* self, struct pollfd poll_list[], unsigned poll_list_size )

PPS_OBJECT_BASE defines the base structure for PPS objects.

PPS_OBJECT_BASE contains the following:
  • type The object ID that identifies the derived object type.
  • fd The file descriptor of the PPS object. This can be passed to a poll() system call to wait for input on the associated PPS object. If fd is less than zero, then the PPS object is currently closed.
  • path The path of the PPS object. The length of the path can be a maximum of 517 characters. This path is relative to the base PPS URI assigned to the PPS Object subsystem.
  • pollfd A pointer to a pollfd list entry used to poll for events on the associated PPS object.
  • object_data A pointer to object-specific data. This mechanism provides some rudimentary polymorphism by associating object-specific member data with the high-level PPS object.
  • pps_handler A pointer to a handler callback function that's called by the HNM system whenever a PPS message is received from a connecting client.
  • pps_update Callback to push changes to the Status object to subscribers of the PPS interface.

NOTE: For the functions contained here, see Functions in pps.h.