Formats an event into a string for print diagnostics.
DWORD ctaFormatEvent ( char *lineprefix, CTA_EVENT *ctaevt, char *buffer, unsigned size)
Argument |
Description |
lineprefix |
Pointer to a character string that is placed at the beginning of every new line in the formatted event string. |
ctaevt |
Pointer to an event structure to be formatted. The CTA_EVENT structure is: typedef struct |
buffer |
Pointer to the buffer to receive the event string. |
size |
Size of the buffer in bytes. |
Return value |
Description |
SUCCESS |
|
CTAERR_BAD_ARGUMENT |
buffer is NULL. |
CTAERR_BAD_SIZE |
size is not big enough to fit the formatted event. |
CTAERR_NOT_FOUND |
The service to format the event is not found. |
CTAERR_NOT_INITIALIZED |
Natural Access is not initialized. Call ctaInitialize first. |
CTAERR_SVR_COMM |
Server communication error. |
ctaFormatEvent creates a detailed textual description of the event.
Note: If you are working with OAM service events, refer to the NMS OAM Service Developer's Reference Manual for information on formatting events.
void DemoShowEvent( CTA_EVENT *event )
{
char format_buffer[CTA_MAX_FORMAT_SIZE];
char *prefix = "\t\t\t"; /* default demo indent */
format_buffer[0] = '\0';
ctaFormatEvent( prefix, event, format_buffer, CTA_MAX_FORMAT_SIZE );
printf( "%s", format_buffer );
}