Returns the current value of a counter.
X.25 Communications Library (libx25s.a)
int x25_ctr_test(ctr_id) int ctr_id;
The x25_ctr_test subroutine returns the current value of an active counter for testing.
ctr_id | Contains the Counter identifier allocated by a previous x25_ctr_get subroutine. |
If successful, the x25_ctr_test subroutine returns the current value of the counter. If an error occurs, the x25_ctr_test subroutine returns a value of -1 and sets the x25_errno global variable to one of the error codes shown below.
On failure, the x25_errno global variable is set to one of the following:
The following code structure determines how many messages for a call are waiting to be received, assuming an array of calls information is available:
ctr_id = calls[i].counter_id; number_of_messages = x25_ctr_test(ctr_id); if (number_of_messages == 0) (void)printf("There are no messages waiting\n"); else if (number_of_messages > 0) (void)printf("The number of messages waiting is %d\n", number_of_messages);
Note: The array used here is not part of the X.25 API.
This subroutine is part of X.25 Application in Base Operating System (BOS) Extensions 2.
The x25_ctr_get subroutine, x25_ctr_remove subroutine, x25_ctr_wait subroutine.
Processing Calls with the X.25 API, X.25 Overview for Programming in AIX Version 4.3 Communications Programming Concepts.