MATES / Modular Automatic Test Equipment System API  2.5.0.0
mates_test_34.c
#include <stdio.h>
#include "mates.h"
int main(void)
{
char buf[100];
int val;
MATES_HANDLE h1 = mates_open("proxy.mon", 1);
MATES_HANDLE h2 = mates_open("missing.mon", 0);
int idx = 0;
while (mates_get_last_error_ex(h1, buf, sizeof(buf)) > 0)
{
/* Note: each message has a newline. */
printf("GET EX 1 #%04d: %s", idx++, buf);
}
/* Try empty handle. */
while (mates_get_last_error_ex(NULL, buf, sizeof(buf)) > 0)
{
/* Note: each message has a newline. */
printf("GET EX 2 #%04d: %s", idx++, buf);
}
/* Try another handle. */
while (mates_get_last_error_ex(h2, buf, sizeof(buf)) > 0)
{
/* Note: each message has a newline. */
printf("GET EX 3 #%04d: %s", idx++, buf);
}
return (0);
}