ctaGetEventSources

Retrieves a list of service names from which the specified context receives events.

Prototype

DWORD ctaGetEventSources ( CTAHD ctahd, char *svcname[], unsigned nsvcs)

Argument

Description

ctahd

Context handle.

svcname

Pointer to a buffer to return a list of services sending events to the context.

nsvcs

Number of services in the list.


Return values

Return value

Description

SUCCESS

 

CTAERR_BAD_ARGUMENT

Buffer is NULL.

CTAERR_BAD_SIZE

Size of the buffer is too small for the list of service names.

CTAERR_INVALID_CTAHD

An invalid context handle was passed as an argument to a function, or the context was destroyed by another thread.

CTAERR_NOT_IMPLEMENTED

This function is not available in the execution mode associated with the specified context.

CTAERR_NOT_INITIALIZED

Natural Access is not initialized. Call ctaInitialize first.

CTAERR_SVR_COMM

Server communication error.


Details

ctaGetEventSources retrieves the list of services from which the context receives events. Use ctaSetEventSources to specify or change the list of services from which the context receives events.

Refer to Receiving events on event queues for more information.

See also

ctaAttachContext, ctaCreateContextEx

Example

char svcnamebuffer[SVC_NAME_BUFFER_SIZE];
ret = ctaGetEventSources(ctahd, svcname[], nsvcs);
if (ret == SUCCESS)
{
     printf("The services which are masked are:\n");
     PrintStringofStrings(svcnamebuffer);
}