PAPI  5.7.0.0
papi_error_codes.c
Go to the documentation of this file.
1 /*
2  * This utility loops through all the PAPI error codes and displays them in
3  * table format
4 */
5 
31 #include <stdio.h>
32 
33 #include "papi.h"
34 
35 int
36 main( int argc, char **argv )
37 {
38  int i=0;
39  int retval;
40 
41  (void)argc;
42  (void)argv;
43 
45  if (retval != PAPI_VER_CURRENT ) {
46  fprintf(stderr,"Error with PAPI_library_init!\n");
47  return retval;
48  }
49 
50  printf( "\n----------------------------------\n" );
51  printf( "For PAPI Version: %d.%d.%d.%d\n",
56  printf( "----------------------------------\n" );
57  while ( 1 ) {
58  char *errstr;
59  errstr = PAPI_strerror( -i );
60 
61  if ( NULL == errstr ) {
62  break;
63  }
64 
65  printf( "Error code %4d: %s\n", -i, errstr );
66  i++;
67  }
68  printf( "There are %d error codes defined\n", i );
69  printf( "----------------------------------\n\n" );
70 
71  return 0;
72 }
#define PAPI_VER_CURRENT
Definition: fpapi.h:14
int retval
Definition: zero_fork.c:53
Return codes and api definitions.
#define PAPI_VERSION
Definition: fpapi.h:15
int PAPI_library_init(int version)
Definition: papi.c:500
#define PAPI_VERSION_MAJOR(x)
Definition: papi.h:217
#define PAPI_VERSION_REVISION(x)
Definition: papi.h:219
#define PAPI_VERSION_MINOR(x)
Definition: papi.h:218
char * PAPI_strerror(int errorCode)
Definition: papi.c:4603
int main(int argc, char **argv)
#define PAPI_VERSION_INCREMENT(x)
Definition: papi.h:220
int i
Definition: fileop.c:140