diff --git a/contrib/platform/win32/keyval_lex.c b/contrib/platform/win32/keyval_lex.c new file mode 100644 index 0000000000..2f4b5136f0 --- /dev/null +++ b/contrib/platform/win32/keyval_lex.c @@ -0,0 +1,1765 @@ +#define yy_create_buffer opal_util_keyval_yy_create_buffer +#define yy_delete_buffer opal_util_keyval_yy_delete_buffer +#define yy_scan_buffer opal_util_keyval_yy_scan_buffer +#define yy_scan_string opal_util_keyval_yy_scan_string +#define yy_scan_bytes opal_util_keyval_yy_scan_bytes +#define yy_flex_debug opal_util_keyval_yy_flex_debug +#define yy_init_buffer opal_util_keyval_yy_init_buffer +#define yy_flush_buffer opal_util_keyval_yy_flush_buffer +#define yy_load_buffer_state opal_util_keyval_yy_load_buffer_state +#define yy_switch_to_buffer opal_util_keyval_yy_switch_to_buffer +#define yyin opal_util_keyval_yyin +#define yyleng opal_util_keyval_yyleng +#define yylex opal_util_keyval_yylex +#define yyout opal_util_keyval_yyout +#define yyrestart opal_util_keyval_yyrestart +#define yytext opal_util_keyval_yytext +#define yywrap opal_util_keyval_yywrap + +/* A lexical scanner generated by flex */ + +/* Scanner skeleton version: + * $Header: /home/daffy/u0/vern/flex/RCS/flex.skl,v 2.91 96/09/10 16:58:48 vern Exp $ + */ + +#define FLEX_SCANNER +#define YY_FLEX_MAJOR_VERSION 2 +#define YY_FLEX_MINOR_VERSION 5 + +#include +#include + +/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */ +#ifdef c_plusplus +#ifndef __cplusplus +#define __cplusplus +#endif +#endif + + +#ifdef __cplusplus + +#include +#ifndef _WIN32 +#include +#endif + +/* Use prototypes in function declarations. */ +#define YY_USE_PROTOS + +/* The "const" storage-class-modifier is valid. */ +#define YY_USE_CONST + +#else /* ! __cplusplus */ + +#if __STDC__ + +#define YY_USE_PROTOS +#define YY_USE_CONST + +#endif /* __STDC__ */ +#endif /* ! __cplusplus */ + +#ifdef __TURBOC__ + #pragma warn -rch + #pragma warn -use +#include +#include +#define YY_USE_CONST +#define YY_USE_PROTOS +#endif + +#ifdef YY_USE_CONST +#define yyconst const +#else +#define yyconst +#endif + + +#ifdef YY_USE_PROTOS +#define YY_PROTO(proto) proto +#else +#define YY_PROTO(proto) () +#endif + + +/* Returned upon end-of-file. */ +#define YY_NULL 0 + +/* Promotes a possibly negative, possibly signed char to an unsigned + * integer for use as an array index. If the signed char is negative, + * we want to instead treat it as an 8-bit unsigned char, hence the + * double cast. + */ +#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) + +/* Enter a start condition. This macro really ought to take a parameter, + * but we do it the disgusting crufty way forced on us by the ()-less + * definition of BEGIN. + */ +#define BEGIN yy_start = 1 + 2 * + +/* Translate the current start state into a value that can be later handed + * to BEGIN to return to the state. The YYSTATE alias is for lex + * compatibility. + */ +#define YY_START ((yy_start - 1) / 2) +#define YYSTATE YY_START + +/* Action number for EOF rule of a given start state. */ +#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) + +/* Special action meaning "start processing a new file". */ +#define YY_NEW_FILE yyrestart( yyin ) + +#define YY_END_OF_BUFFER_CHAR 0 + +/* Size of default input buffer. */ +#define YY_BUF_SIZE 16384 + +typedef struct yy_buffer_state *YY_BUFFER_STATE; + +extern int yyleng; +extern FILE *yyin, *yyout; + +#define EOB_ACT_CONTINUE_SCAN 0 +#define EOB_ACT_END_OF_FILE 1 +#define EOB_ACT_LAST_MATCH 2 + +/* The funky do-while in the following #define is used to turn the definition + * int a single C statement (which needs a semi-colon terminator). This + * avoids problems with code like: + * + * if ( condition_holds ) + * yyless( 5 ); + * else + * do_something_else(); + * + * Prior to using the do-while the compiler would get upset at the + * "else" because it interpreted the "if" statement as being all + * done when it reached the ';' after the yyless() call. + */ + +/* Return all but the first 'n' matched characters back to the input stream. */ + +#define yyless(n) \ + do \ + { \ + /* Undo effects of setting up yytext. */ \ + *yy_cp = yy_hold_char; \ + YY_RESTORE_YY_MORE_OFFSET \ + yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \ + YY_DO_BEFORE_ACTION; /* set up yytext again */ \ + } \ + while ( 0 ) + +#define unput(c) yyunput( c, yytext_ptr ) + +/* The following is because we cannot portably get our hands on size_t + * (without autoconf's help, which isn't available because we want + * flex-generated scanners to compile on their own). + */ +typedef unsigned int yy_size_t; + + +struct yy_buffer_state + { + FILE *yy_input_file; + + char *yy_ch_buf; /* input buffer */ + char *yy_buf_pos; /* current position in input buffer */ + + /* Size of input buffer in bytes, not including room for EOB + * characters. + */ + yy_size_t yy_buf_size; + + /* Number of characters read into yy_ch_buf, not including EOB + * characters. + */ + int yy_n_chars; + + /* Whether we "own" the buffer - i.e., we know we created it, + * and can realloc() it to grow it, and should free() it to + * delete it. + */ + int yy_is_our_buffer; + + /* Whether this is an "interactive" input source; if so, and + * if we're using stdio for input, then we want to use getc() + * instead of fread(), to make sure we stop fetching input after + * each newline. + */ + int yy_is_interactive; + + /* Whether we're considered to be at the beginning of a line. + * If so, '^' rules will be active on the next match, otherwise + * not. + */ + int yy_at_bol; + + /* Whether to try to fill the input buffer when we reach the + * end of it. + */ + int yy_fill_buffer; + + int yy_buffer_status; +#define YY_BUFFER_NEW 0 +#define YY_BUFFER_NORMAL 1 + /* When an EOF's been seen but there's still some text to process + * then we mark the buffer as YY_EOF_PENDING, to indicate that we + * shouldn't try reading from the input source any more. We might + * still have a bunch of tokens to match, though, because of + * possible backing-up. + * + * When we actually see the EOF, we change the status to "new" + * (via yyrestart()), so that the user can continue scanning by + * just pointing yyin at a new input file. + */ +#define YY_BUFFER_EOF_PENDING 2 + }; + +static YY_BUFFER_STATE yy_current_buffer = 0; + +/* We provide macros for accessing buffer states in case in the + * future we want to put the buffer states in a more general + * "scanner state". + */ +#define YY_CURRENT_BUFFER yy_current_buffer + + +/* yy_hold_char holds the character lost when yytext is formed. */ +static char yy_hold_char; + +static int yy_n_chars; /* number of characters read into yy_ch_buf */ + + +int yyleng; + +/* Points to current character in buffer. */ +static char *yy_c_buf_p = (char *) 0; +static int yy_init = 1; /* whether we need to initialize */ +static int yy_start = 0; /* start state number */ + +/* Flag which is used to allow yywrap()'s to do buffer switches + * instead of setting up a fresh yyin. A bit of a hack ... + */ +static int yy_did_buffer_switch_on_eof; + +void yyrestart YY_PROTO(( FILE *input_file )); + +void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer )); +void yy_load_buffer_state YY_PROTO(( void )); +YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size )); +void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b )); +void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file )); +void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b )); +#define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer ) + +YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size )); +YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str )); +YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len )); + +static void *yy_flex_alloc YY_PROTO(( yy_size_t )); +static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t )); +static void yy_flex_free YY_PROTO(( void * )); + +#define yy_new_buffer yy_create_buffer + +#define yy_set_interactive(is_interactive) \ + { \ + if ( ! yy_current_buffer ) \ + yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ + yy_current_buffer->yy_is_interactive = is_interactive; \ + } + +#define yy_set_bol(at_bol) \ + { \ + if ( ! yy_current_buffer ) \ + yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ + yy_current_buffer->yy_at_bol = at_bol; \ + } + +#define YY_AT_BOL() (yy_current_buffer->yy_at_bol) + + +#define YY_USES_REJECT +typedef unsigned char YY_CHAR; +FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; +typedef int yy_state_type; +extern char *yytext; +#define yytext_ptr yytext + +static yy_state_type yy_get_previous_state YY_PROTO(( void )); +static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state )); +static int yy_get_next_buffer YY_PROTO(( void )); +static void yy_fatal_error YY_PROTO(( yyconst char msg[] )); + +/* Done after the current pattern has been matched and before the + * corresponding action - sets up yytext. + */ +#define YY_DO_BEFORE_ACTION \ + yytext_ptr = yy_bp; \ + yyleng = (int) (yy_cp - yy_bp); \ + yy_hold_char = *yy_cp; \ + *yy_cp = '\0'; \ + yy_c_buf_p = yy_cp; + +#define YY_NUM_RULES 15 +#define YY_END_OF_BUFFER 16 +static yyconst short int yy_acclist[55] = + { 0, + 5, 5, 16, 14, 15, 10, 14, 15, 1, 15, + 14, 15, 11, 14, 15, 14, 15, 9, 14, 15, + 8205, 15,16397, 15, 12, 15, 8205, 15,16397, 5, + 15, 7, 15, 6, 15, 10, 1, 9, 2, 11, + 4, 9, 8205,16397, 8205, 12, 8205,16397, 8205, 5, + 6, 6, 8, 3 + } ; + +static yyconst short int yy_accept[45] = + { 0, + 1, 1, 1, 1, 1, 2, 3, 4, 6, 9, + 11, 13, 16, 18, 21, 24, 25, 27, 30, 32, + 34, 36, 37, 38, 39, 39, 40, 41, 42, 42, + 43, 45, 46, 46, 47, 49, 50, 51, 52, 53, + 54, 54, 55, 55 + } ; + +static yyconst int yy_ec[256] = + { 0, + 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, + 4, 4, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 2, 1, 1, 5, 1, 1, 1, 1, 1, + 1, 6, 1, 1, 7, 7, 8, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 1, 1, 1, + 9, 1, 1, 1, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 1, 1, 1, 1, 7, 1, 7, 7, 7, 7, + + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1 + } ; + +static yyconst int yy_meta[10] = + { 0, + 1, 2, 3, 2, 1, 4, 1, 1, 1 + } ; + +static yyconst short int yy_base[52] = + { 0, + 0, 0, 8, 11, 13, 17, 67, 73, 22, 73, + 58, 38, 26, 0, 40, 33, 73, 37, 0, 73, + 32, 0, 73, 0, 30, 73, 23, 73, 26, 0, + 26, 25, 0, 73, 20, 19, 0, 35, 38, 73, + 15, 73, 73, 46, 50, 54, 15, 58, 62, 64, + 68 + } ; + +static yyconst short int yy_def[52] = + { 0, + 43, 1, 44, 44, 45, 45, 43, 43, 43, 43, + 46, 43, 43, 47, 48, 48, 43, 16, 49, 43, + 50, 9, 43, 47, 46, 43, 43, 43, 51, 47, + 48, 48, 16, 43, 16, 16, 49, 50, 50, 43, + 51, 43, 0, 43, 43, 43, 43, 43, 43, 43, + 43 + } ; + +static yyconst short int yy_nxt[83] = + { 0, + 8, 9, 10, 9, 11, 8, 12, 13, 14, 16, + 17, 18, 16, 17, 18, 20, 30, 42, 21, 20, + 36, 36, 21, 22, 23, 22, 32, 32, 42, 27, + 24, 28, 26, 29, 33, 34, 35, 39, 36, 40, + 43, 32, 43, 39, 27, 40, 15, 15, 15, 15, + 19, 19, 19, 19, 25, 25, 25, 25, 31, 31, + 26, 31, 37, 37, 38, 38, 43, 38, 41, 41, + 41, 41, 7, 43, 43, 43, 43, 43, 43, 43, + 43, 43 + } ; + +static yyconst short int yy_chk[83] = + { 0, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, + 3, 3, 4, 4, 4, 5, 47, 41, 5, 6, + 36, 35, 6, 9, 9, 9, 32, 31, 29, 27, + 9, 13, 25, 13, 16, 16, 16, 21, 18, 21, + 38, 15, 38, 39, 12, 39, 44, 44, 44, 44, + 45, 45, 45, 45, 46, 46, 46, 46, 48, 48, + 11, 48, 49, 49, 50, 50, 7, 50, 51, 51, + 51, 51, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43 + } ; + +static yy_state_type yy_state_buf[YY_BUF_SIZE + 2], *yy_state_ptr; +static char *yy_full_match; +static int yy_lp; +static int yy_looking_for_trail_begin = 0; +static int yy_full_lp; +static int *yy_full_state; +#define YY_TRAILING_MASK 0x2000 +#define YY_TRAILING_HEAD_MASK 0x4000 +#define REJECT \ +{ \ +*yy_cp = yy_hold_char; /* undo effects of setting up yytext */ \ +yy_cp = yy_full_match; /* restore poss. backed-over text */ \ +yy_lp = yy_full_lp; /* restore orig. accepting pos. */ \ +yy_state_ptr = yy_full_state; /* restore orig. state */ \ +yy_current_state = *yy_state_ptr; /* restore curr. state */ \ +++yy_lp; \ +goto find_rule; \ +} +#define yymore() yymore_used_but_not_detected +#define YY_MORE_ADJ 0 +#define YY_RESTORE_YY_MORE_OFFSET +char *yytext; +#line 1 "keyval_lex.l" +#define INITIAL 0 +#line 2 "keyval_lex.l" +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2006 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, + * University of Stuttgart. All rights reserved. + * Copyright (c) 2004-2005 The Regents of the University of California. + * All rights reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +#include "opal_config.h" + +#include +#if HAVE_UNISTD_H +#include +#endif + +#include "opal/util/keyval/keyval_lex.h" + +/* + * local functions + */ +static int finish_parsing(void); +#if defined(c_plusplus) || defined(__cplusplus) +extern "C" { +#endif +int opal_util_keyval_yywrap(void); +#if defined(c_plusplus) || defined(__cplusplus) +} +#endif + +/* + * global variables + */ +int opal_util_keyval_yynewlines = 1; +bool opal_util_keyval_parse_done = false; +char *opal_util_keyval_string = NULL; + +#define yyterminate() \ + return finish_parsing() + +#define VALUE 1 + +#define comment 2 + +#line 491 "keyval_lex.c" + +/* Macros after this point can all be overridden by user definitions in + * section 1. + */ + +#ifndef YY_SKIP_YYWRAP +#ifdef __cplusplus +extern "C" int yywrap YY_PROTO(( void )); +#else +extern int yywrap YY_PROTO(( void )); +#endif +#endif + +#ifndef YY_NO_UNPUT +static void yyunput YY_PROTO(( int c, char *buf_ptr )); +#endif + +#ifndef yytext_ptr +static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int )); +#endif + +#ifdef YY_NEED_STRLEN +static int yy_flex_strlen YY_PROTO(( yyconst char * )); +#endif + +#ifndef YY_NO_INPUT +#ifdef __cplusplus +static int yyinput YY_PROTO(( void )); +#else +static int input YY_PROTO(( void )); +#endif +#endif + +#if YY_STACK_USED +static int yy_start_stack_ptr = 0; +static int yy_start_stack_depth = 0; +static int *yy_start_stack = 0; +#ifndef YY_NO_PUSH_STATE +static void yy_push_state YY_PROTO(( int new_state )); +#endif +#ifndef YY_NO_POP_STATE +static void yy_pop_state YY_PROTO(( void )); +#endif +#ifndef YY_NO_TOP_STATE +static int yy_top_state YY_PROTO(( void )); +#endif + +#else +#define YY_NO_PUSH_STATE 1 +#define YY_NO_POP_STATE 1 +#define YY_NO_TOP_STATE 1 +#endif + +#ifdef YY_MALLOC_DECL +YY_MALLOC_DECL +#else +#if __STDC__ +#ifndef __cplusplus +#include +#endif +#else +/* Just try to get by without declaring the routines. This will fail + * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int) + * or sizeof(void*) != sizeof(int). + */ +#endif +#endif + +/* Amount of stuff to slurp up with each read. */ +#ifndef YY_READ_BUF_SIZE +#define YY_READ_BUF_SIZE 8192 +#endif + +/* Copy whatever the last rule matched to the standard output. */ + +#ifndef ECHO +/* This used to be an fputs(), but since the string might contain NUL's, + * we now use fwrite(). + */ +#define ECHO (void) fwrite( yytext, yyleng, 1, yyout ) +#endif + +/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, + * is returned in "result". + */ +#ifndef YY_INPUT +#define YY_INPUT(buf,result,max_size) \ + if ( yy_current_buffer->yy_is_interactive ) \ + { \ + int c = '*', n; \ + for ( n = 0; n < max_size && \ + (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ + buf[n] = (char) c; \ + if ( c == '\n' ) \ + buf[n++] = (char) c; \ + if ( c == EOF && ferror( yyin ) ) \ + YY_FATAL_ERROR( "input in flex scanner failed" ); \ + result = n; \ + } \ + else \ + { \ + errno=0; \ + while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \ + { \ + if( errno != EINTR) \ + { \ + YY_FATAL_ERROR( "input in flex scanner failed" ); \ + break; \ + } \ + errno=0; \ + clearerr(yyin); \ + } \ + } +#endif + +/* No semi-colon after return; correct usage is to write "yyterminate();" - + * we don't want an extra ';' after the "return" because that will cause + * some compilers to complain about unreachable statements. + */ +#ifndef yyterminate +#define yyterminate() return YY_NULL +#endif + +/* Number of entries by which start-condition stack grows. */ +#ifndef YY_START_STACK_INCR +#define YY_START_STACK_INCR 25 +#endif + +/* Report a fatal error. */ +#ifndef YY_FATAL_ERROR +#define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) +#endif + +/* Default declaration of generated scanner - a define so the user can + * easily add parameters. + */ +#ifndef YY_DECL +#define YY_DECL int yylex YY_PROTO(( void )) +#endif + +/* Code executed at the beginning of each rule, after yytext and yyleng + * have been set up. + */ +#ifndef YY_USER_ACTION +#define YY_USER_ACTION +#endif + +/* Code executed at the end of each rule. */ +#ifndef YY_BREAK +#define YY_BREAK break; +#endif + +#define YY_RULE_SETUP \ + YY_USER_ACTION + +YY_DECL + { + register yy_state_type yy_current_state; + register char *yy_cp, *yy_bp; + register int yy_act; + +#line 59 "keyval_lex.l" + + +#line 656 "keyval_lex.c" + + if ( yy_init ) + { + yy_init = 0; + +#ifdef YY_USER_INIT + YY_USER_INIT; +#endif + + if ( ! yy_start ) + yy_start = 1; /* first start state */ + + if ( ! yyin ) + yyin = stdin; + + if ( ! yyout ) + yyout = stdout; + + if ( ! yy_current_buffer ) + yy_current_buffer = + yy_create_buffer( yyin, YY_BUF_SIZE ); + + yy_load_buffer_state(); + } + + while ( 1 ) /* loops until end-of-file is reached */ + { + yy_cp = yy_c_buf_p; + + /* Support of yytext. */ + *yy_cp = yy_hold_char; + + /* yy_bp points to the position in yy_ch_buf of the start of + * the current run. + */ + yy_bp = yy_cp; + + yy_current_state = yy_start; + yy_state_ptr = yy_state_buf; + *yy_state_ptr++ = yy_current_state; +yy_match: + do + { + register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 44 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + *yy_state_ptr++ = yy_current_state; + ++yy_cp; + } + while ( yy_base[yy_current_state] != 73 ); + +yy_find_action: + yy_current_state = *--yy_state_ptr; + yy_lp = yy_accept[yy_current_state]; +find_rule: /* we branch to this label when backing up */ + for ( ; ; ) /* until we find what rule we matched */ + { + if ( yy_lp && yy_lp < yy_accept[yy_current_state + 1] ) + { + yy_act = yy_acclist[yy_lp]; + if ( yy_act & YY_TRAILING_HEAD_MASK || + yy_looking_for_trail_begin ) + { + if ( yy_act == yy_looking_for_trail_begin ) + { + yy_looking_for_trail_begin = 0; + yy_act &= ~YY_TRAILING_HEAD_MASK; + break; + } + } + else if ( yy_act & YY_TRAILING_MASK ) + { + yy_looking_for_trail_begin = yy_act & ~YY_TRAILING_MASK; + yy_looking_for_trail_begin |= YY_TRAILING_HEAD_MASK; + } + else + { + yy_full_match = yy_cp; + yy_full_state = yy_state_ptr; + yy_full_lp = yy_lp; + break; + } + ++yy_lp; + goto find_rule; + } + --yy_cp; + yy_current_state = *--yy_state_ptr; + yy_lp = yy_accept[yy_current_state]; + } + + YY_DO_BEFORE_ACTION; + + +do_action: /* This label is used only to access EOF actions. */ + + + switch ( yy_act ) + { /* beginning of action switch */ +case 1: +YY_RULE_SETUP +#line 61 "keyval_lex.l" +{ opal_util_keyval_yynewlines++; return OPAL_UTIL_KEYVAL_PARSE_NEWLINE; } + YY_BREAK +case 2: +YY_RULE_SETUP +#line 62 "keyval_lex.l" +{ opal_util_keyval_yynewlines++; return OPAL_UTIL_KEYVAL_PARSE_NEWLINE; } + YY_BREAK +case 3: +YY_RULE_SETUP +#line 63 "keyval_lex.l" +{ opal_util_keyval_yynewlines++; return OPAL_UTIL_KEYVAL_PARSE_NEWLINE; } + YY_BREAK +case 4: +YY_RULE_SETUP +#line 65 "keyval_lex.l" +{ BEGIN(comment); + return OPAL_UTIL_KEYVAL_PARSE_NEWLINE; } + YY_BREAK +case 5: +YY_RULE_SETUP +#line 67 "keyval_lex.l" +; /* Eat up non '*'s */ + YY_BREAK +case 6: +YY_RULE_SETUP +#line 68 "keyval_lex.l" +; /* Eat '*'s not followed by a '/' */ + YY_BREAK +case 7: +YY_RULE_SETUP +#line 69 "keyval_lex.l" +{ opal_util_keyval_yynewlines++; + return OPAL_UTIL_KEYVAL_PARSE_NEWLINE; } + YY_BREAK +case 8: +YY_RULE_SETUP +#line 71 "keyval_lex.l" +{ BEGIN(INITIAL); /* Done with Block Comment */ + return OPAL_UTIL_KEYVAL_PARSE_NEWLINE; } + YY_BREAK +case 9: +YY_RULE_SETUP +#line 74 "keyval_lex.l" +{ BEGIN(VALUE); return OPAL_UTIL_KEYVAL_PARSE_EQUAL; } + YY_BREAK +case 10: +YY_RULE_SETUP +#line 75 "keyval_lex.l" +; /* whitespace */ + YY_BREAK +case 11: +YY_RULE_SETUP +#line 76 "keyval_lex.l" +{ return OPAL_UTIL_KEYVAL_PARSE_SINGLE_WORD; } + YY_BREAK +case 12: +YY_RULE_SETUP +#line 78 "keyval_lex.l" +{ BEGIN(INITIAL); return OPAL_UTIL_KEYVAL_PARSE_NEWLINE; } + YY_BREAK +case 13: +YY_RULE_SETUP +#line 79 "keyval_lex.l" +{ return OPAL_UTIL_KEYVAL_PARSE_VALUE; } + YY_BREAK +case 14: +YY_RULE_SETUP +#line 81 "keyval_lex.l" +{ return OPAL_UTIL_KEYVAL_PARSE_ERROR; } + YY_BREAK +case 15: +YY_RULE_SETUP +#line 83 "keyval_lex.l" +ECHO; + YY_BREAK +#line 838 "keyval_lex.c" + case YY_STATE_EOF(INITIAL): + case YY_STATE_EOF(VALUE): + case YY_STATE_EOF(comment): + yyterminate(); + + case YY_END_OF_BUFFER: + { + /* Amount of text matched not including the EOB char. */ + int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1; + + /* Undo the effects of YY_DO_BEFORE_ACTION. */ + *yy_cp = yy_hold_char; + YY_RESTORE_YY_MORE_OFFSET + + if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW ) + { + /* We're scanning a new file or input source. It's + * possible that this happened because the user + * just pointed yyin at a new source and called + * yylex(). If so, then we have to assure + * consistency between yy_current_buffer and our + * globals. Here is the right place to do so, because + * this is the first action (other than possibly a + * back-up) that will match for the new input source. + */ + yy_n_chars = yy_current_buffer->yy_n_chars; + yy_current_buffer->yy_input_file = yyin; + yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL; + } + + /* Note that here we test for yy_c_buf_p "<=" to the position + * of the first EOB in the buffer, since yy_c_buf_p will + * already have been incremented past the NUL character + * (since all states make transitions on EOB to the + * end-of-buffer state). Contrast this with the test + * in input(). + */ + if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] ) + { /* This was really a NUL. */ + yy_state_type yy_next_state; + + yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text; + + yy_current_state = yy_get_previous_state(); + + /* Okay, we're now positioned to make the NUL + * transition. We couldn't have + * yy_get_previous_state() go ahead and do it + * for us because it doesn't know how to deal + * with the possibility of jamming (and we don't + * want to build jamming into it because then it + * will run more slowly). + */ + + yy_next_state = yy_try_NUL_trans( yy_current_state ); + + yy_bp = yytext_ptr + YY_MORE_ADJ; + + if ( yy_next_state ) + { + /* Consume the NUL. */ + yy_cp = ++yy_c_buf_p; + yy_current_state = yy_next_state; + goto yy_match; + } + + else + { + yy_cp = yy_c_buf_p; + goto yy_find_action; + } + } + + else switch ( yy_get_next_buffer() ) + { + case EOB_ACT_END_OF_FILE: + { + yy_did_buffer_switch_on_eof = 0; + + if ( yywrap() ) + { + /* Note: because we've taken care in + * yy_get_next_buffer() to have set up + * yytext, we can now set up + * yy_c_buf_p so that if some total + * hoser (like flex itself) wants to + * call the scanner after we return the + * YY_NULL, it'll still work - another + * YY_NULL will get returned. + */ + yy_c_buf_p = yytext_ptr + YY_MORE_ADJ; + + yy_act = YY_STATE_EOF(YY_START); + goto do_action; + } + + else + { + if ( ! yy_did_buffer_switch_on_eof ) + YY_NEW_FILE; + } + break; + } + + case EOB_ACT_CONTINUE_SCAN: + yy_c_buf_p = + yytext_ptr + yy_amount_of_matched_text; + + yy_current_state = yy_get_previous_state(); + + yy_cp = yy_c_buf_p; + yy_bp = yytext_ptr + YY_MORE_ADJ; + goto yy_match; + + case EOB_ACT_LAST_MATCH: + yy_c_buf_p = + &yy_current_buffer->yy_ch_buf[yy_n_chars]; + + yy_current_state = yy_get_previous_state(); + + yy_cp = yy_c_buf_p; + yy_bp = yytext_ptr + YY_MORE_ADJ; + goto yy_find_action; + } + break; + } + + default: + YY_FATAL_ERROR( + "fatal flex scanner internal error--no action found" ); + } /* end of action switch */ + } /* end of scanning one token */ + } /* end of yylex */ + + +/* yy_get_next_buffer - try to read in a new buffer + * + * Returns a code representing an action: + * EOB_ACT_LAST_MATCH - + * EOB_ACT_CONTINUE_SCAN - continue scanning from current position + * EOB_ACT_END_OF_FILE - end of file + */ + +static int yy_get_next_buffer() + { + register char *dest = yy_current_buffer->yy_ch_buf; + register char *source = yytext_ptr; + register int number_to_move, i; + int ret_val; + + if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] ) + YY_FATAL_ERROR( + "fatal flex scanner internal error--end of buffer missed" ); + + if ( yy_current_buffer->yy_fill_buffer == 0 ) + { /* Don't try to fill the buffer, so this is an EOF. */ + if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 ) + { + /* We matched a single character, the EOB, so + * treat this as a final EOF. + */ + return EOB_ACT_END_OF_FILE; + } + + else + { + /* We matched some text prior to the EOB, first + * process it. + */ + return EOB_ACT_LAST_MATCH; + } + } + + /* Try to read more data. */ + + /* First move last chars to start of buffer. */ + number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1; + + for ( i = 0; i < number_to_move; ++i ) + *(dest++) = *(source++); + + if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING ) + /* don't do the read, it's not guaranteed to return an EOF, + * just force an EOF + */ + yy_current_buffer->yy_n_chars = yy_n_chars = 0; + + else + { + int num_to_read = + yy_current_buffer->yy_buf_size - number_to_move - 1; + + while ( num_to_read <= 0 ) + { /* Not enough room in the buffer - grow it. */ +#ifdef YY_USES_REJECT + YY_FATAL_ERROR( +"input buffer overflow, can't enlarge buffer because scanner uses REJECT" ); +#else + + /* just a shorter name for the current buffer */ + YY_BUFFER_STATE b = yy_current_buffer; + + int yy_c_buf_p_offset = + (int) (yy_c_buf_p - b->yy_ch_buf); + + if ( b->yy_is_our_buffer ) + { + int new_size = b->yy_buf_size * 2; + + if ( new_size <= 0 ) + b->yy_buf_size += b->yy_buf_size / 8; + else + b->yy_buf_size *= 2; + + b->yy_ch_buf = (char *) + /* Include room in for 2 EOB chars. */ + yy_flex_realloc( (void *) b->yy_ch_buf, + b->yy_buf_size + 2 ); + } + else + /* Can't grow it, we don't own it. */ + b->yy_ch_buf = 0; + + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( + "fatal error - scanner input buffer overflow" ); + + yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; + + num_to_read = yy_current_buffer->yy_buf_size - + number_to_move - 1; +#endif + } + + if ( num_to_read > YY_READ_BUF_SIZE ) + num_to_read = YY_READ_BUF_SIZE; + + /* Read in more data. */ + YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]), + yy_n_chars, num_to_read ); + + yy_current_buffer->yy_n_chars = yy_n_chars; + } + + if ( yy_n_chars == 0 ) + { + if ( number_to_move == YY_MORE_ADJ ) + { + ret_val = EOB_ACT_END_OF_FILE; + yyrestart( yyin ); + } + + else + { + ret_val = EOB_ACT_LAST_MATCH; + yy_current_buffer->yy_buffer_status = + YY_BUFFER_EOF_PENDING; + } + } + + else + ret_val = EOB_ACT_CONTINUE_SCAN; + + yy_n_chars += number_to_move; + yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR; + yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; + + yytext_ptr = &yy_current_buffer->yy_ch_buf[0]; + + return ret_val; + } + + +/* yy_get_previous_state - get the state just before the EOB char was reached */ + +static yy_state_type yy_get_previous_state() + { + register yy_state_type yy_current_state; + register char *yy_cp; + + yy_current_state = yy_start; + yy_state_ptr = yy_state_buf; + *yy_state_ptr++ = yy_current_state; + + for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp ) + { + register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 44 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + *yy_state_ptr++ = yy_current_state; + } + + return yy_current_state; + } + + +/* yy_try_NUL_trans - try to make a transition on the NUL character + * + * synopsis + * next_state = yy_try_NUL_trans( current_state ); + */ + +#ifdef YY_USE_PROTOS +static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state ) +#else +static yy_state_type yy_try_NUL_trans( yy_current_state ) +yy_state_type yy_current_state; +#endif + { + register int yy_is_jam; + + register YY_CHAR yy_c = 1; + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 44 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + yy_is_jam = (yy_current_state == 43); + if ( ! yy_is_jam ) + *yy_state_ptr++ = yy_current_state; + + return yy_is_jam ? 0 : yy_current_state; + } + + +#ifndef YY_NO_UNPUT +#ifdef YY_USE_PROTOS +static void yyunput( int c, register char *yy_bp ) +#else +static void yyunput( c, yy_bp ) +int c; +register char *yy_bp; +#endif + { + register char *yy_cp = yy_c_buf_p; + + /* undo effects of setting up yytext */ + *yy_cp = yy_hold_char; + + if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) + { /* need to shift things up to make room */ + /* +2 for EOB chars. */ + register int number_to_move = yy_n_chars + 2; + register char *dest = &yy_current_buffer->yy_ch_buf[ + yy_current_buffer->yy_buf_size + 2]; + register char *source = + &yy_current_buffer->yy_ch_buf[number_to_move]; + + while ( source > yy_current_buffer->yy_ch_buf ) + *--dest = *--source; + + yy_cp += (int) (dest - source); + yy_bp += (int) (dest - source); + yy_current_buffer->yy_n_chars = + yy_n_chars = yy_current_buffer->yy_buf_size; + + if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) + YY_FATAL_ERROR( "flex scanner push-back overflow" ); + } + + *--yy_cp = (char) c; + + + yytext_ptr = yy_bp; + yy_hold_char = *yy_cp; + yy_c_buf_p = yy_cp; + } +#endif /* ifndef YY_NO_UNPUT */ + + +#ifdef __cplusplus +static int yyinput() +#else +static int input() +#endif + { + int c; + + *yy_c_buf_p = yy_hold_char; + + if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR ) + { + /* yy_c_buf_p now points to the character we want to return. + * If this occurs *before* the EOB characters, then it's a + * valid NUL; if not, then we've hit the end of the buffer. + */ + if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] ) + /* This was really a NUL. */ + *yy_c_buf_p = '\0'; + + else + { /* need more input */ + int offset = yy_c_buf_p - yytext_ptr; + ++yy_c_buf_p; + + switch ( yy_get_next_buffer() ) + { + case EOB_ACT_LAST_MATCH: + /* This happens because yy_g_n_b() + * sees that we've accumulated a + * token and flags that we need to + * try matching the token before + * proceeding. But for input(), + * there's no matching to consider. + * So convert the EOB_ACT_LAST_MATCH + * to EOB_ACT_END_OF_FILE. + */ + + /* Reset buffer status. */ + yyrestart( yyin ); + + /* fall through */ + + case EOB_ACT_END_OF_FILE: + { + if ( yywrap() ) + return EOF; + + if ( ! yy_did_buffer_switch_on_eof ) + YY_NEW_FILE; +#ifdef __cplusplus + return yyinput(); +#else + return input(); +#endif + } + + case EOB_ACT_CONTINUE_SCAN: + yy_c_buf_p = yytext_ptr + offset; + break; + } + } + } + + c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */ + *yy_c_buf_p = '\0'; /* preserve yytext */ + yy_hold_char = *++yy_c_buf_p; + + + return c; + } + + +#ifdef YY_USE_PROTOS +void yyrestart( FILE *input_file ) +#else +void yyrestart( input_file ) +FILE *input_file; +#endif + { + if ( ! yy_current_buffer ) + yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); + + yy_init_buffer( yy_current_buffer, input_file ); + yy_load_buffer_state(); + } + + +#ifdef YY_USE_PROTOS +void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer ) +#else +void yy_switch_to_buffer( new_buffer ) +YY_BUFFER_STATE new_buffer; +#endif + { + if ( yy_current_buffer == new_buffer ) + return; + + if ( yy_current_buffer ) + { + /* Flush out information for old buffer. */ + *yy_c_buf_p = yy_hold_char; + yy_current_buffer->yy_buf_pos = yy_c_buf_p; + yy_current_buffer->yy_n_chars = yy_n_chars; + } + + yy_current_buffer = new_buffer; + yy_load_buffer_state(); + + /* We don't actually know whether we did this switch during + * EOF (yywrap()) processing, but the only time this flag + * is looked at is after yywrap() is called, so it's safe + * to go ahead and always set it. + */ + yy_did_buffer_switch_on_eof = 1; + } + + +#ifdef YY_USE_PROTOS +void yy_load_buffer_state( void ) +#else +void yy_load_buffer_state() +#endif + { + yy_n_chars = yy_current_buffer->yy_n_chars; + yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos; + yyin = yy_current_buffer->yy_input_file; + yy_hold_char = *yy_c_buf_p; + } + + +#ifdef YY_USE_PROTOS +YY_BUFFER_STATE yy_create_buffer( FILE *file, int size ) +#else +YY_BUFFER_STATE yy_create_buffer( file, size ) +FILE *file; +int size; +#endif + { + YY_BUFFER_STATE b; + + b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); + + b->yy_buf_size = size; + + /* yy_ch_buf has to be 2 characters longer than the size given because + * we need to put in 2 end-of-buffer characters. + */ + b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 ); + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); + + b->yy_is_our_buffer = 1; + + yy_init_buffer( b, file ); + + return b; + } + + +#ifdef YY_USE_PROTOS +void yy_delete_buffer( YY_BUFFER_STATE b ) +#else +void yy_delete_buffer( b ) +YY_BUFFER_STATE b; +#endif + { + if ( ! b ) + return; + + if ( b == yy_current_buffer ) + yy_current_buffer = (YY_BUFFER_STATE) 0; + + if ( b->yy_is_our_buffer ) + yy_flex_free( (void *) b->yy_ch_buf ); + + yy_flex_free( (void *) b ); + } + + +#ifndef _WIN32 +#include +#else +#ifndef YY_ALWAYS_INTERACTIVE +#ifndef YY_NEVER_INTERACTIVE +extern int isatty YY_PROTO(( int )); +#endif +#endif +#endif + +#ifdef YY_USE_PROTOS +void yy_init_buffer( YY_BUFFER_STATE b, FILE *file ) +#else +void yy_init_buffer( b, file ) +YY_BUFFER_STATE b; +FILE *file; +#endif + + + { + yy_flush_buffer( b ); + + b->yy_input_file = file; + b->yy_fill_buffer = 1; + +#if YY_ALWAYS_INTERACTIVE + b->yy_is_interactive = 1; +#else +#if YY_NEVER_INTERACTIVE + b->yy_is_interactive = 0; +#else + b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; +#endif +#endif + } + + +#ifdef YY_USE_PROTOS +void yy_flush_buffer( YY_BUFFER_STATE b ) +#else +void yy_flush_buffer( b ) +YY_BUFFER_STATE b; +#endif + + { + if ( ! b ) + return; + + b->yy_n_chars = 0; + + /* We always need two end-of-buffer characters. The first causes + * a transition to the end-of-buffer state. The second causes + * a jam in that state. + */ + b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; + b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; + + b->yy_buf_pos = &b->yy_ch_buf[0]; + + b->yy_at_bol = 1; + b->yy_buffer_status = YY_BUFFER_NEW; + + if ( b == yy_current_buffer ) + yy_load_buffer_state(); + } + + +#ifndef YY_NO_SCAN_BUFFER +#ifdef YY_USE_PROTOS +YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size ) +#else +YY_BUFFER_STATE yy_scan_buffer( base, size ) +char *base; +yy_size_t size; +#endif + { + YY_BUFFER_STATE b; + + if ( size < 2 || + base[size-2] != YY_END_OF_BUFFER_CHAR || + base[size-1] != YY_END_OF_BUFFER_CHAR ) + /* They forgot to leave room for the EOB's. */ + return 0; + + b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); + + b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ + b->yy_buf_pos = b->yy_ch_buf = base; + b->yy_is_our_buffer = 0; + b->yy_input_file = 0; + b->yy_n_chars = b->yy_buf_size; + b->yy_is_interactive = 0; + b->yy_at_bol = 1; + b->yy_fill_buffer = 0; + b->yy_buffer_status = YY_BUFFER_NEW; + + yy_switch_to_buffer( b ); + + return b; + } +#endif + + +#ifndef YY_NO_SCAN_STRING +#ifdef YY_USE_PROTOS +YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str ) +#else +YY_BUFFER_STATE yy_scan_string( yy_str ) +yyconst char *yy_str; +#endif + { + int len; + for ( len = 0; yy_str[len]; ++len ) + ; + + return yy_scan_bytes( yy_str, len ); + } +#endif + + +#ifndef YY_NO_SCAN_BYTES +#ifdef YY_USE_PROTOS +YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len ) +#else +YY_BUFFER_STATE yy_scan_bytes( bytes, len ) +yyconst char *bytes; +int len; +#endif + { + YY_BUFFER_STATE b; + char *buf; + yy_size_t n; + int i; + + /* Get memory for full buffer, including space for trailing EOB's. */ + n = len + 2; + buf = (char *) yy_flex_alloc( n ); + if ( ! buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); + + for ( i = 0; i < len; ++i ) + buf[i] = bytes[i]; + + buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR; + + b = yy_scan_buffer( buf, n ); + if ( ! b ) + YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); + + /* It's okay to grow etc. this buffer, and we should throw it + * away when we're done. + */ + b->yy_is_our_buffer = 1; + + return b; + } +#endif + + +#ifndef YY_NO_PUSH_STATE +#ifdef YY_USE_PROTOS +static void yy_push_state( int new_state ) +#else +static void yy_push_state( new_state ) +int new_state; +#endif + { + if ( yy_start_stack_ptr >= yy_start_stack_depth ) + { + yy_size_t new_size; + + yy_start_stack_depth += YY_START_STACK_INCR; + new_size = yy_start_stack_depth * sizeof( int ); + + if ( ! yy_start_stack ) + yy_start_stack = (int *) yy_flex_alloc( new_size ); + + else + yy_start_stack = (int *) yy_flex_realloc( + (void *) yy_start_stack, new_size ); + + if ( ! yy_start_stack ) + YY_FATAL_ERROR( + "out of memory expanding start-condition stack" ); + } + + yy_start_stack[yy_start_stack_ptr++] = YY_START; + + BEGIN(new_state); + } +#endif + + +#ifndef YY_NO_POP_STATE +static void yy_pop_state() + { + if ( --yy_start_stack_ptr < 0 ) + YY_FATAL_ERROR( "start-condition stack underflow" ); + + BEGIN(yy_start_stack[yy_start_stack_ptr]); + } +#endif + + +#ifndef YY_NO_TOP_STATE +static int yy_top_state() + { + return yy_start_stack[yy_start_stack_ptr - 1]; + } +#endif + +#ifndef YY_EXIT_FAILURE +#define YY_EXIT_FAILURE 2 +#endif + +#ifdef YY_USE_PROTOS +static void yy_fatal_error( yyconst char msg[] ) +#else +static void yy_fatal_error( msg ) +char msg[]; +#endif + { + (void) fprintf( stderr, "%s\n", msg ); + exit( YY_EXIT_FAILURE ); + } + + + +/* Redefine yyless() so it works in section 3 code. */ + +#undef yyless +#define yyless(n) \ + do \ + { \ + /* Undo effects of setting up yytext. */ \ + yytext[yyleng] = yy_hold_char; \ + yy_c_buf_p = yytext + n; \ + yy_hold_char = *yy_c_buf_p; \ + *yy_c_buf_p = '\0'; \ + yyleng = n; \ + } \ + while ( 0 ) + + +/* Internal utility routines. */ + +#ifndef yytext_ptr +#ifdef YY_USE_PROTOS +static void yy_flex_strncpy( char *s1, yyconst char *s2, int n ) +#else +static void yy_flex_strncpy( s1, s2, n ) +char *s1; +yyconst char *s2; +int n; +#endif + { + register int i; + for ( i = 0; i < n; ++i ) + s1[i] = s2[i]; + } +#endif + +#ifdef YY_NEED_STRLEN +#ifdef YY_USE_PROTOS +static int yy_flex_strlen( yyconst char *s ) +#else +static int yy_flex_strlen( s ) +yyconst char *s; +#endif + { + register int n; + for ( n = 0; s[n]; ++n ) + ; + + return n; + } +#endif + + +#ifdef YY_USE_PROTOS +static void *yy_flex_alloc( yy_size_t size ) +#else +static void *yy_flex_alloc( size ) +yy_size_t size; +#endif + { + return (void *) malloc( size ); + } + +#ifdef YY_USE_PROTOS +static void *yy_flex_realloc( void *ptr, yy_size_t size ) +#else +static void *yy_flex_realloc( ptr, size ) +void *ptr; +yy_size_t size; +#endif + { + /* The cast to (char *) in the following accommodates both + * implementations that use char* generic pointers, and those + * that use void* generic pointers. It works with the latter + * because both ANSI C and C++ allow castless assignment from + * any pointer type to void*, and deal with argument conversions + * as though doing an assignment. + */ + return (void *) realloc( (char *) ptr, size ); + } + +#ifdef YY_USE_PROTOS +static void yy_flex_free( void *ptr ) +#else +static void yy_flex_free( ptr ) +void *ptr; +#endif + { + free( ptr ); + } + +#if YY_MAIN +int main() + { + yylex(); + return 0; + } +#endif +#line 83 "keyval_lex.l" + + + +/* + * This cleans up at the end of the parse (since, in this case, we + * always parse the entire file) and prevents a memory leak. + */ +static int finish_parsing(void) +{ + if (NULL != YY_CURRENT_BUFFER) { + yy_delete_buffer(YY_CURRENT_BUFFER); +#if defined(YY_CURRENT_BUFFER_LVALUE) + YY_CURRENT_BUFFER_LVALUE = NULL; +#else + YY_CURRENT_BUFFER = NULL; +#endif /* YY_CURRENT_BUFFER_LVALUE */ + } + return YY_NULL; +} + +int opal_util_keyval_yywrap(void) +{ + opal_util_keyval_parse_done = true; + return 1; +} + +/* + * Ensure that we have a valid yybuffer to use. Specifically, if this + * scanner is invoked a second time, finish_parsing() (above) will + * have been executed, and the current buffer will have been freed. + * Flex doesn't recognize this fact because as far as it's concerned, + * its internal state was already initialized, so it thinks it should + * have a valid buffer. Hence, here we ensure to give it a valid + * buffer. + */ +int opal_util_keyval_init_buffer(FILE *file) +{ + YY_BUFFER_STATE buf = yy_create_buffer(file, YY_BUF_SIZE); + yy_switch_to_buffer(buf); + + return 0; +} diff --git a/contrib/platform/win32/mpi.h b/contrib/platform/win32/mpi.h new file mode 100644 index 0000000000..59ad8c0058 --- /dev/null +++ b/contrib/platform/win32/mpi.h @@ -0,0 +1,1794 @@ +/* ompi/include/mpi.h. Generated from mpi.h.in by configure. */ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2006 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, + * University of Stuttgart. All rights reserved. + * Copyright (c) 2004-2005 The Regents of the University of California. + * All rights reserved. + * Copyright (c) 2007 Cisco Systems, Inc. All rights reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +#ifndef OMPI_MPI_H +#define OMPI_MPI_H + +/* The comment below (and the ending partner) are for building fat + distributions on platforms that support it. Please do not remove */ + +/* @OMPI_BEGIN_CONFIGURE_SECTION@ */ + +#ifndef OMPI_CONFIG_H + +/* Only include these if OMPI_CONFIG_H isn't defined (meaning if + ompi_config.h hasn't already been included). Otherwise, we'll + duplicate all those symbols. OMPI coding standards say that + ompi_config.h must be included before all other files, so this + should be good enough */ + +/* Whether we have FORTRAN INTEGER*1 or not */ +#define OMPI_HAVE_FORTRAN_INTEGER1 1 + +/* Whether we have FORTRAN INTEGER*16 or not */ +#define OMPI_HAVE_FORTRAN_INTEGER16 0 + +/* Whether we have FORTRAN INTEGER*2 or not */ +#define OMPI_HAVE_FORTRAN_INTEGER2 1 + +/* Whether we have FORTRAN INTEGER*4 or not */ +#define OMPI_HAVE_FORTRAN_INTEGER4 1 + +/* Whether we have FORTRAN INTEGER*8 or not */ +#define OMPI_HAVE_FORTRAN_INTEGER8 1 + +/* Whether we have FORTRAN REAL*16 or not */ +#define OMPI_HAVE_FORTRAN_REAL16 0 + +/* Whether we have FORTRAN REAL*4 or not */ +#define OMPI_HAVE_FORTRAN_REAL4 1 + +/* Whether we have FORTRAN REAL*8 or not */ +#define OMPI_HAVE_FORTRAN_REAL8 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TIME_H 1 + +/* Define to 1 if the system has the type `long long'. */ +#define HAVE_LONG_LONG 1 + +/* The size of a `bool', as computed by sizeof. */ +#define SIZEOF_BOOL 1 + +/* The size of a `int', as computed by sizeof. */ +#define SIZEOF_INT 4 + +/* Type of MPI_Offset -- has to be defined here and typedef'ed later because mpi.h does not get AC SUBST's */ +#define OMPI_MPI_OFFSET_TYPE long long + +/* type to use for ptrdiff_t, if it does not exist, set to ptrdiff_t if it does exist */ +#define OMPI_PTRDIFF_TYPE ptrdiff_t + +/* Whether we want MPI cxx support or not */ +#define OMPI_WANT_CXX_BINDINGS 1 + +/* do we want to try to work around C++ bindings SEEK_* issue? */ +#define OMPI_WANT_MPI_CXX_SEEK 1 + +/* Whether a const_cast on a 2-d array will work with the C++ compiler */ +#define OMPI_CXX_SUPPORTS_2D_CONST_CAST 1 + +/* Whether we want the MPI f77 bindings or not */ +#define OMPI_WANT_F77_BINDINGS 1 + +/* Whether we want the MPI f90 bindings or not */ +#define OMPI_WANT_F90_BINDINGS 0 + +/* Whether or not we have compiled with C++ exceptions support */ +#define OMPI_HAVE_CXX_EXCEPTION_SUPPORT 0 + +/* MPI datatype corresponding to MPI_Offset */ +#define OMPI_OFFSET_DATATYPE MPI_LONG_LONG + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Major, minor, and release version of Open MPI */ +#define OMPI_MAJOR_VERSION 1 +#define OMPI_MINOR_VERSION 3 +#define OMPI_RELEASE_VERSION 0 + +/* A type that allows us to have sentinel type values that are still + valid */ +#define ompi_fortran_bogus_type_t int + +/* C type corresponding to FORTRAN INTEGER */ +#define ompi_fortran_integer_t int + +/* Whether C compiler supports -fvisibility */ +#define OMPI_C_HAVE_VISIBILITY 0 + +#ifndef OMPI_DECLSPEC +# if (defined(WIN32) || defined(_WIN32)) && !defined(STATIC_IMPORT) +# define OMPI_DECLSPEC __declspec(dllimport) +# else +# if OMPI_C_HAVE_VISIBILITY == 1 +# define OMPI_DECLSPEC __attribute__((visibility("default"))) +# else +# define OMPI_DECLSPEC +# endif +# endif +#endif + +#ifndef MPI_Fint +/* MPI_Fint is the same as ompi_fortran_INTEGER_t */ +#define MPI_Fint ompi_fortran_integer_t +#endif + +#endif /* #ifndef OMPI_CONFIG_H */ + +/* @OMPI_END_CONFIGURE_SECTION@ */ + +/* include for ptrdiff_t */ +#ifdef STDC_HEADERS +#include +#endif + +#ifndef OMPI_BUILDING +#define OMPI_BUILDING 0 +#endif + + +/* + * Just in case you need it. :-) + */ +#define OPEN_MPI 1 + +/* + * MPI version + */ +#define MPI_VERSION 2 +#define MPI_SUBVERSION 0 + +/* + * To accomodate programs written for MPI implementations that use a + * straight ROMIO import + */ +#if !OMPI_BUILDING +#define MPIO_Request MPI_Request +#define MPIO_Test MPI_Test +#define MPIO_Wait MPI_Wait +#endif + +#if defined(c_plusplus) || defined(__cplusplus) +extern "C" { +#endif +/* + * Typedefs + */ + +typedef OMPI_PTRDIFF_TYPE MPI_Aint; +typedef OMPI_MPI_OFFSET_TYPE MPI_Offset; +typedef struct ompi_communicator_t *MPI_Comm; +typedef struct ompi_datatype_t *MPI_Datatype; +typedef struct ompi_errhandler_t *MPI_Errhandler; +typedef struct ompi_file_t *MPI_File; +typedef struct ompi_group_t *MPI_Group; +typedef struct ompi_info_t *MPI_Info; +typedef struct ompi_op_t *MPI_Op; +typedef struct ompi_request_t *MPI_Request; +typedef struct ompi_status_public_t MPI_Status; +typedef struct ompi_win_t *MPI_Win; + +/* + * MPI_Status + */ +struct ompi_status_public_t { + int MPI_SOURCE; + int MPI_TAG; + int MPI_ERROR; + int _count; + int _cancelled; +}; +typedef struct ompi_status_public_t ompi_status_public_t; + +/* + * User typedefs + */ +typedef int (MPI_Copy_function)(MPI_Comm, int, void *, + void *, void *, int *); +typedef int (MPI_Delete_function)(MPI_Comm, int, void *, void *); +typedef int (MPI_Datarep_extent_function)(MPI_Datatype, MPI_Aint *, void *); +typedef int (MPI_Datarep_conversion_function)(void *, MPI_Datatype, + int, void *, MPI_Offset, void *); +typedef void (MPI_Comm_errhandler_fn)(MPI_Comm *, int *, ...); +typedef void (MPI_File_errhandler_fn)(MPI_File *, int *, ...); +typedef void (MPI_Win_errhandler_fn)(MPI_Win *, int *, ...); +typedef void (MPI_Handler_function)(MPI_Comm *, int *, ...); +typedef void (MPI_User_function)(void *, void *, int *, MPI_Datatype *); +typedef int (MPI_Comm_copy_attr_function)(MPI_Comm, int, void *, + void *, void *, int *); +typedef int (MPI_Comm_delete_attr_function)(MPI_Comm, int, void *, void *); +typedef int (MPI_Type_copy_attr_function)(MPI_Datatype, int, void *, + void *, void *, int *); +typedef int (MPI_Type_delete_attr_function)(MPI_Datatype, int, + void *, void *); +typedef int (MPI_Win_copy_attr_function)(MPI_Win, int, void *, + void *, void *, int *); +typedef int (MPI_Win_delete_attr_function)(MPI_Win, int, void *, void *); +typedef int (MPI_Grequest_query_function)(void *, MPI_Status *); +typedef int (MPI_Grequest_free_function)(void *); +typedef int (MPI_Grequest_cancel_function)(void *, int); + +/* + * Miscellaneous constants + */ +#define MPI_ANY_SOURCE -1 /* match any source rank */ +#define MPI_PROC_NULL -2 /* rank of null process */ +#define MPI_ROOT -4 +#define MPI_ANY_TAG -1 /* match any message tag */ +#define MPI_MAX_PROCESSOR_NAME 256 /* max proc. name length */ +#define MPI_MAX_ERROR_STRING 256 /* max error message length */ +#define MPI_MAX_OBJECT_NAME 64 /* max object name length */ +#define MPI_UNDEFINED -32766 /* undefined stuff */ +#define MPI_CART 1 /* cartesian topology */ +#define MPI_GRAPH 2 /* graph topology */ +#define MPI_KEYVAL_INVALID -1 /* invalid key value */ + +/* + * More constants + */ +#define MPI_BOTTOM ((void *) 0) /* base reference address */ +#define MPI_IN_PLACE ((void *) 1) /* in place buffer */ +#define MPI_BSEND_OVERHEAD 128 /* size of bsend header + ptr */ +#define MPI_MAX_INFO_KEY 36 /* max info key length */ +#define MPI_MAX_INFO_VAL 256 /* max info value length */ +#define MPI_ARGV_NULL ((char **) 0) /* NULL argument vector */ +#define MPI_ARGVS_NULL ((char ***) 0) /* NULL argument vectors */ +#define MPI_ERRCODES_IGNORE ((int *) 0) /* don't return error codes */ +#define MPI_MAX_PORT_NAME 36 /* max port name length */ +#define MPI_MAX_NAME_LEN MPI_MAX_PORT_NAME /* max port name length */ +#define MPI_ORDER_C 0 /* C row major order */ +#define MPI_ORDER_FORTRAN 1 /* Fortran column major order */ +#define MPI_DISTRIBUTE_BLOCK 0 /* block distribution */ +#define MPI_DISTRIBUTE_CYCLIC 1 /* cyclic distribution */ +#define MPI_DISTRIBUTE_NONE 2 /* not distributed */ +#define MPI_DISTRIBUTE_DFLT_DARG (-1) /* default distribution arg */ + +/* + * Since these values are arbitrary to Open MPI, we might as well make + * them the same as ROMIO for ease of mapping. These values taken + * from ROMIO's mpio.h file. + */ +#define MPI_MODE_CREATE 1 /* ADIO_CREATE */ +#define MPI_MODE_RDONLY 2 /* ADIO_RDONLY */ +#define MPI_MODE_WRONLY 4 /* ADIO_WRONLY */ +#define MPI_MODE_RDWR 8 /* ADIO_RDWR */ +#define MPI_MODE_DELETE_ON_CLOSE 16 /* ADIO_DELETE_ON_CLOSE */ +#define MPI_MODE_UNIQUE_OPEN 32 /* ADIO_UNIQUE_OPEN */ +#define MPI_MODE_EXCL 64 /* ADIO_EXCL */ +#define MPI_MODE_APPEND 128 /* ADIO_APPEND */ +#define MPI_MODE_SEQUENTIAL 256 /* ADIO_SEQUENTIAL */ + +#define MPI_DISPLACEMENT_CURRENT -54278278 + +#define MPI_SEEK_SET 600 +#define MPI_SEEK_CUR 602 +#define MPI_SEEK_END 604 + +#define MPI_MAX_DATAREP_STRING 128 + +/* + * MPI-2 One-Sided Communications asserts + */ +#define MPI_MODE_NOCHECK 1 +#define MPI_MODE_NOPRECEDE 2 +#define MPI_MODE_NOPUT 4 +#define MPI_MODE_NOSTORE 8 +#define MPI_MODE_NOSUCCEED 16 + +#define MPI_LOCK_EXCLUSIVE 1 +#define MPI_LOCK_SHARED 2 + + +/* + * Predefined attribute keyvals + * + * DO NOT CHANGE THE ORDER WITHOUT ALSO CHANGING THE ORDER IN + * src/attribute/attribute_predefined.c and mpif.h.in. + */ +enum { + /* MPI-1 */ + MPI_TAG_UB, + MPI_HOST, + MPI_IO, + MPI_WTIME_IS_GLOBAL, + + /* MPI-2 */ + MPI_APPNUM, + MPI_LASTUSEDCODE, + MPI_UNIVERSE_SIZE, + MPI_WIN_BASE, + MPI_WIN_SIZE, + MPI_WIN_DISP_UNIT, + + /* Even though these four are IMPI attributes, they need to be there + for all MPI jobs */ + IMPI_CLIENT_SIZE, + IMPI_CLIENT_COLOR, + IMPI_HOST_SIZE, + IMPI_HOST_COLOR +}; + +/* + * Error classes and codes + * Do not change the values of these without also modifying mpif.h.in. + */ +#define MPI_SUCCESS 0 +#define MPI_ERR_BUFFER 1 +#define MPI_ERR_COUNT 2 +#define MPI_ERR_TYPE 3 +#define MPI_ERR_TAG 4 +#define MPI_ERR_COMM 5 +#define MPI_ERR_RANK 6 +#define MPI_ERR_REQUEST 7 +#define MPI_ERR_ROOT 8 +#define MPI_ERR_GROUP 9 +#define MPI_ERR_OP 10 +#define MPI_ERR_TOPOLOGY 11 +#define MPI_ERR_DIMS 12 +#define MPI_ERR_ARG 13 +#define MPI_ERR_UNKNOWN 14 +#define MPI_ERR_TRUNCATE 15 +#define MPI_ERR_OTHER 16 +#define MPI_ERR_INTERN 17 +#define MPI_ERR_IN_STATUS 18 +#define MPI_ERR_PENDING 19 +#define MPI_ERR_ACCESS 20 +#define MPI_ERR_AMODE 21 +#define MPI_ERR_ASSERT 22 +#define MPI_ERR_BAD_FILE 23 +#define MPI_ERR_BASE 24 +#define MPI_ERR_CONVERSION 25 +#define MPI_ERR_DISP 26 +#define MPI_ERR_DUP_DATAREP 27 +#define MPI_ERR_FILE_EXISTS 28 +#define MPI_ERR_FILE_IN_USE 29 +#define MPI_ERR_FILE 30 +#define MPI_ERR_INFO_KEY 31 +#define MPI_ERR_INFO_NOKEY 32 +#define MPI_ERR_INFO_VALUE 33 +#define MPI_ERR_INFO 34 +#define MPI_ERR_IO 35 +#define MPI_ERR_KEYVAL 36 +#define MPI_ERR_LOCKTYPE 37 +#define MPI_ERR_NAME 38 +#define MPI_ERR_NO_MEM 39 +#define MPI_ERR_NOT_SAME 40 +#define MPI_ERR_NO_SPACE 41 +#define MPI_ERR_NO_SUCH_FILE 42 +#define MPI_ERR_PORT 43 +#define MPI_ERR_QUOTA 44 +#define MPI_ERR_READ_ONLY 45 +#define MPI_ERR_RMA_CONFLICT 46 +#define MPI_ERR_RMA_SYNC 47 +#define MPI_ERR_SERVICE 48 +#define MPI_ERR_SIZE 49 +#define MPI_ERR_SPAWN 50 +#define MPI_ERR_UNSUPPORTED_DATAREP 51 +#define MPI_ERR_UNSUPPORTED_OPERATION 52 +#define MPI_ERR_WIN 53 +#define MPI_ERR_LASTCODE 54 + +#define MPI_ERR_SYSRESOURCE -2 + + +/* + * Comparison results. Don't change the order of these, the group + * comparison functions rely on it. + * Do not change the order of these without also modifying mpif.h.in. + */ +enum { + MPI_IDENT, + MPI_CONGRUENT, + MPI_SIMILAR, + MPI_UNEQUAL +}; + +/* + * MPI_Init_thread constants + * Do not change the order of these without also modifying mpif.h.in. + */ +enum { + MPI_THREAD_SINGLE, + MPI_THREAD_FUNNELED, + MPI_THREAD_SERIALIZED, + MPI_THREAD_MULTIPLE +}; + +/* + * Datatype combiners. + * Do not change the order of these without also modifying mpif.h.in. + */ +enum { + MPI_COMBINER_NAMED, + MPI_COMBINER_DUP, + MPI_COMBINER_CONTIGUOUS, + MPI_COMBINER_VECTOR, + MPI_COMBINER_HVECTOR_INTEGER, + MPI_COMBINER_HVECTOR, + MPI_COMBINER_INDEXED, + MPI_COMBINER_HINDEXED_INTEGER, + MPI_COMBINER_HINDEXED, + MPI_COMBINER_INDEXED_BLOCK, + MPI_COMBINER_STRUCT_INTEGER, + MPI_COMBINER_STRUCT, + MPI_COMBINER_SUBARRAY, + MPI_COMBINER_DARRAY, + MPI_COMBINER_F90_REAL, + MPI_COMBINER_F90_COMPLEX, + MPI_COMBINER_F90_INTEGER, + MPI_COMBINER_RESIZED +}; + +/* + * NULL handles + */ +#define MPI_GROUP_NULL (&ompi_mpi_group_null) +#define MPI_COMM_NULL (&ompi_mpi_comm_null) +#define MPI_REQUEST_NULL (&ompi_request_null) +#define MPI_OP_NULL (&ompi_mpi_op_null) +#define MPI_ERRHANDLER_NULL (&ompi_mpi_errhandler_null) +#define MPI_INFO_NULL (&ompi_mpi_info_null) +#define MPI_WIN_NULL (&ompi_mpi_win_null) +#define MPI_FILE_NULL (&ompi_mpi_file_null) + +#define MPI_STATUS_IGNORE ((MPI_Status *) 0) +#define MPI_STATUSES_IGNORE ((MPI_Status *) 0) + +/* MPI-2 specifies that the name "MPI_TYPE_NULL_DELETE_FN" (and all + related friends) must be accessible in C, C++, and Fortran. This is + unworkable if the back-end Fortran compiler uses all caps for its + linker symbol convention -- it results in two functions with + different signatures that have the same name (i.e., both C and + Fortran use the symbol MPI_TYPE_NULL_DELETE_FN). So we have to + #define the C names to be something else, so that they names are + *accessed* through MPI_TYPE_NULL_DELETE_FN, but their actual symbol + name is different. + + However, this file is included when the fortran wrapper functions + are compiled in Open MPI, so we do *not* want these #defines in + this case (i.e., we need the Fortran wrapper function to be + compiled as MPI_TYPE_NULL_DELETE_FN). So add some #if kinds of + protection for this case. */ + +#if !defined(OMPI_COMPILING_F77_WRAPPERS) +#define MPI_NULL_DELETE_FN OMPI_C_MPI_NULL_DELETE_FN +#define MPI_NULL_COPY_FN OMPI_C_MPI_NULL_COPY_FN +#define MPI_DUP_FN OMPI_C_MPI_DUP_FN + +#define MPI_TYPE_NULL_DELETE_FN OMPI_C_MPI_TYPE_NULL_DELETE_FN +#define MPI_TYPE_NULL_COPY_FN OMPI_C_MPI_TYPE_NULL_COPY_FN +#define MPI_TYPE_DUP_FN OMPI_C_MPI_TYPE_DUP_FN + +#define MPI_COMM_NULL_DELETE_FN OMPI_C_MPI_COMM_NULL_DELETE_FN +#define MPI_COMM_NULL_COPY_FN OMPI_C_MPI_COMM_NULL_COPY_FN +#define MPI_COMM_DUP_FN OMPI_C_MPI_COMM_DUP_FN + +#define MPI_WIN_NULL_DELETE_FN OMPI_C_MPI_WIN_NULL_DELETE_FN +#define MPI_WIN_NULL_COPY_FN OMPI_C_MPI_WIN_NULL_COPY_FN +#define MPI_WIN_DUP_FN OMPI_C_MPI_WIN_DUP_FN +#endif + +OMPI_DECLSPEC int OMPI_C_MPI_TYPE_NULL_DELETE_FN( MPI_Datatype datatype, + int type_keyval, + void* attribute_val_out, + void* extra_state ); +OMPI_DECLSPEC int OMPI_C_MPI_TYPE_NULL_COPY_FN( MPI_Datatype datatype, + int type_keyval, + void* extra_state, + void* attribute_val_in, + void* attribute_val_out, + int* flag ); +OMPI_DECLSPEC int OMPI_C_MPI_TYPE_DUP_FN( MPI_Datatype datatype, + int type_keyval, + void* extra_state, + void* attribute_val_in, + void* attribute_val_out, + int* flag ); +OMPI_DECLSPEC int OMPI_C_MPI_COMM_NULL_DELETE_FN( MPI_Comm comm, + int comm_keyval, + void* attribute_val_out, + void* extra_state ); +OMPI_DECLSPEC int OMPI_C_MPI_COMM_NULL_COPY_FN( MPI_Comm comm, + int comm_keyval, + void* extra_state, + void* attribute_val_in, + void* attribute_val_out, + int* flag ); +OMPI_DECLSPEC int OMPI_C_MPI_COMM_DUP_FN( MPI_Comm comm, int comm_keyval, + void* extra_state, + void* attribute_val_in, + void* attribute_val_out, + int* flag ); +OMPI_DECLSPEC int OMPI_C_MPI_NULL_DELETE_FN( MPI_Comm comm, int comm_keyval, + void* attribute_val_out, + void* extra_state ); +OMPI_DECLSPEC int OMPI_C_MPI_NULL_COPY_FN( MPI_Comm comm, int comm_keyval, + void* extra_state, + void* attribute_val_in, + void* attribute_val_out, + int* flag ); +OMPI_DECLSPEC int OMPI_C_MPI_DUP_FN( MPI_Comm comm, int comm_keyval, + void* extra_state, + void* attribute_val_in, + void* attribute_val_out, + int* flag ); +OMPI_DECLSPEC int OMPI_C_MPI_WIN_NULL_DELETE_FN( MPI_Win window, + int win_keyval, + void* attribute_val_out, + void* extra_state ); +OMPI_DECLSPEC int OMPI_C_MPI_WIN_NULL_COPY_FN( MPI_Win window, int win_keyval, + void* extra_state, + void* attribute_val_in, + void* attribute_val_out, + int* flag ); +OMPI_DECLSPEC int OMPI_C_MPI_WIN_DUP_FN( MPI_Win window, int win_keyval, + void* extra_state, + void* attribute_val_in, + void* attribute_val_out, + int* flag ); + + +/* + * External variables + */ +OMPI_DECLSPEC extern struct ompi_communicator_t ompi_mpi_comm_world; +OMPI_DECLSPEC extern struct ompi_communicator_t ompi_mpi_comm_self; +OMPI_DECLSPEC extern struct ompi_communicator_t ompi_mpi_comm_null; + +OMPI_DECLSPEC extern struct ompi_group_t ompi_mpi_group_empty; +OMPI_DECLSPEC extern struct ompi_group_t ompi_mpi_group_null; + +OMPI_DECLSPEC extern struct ompi_request_t ompi_request_null; + +OMPI_DECLSPEC extern struct ompi_op_t ompi_mpi_op_null; +OMPI_DECLSPEC extern struct ompi_op_t ompi_mpi_op_max, ompi_mpi_op_min; +OMPI_DECLSPEC extern struct ompi_op_t ompi_mpi_op_sum, ompi_mpi_op_prod; +OMPI_DECLSPEC extern struct ompi_op_t ompi_mpi_op_land, ompi_mpi_op_band; +OMPI_DECLSPEC extern struct ompi_op_t ompi_mpi_op_lor, ompi_mpi_op_bor; +OMPI_DECLSPEC extern struct ompi_op_t ompi_mpi_op_lxor, ompi_mpi_op_bxor; +OMPI_DECLSPEC extern struct ompi_op_t ompi_mpi_op_maxloc, ompi_mpi_op_minloc; +OMPI_DECLSPEC extern struct ompi_op_t ompi_mpi_op_replace; + +OMPI_DECLSPEC extern struct ompi_datatype_t ompi_mpi_char, ompi_mpi_byte; +OMPI_DECLSPEC extern struct ompi_datatype_t ompi_mpi_int, ompi_mpi_logic; +OMPI_DECLSPEC extern struct ompi_datatype_t ompi_mpi_short, ompi_mpi_long; +OMPI_DECLSPEC extern struct ompi_datatype_t ompi_mpi_float, ompi_mpi_double; +OMPI_DECLSPEC extern struct ompi_datatype_t ompi_mpi_long_double; +OMPI_DECLSPEC extern struct ompi_datatype_t ompi_mpi_cplex, ompi_mpi_packed; +OMPI_DECLSPEC extern struct ompi_datatype_t ompi_mpi_signed_char; +OMPI_DECLSPEC extern struct ompi_datatype_t ompi_mpi_unsigned_char; +OMPI_DECLSPEC extern struct ompi_datatype_t ompi_mpi_unsigned_short; +OMPI_DECLSPEC extern struct ompi_datatype_t ompi_mpi_unsigned, ompi_mpi_datatype_null; +OMPI_DECLSPEC extern struct ompi_datatype_t ompi_mpi_unsigned_long, ompi_mpi_ldblcplex; +OMPI_DECLSPEC extern struct ompi_datatype_t ompi_mpi_ub, ompi_mpi_lb; +OMPI_DECLSPEC extern struct ompi_datatype_t ompi_mpi_float_int, ompi_mpi_double_int; +OMPI_DECLSPEC extern struct ompi_datatype_t ompi_mpi_long_int, ompi_mpi_2int; +OMPI_DECLSPEC extern struct ompi_datatype_t ompi_mpi_short_int, ompi_mpi_dblcplex; +OMPI_DECLSPEC extern struct ompi_datatype_t ompi_mpi_integer, ompi_mpi_real; +OMPI_DECLSPEC extern struct ompi_datatype_t ompi_mpi_dblprec, ompi_mpi_character; +OMPI_DECLSPEC extern struct ompi_datatype_t ompi_mpi_2real, ompi_mpi_2dblprec; +OMPI_DECLSPEC extern struct ompi_datatype_t ompi_mpi_2integer, ompi_mpi_longdbl_int; +OMPI_DECLSPEC extern struct ompi_datatype_t ompi_mpi_wchar, ompi_mpi_long_long_int; +OMPI_DECLSPEC extern struct ompi_datatype_t ompi_mpi_unsigned_long_long; +OMPI_DECLSPEC extern struct ompi_datatype_t ompi_mpi_cxx_cplex, ompi_mpi_cxx_dblcplex; +OMPI_DECLSPEC extern struct ompi_datatype_t ompi_mpi_cxx_ldblcplex; +OMPI_DECLSPEC extern struct ompi_datatype_t ompi_mpi_cxx_bool; +OMPI_DECLSPEC extern struct ompi_datatype_t ompi_mpi_2cplex, ompi_mpi_2dblcplex; +/* other MPI2 datatypes */ +#if OMPI_HAVE_FORTRAN_INTEGER1 +OMPI_DECLSPEC extern struct ompi_datatype_t ompi_mpi_integer1; +#endif +#if OMPI_HAVE_FORTRAN_INTEGER2 +OMPI_DECLSPEC extern struct ompi_datatype_t ompi_mpi_integer2; +#endif +#if OMPI_HAVE_FORTRAN_INTEGER4 +OMPI_DECLSPEC extern struct ompi_datatype_t ompi_mpi_integer4; +#endif +#if OMPI_HAVE_FORTRAN_INTEGER8 +OMPI_DECLSPEC extern struct ompi_datatype_t ompi_mpi_integer8; +#endif +#if OMPI_HAVE_FORTRAN_INTEGER16 +OMPI_DECLSPEC extern struct ompi_datatype_t ompi_mpi_integer16; +#endif +#if OMPI_HAVE_FORTRAN_REAL4 +OMPI_DECLSPEC extern struct ompi_datatype_t ompi_mpi_real4; +#endif +#if OMPI_HAVE_FORTRAN_REAL8 +OMPI_DECLSPEC extern struct ompi_datatype_t ompi_mpi_real8; +#endif +#if OMPI_HAVE_FORTRAN_REAL16 +OMPI_DECLSPEC extern struct ompi_datatype_t ompi_mpi_real16; +#endif +#if OMPI_HAVE_FORTRAN_REAL4 +OMPI_DECLSPEC extern struct ompi_datatype_t ompi_mpi_complex8; +#endif +#if OMPI_HAVE_FORTRAN_REAL8 +OMPI_DECLSPEC extern struct ompi_datatype_t ompi_mpi_complex16; +#endif +#if OMPI_HAVE_FORTRAN_REAL16 +OMPI_DECLSPEC extern struct ompi_datatype_t ompi_mpi_complex32; +#endif + +OMPI_DECLSPEC extern struct ompi_errhandler_t ompi_mpi_errhandler_null; +OMPI_DECLSPEC extern struct ompi_errhandler_t ompi_mpi_errors_are_fatal; +OMPI_DECLSPEC extern struct ompi_errhandler_t ompi_mpi_errors_return; + +OMPI_DECLSPEC extern struct ompi_win_t ompi_mpi_win_null; +OMPI_DECLSPEC extern struct ompi_file_t ompi_mpi_file_null; + +OMPI_DECLSPEC extern struct ompi_info_t ompi_mpi_info_null; + +OMPI_DECLSPEC extern MPI_Fint *MPI_F_STATUS_IGNORE; +OMPI_DECLSPEC extern MPI_Fint *MPI_F_STATUSES_IGNORE; + +/* + * MPI predefined handles + */ +#define MPI_COMM_WORLD (&ompi_mpi_comm_world) +#define MPI_COMM_SELF (&ompi_mpi_comm_self) + +#define MPI_GROUP_EMPTY (&ompi_mpi_group_empty) + +#define MPI_MAX (&ompi_mpi_op_max) +#define MPI_MIN (&ompi_mpi_op_min) +#define MPI_SUM (&ompi_mpi_op_sum) +#define MPI_PROD (&ompi_mpi_op_prod) +#define MPI_LAND (&ompi_mpi_op_land) +#define MPI_BAND (&ompi_mpi_op_band) +#define MPI_LOR (&ompi_mpi_op_lor) +#define MPI_BOR (&ompi_mpi_op_bor) +#define MPI_LXOR (&ompi_mpi_op_lxor) +#define MPI_BXOR (&ompi_mpi_op_bxor) +#define MPI_MAXLOC (&ompi_mpi_op_maxloc) +#define MPI_MINLOC (&ompi_mpi_op_minloc) +#define MPI_REPLACE (&ompi_mpi_op_replace) + +/* C datatypes */ +#define MPI_DATATYPE_NULL (&ompi_mpi_datatype_null) +#define MPI_BYTE (&ompi_mpi_byte) +#define MPI_PACKED (&ompi_mpi_packed) +#define MPI_CHAR (&ompi_mpi_char) +#define MPI_SHORT (&ompi_mpi_short) +#define MPI_INT (&ompi_mpi_int) +#define MPI_LONG (&ompi_mpi_long) +#define MPI_FLOAT (&ompi_mpi_float) +#define MPI_DOUBLE (&ompi_mpi_double) +#define MPI_LONG_DOUBLE (&ompi_mpi_long_double) +#define MPI_UNSIGNED_CHAR (&ompi_mpi_unsigned_char) +#define MPI_SIGNED_CHAR (&ompi_mpi_signed_char) +#define MPI_UNSIGNED_SHORT (&ompi_mpi_unsigned_short) +#define MPI_UNSIGNED_LONG (&ompi_mpi_unsigned_long) +#define MPI_UNSIGNED (&ompi_mpi_unsigned) +#define MPI_FLOAT_INT (&ompi_mpi_float_int) +#define MPI_DOUBLE_INT (&ompi_mpi_double_int) +#define MPI_LONG_DOUBLE_INT (&ompi_mpi_longdbl_int) +#define MPI_LONG_INT (&ompi_mpi_long_int) +#define MPI_SHORT_INT (&ompi_mpi_short_int) +#define MPI_2INT (&ompi_mpi_2int) +#define MPI_UB (&ompi_mpi_ub) +#define MPI_LB (&ompi_mpi_lb) +#define MPI_WCHAR (&ompi_mpi_wchar) +#if HAVE_LONG_LONG +#define MPI_LONG_LONG_INT (&ompi_mpi_long_long_int) +#define MPI_LONG_LONG (&ompi_mpi_long_long_int) +#define MPI_UNSIGNED_LONG_LONG (&ompi_mpi_unsigned_long_long) +#endif /* HAVE_LONG_LONG */ +#define MPI_2COMPLEX (&ompi_mpi_2cplex) +#define MPI_2DOUBLE_COMPLEX (&ompi_mpi_2dblcplex) + +/* Fortran datatype bindings */ +#define MPI_CHARACTER (&ompi_mpi_character) +#define MPI_LOGICAL (&ompi_mpi_logic) +#define MPI_INTEGER (&ompi_mpi_integer) +#if OMPI_HAVE_FORTRAN_INTEGER1 +#define MPI_INTEGER1 (&ompi_mpi_integer1) +#endif +#if OMPI_HAVE_FORTRAN_INTEGER2 +#define MPI_INTEGER2 (&ompi_mpi_integer2) +#endif +#if OMPI_HAVE_FORTRAN_INTEGER4 +#define MPI_INTEGER4 (&ompi_mpi_integer4) +#endif +#if OMPI_HAVE_FORTRAN_INTEGER8 +#define MPI_INTEGER8 (&ompi_mpi_integer8) +#endif +#if OMPI_HAVE_FORTRAN_INTEGER16 +#define MPI_INTEGER16 (&ompi_mpi_integer16) +#endif +#define MPI_REAL (&ompi_mpi_real) +#if OMPI_HAVE_FORTRAN_REAL4 +#define MPI_REAL4 (&ompi_mpi_real4) +#endif +#if OMPI_HAVE_FORTRAN_REAL8 +#define MPI_REAL8 (&ompi_mpi_real8) +#endif +#if OMPI_HAVE_FORTRAN_REAL16 +#define MPI_REAL16 (&ompi_mpi_real16) +#endif +#define MPI_DOUBLE_PRECISION (&ompi_mpi_dblprec) +#define MPI_COMPLEX (&ompi_mpi_cplex) +#if OMPI_HAVE_FORTRAN_REAL4 +#define MPI_COMPLEX8 (&ompi_mpi_complex8) +#endif +#if OMPI_HAVE_FORTRAN_REAL8 +#define MPI_COMPLEX16 (&ompi_mpi_complex16) +#endif +#if OMPI_HAVE_FORTRAN_REAL16 +#define MPI_COMPLEX32 (&ompi_mpi_complex32) +#endif +#define MPI_DOUBLE_COMPLEX (&ompi_mpi_dblcplex) +#define MPI_2REAL (&ompi_mpi_2real) +#define MPI_2DOUBLE_PRECISION (&ompi_mpi_2dblprec) +#define MPI_2INTEGER (&ompi_mpi_2integer) + +#define MPI_ERRORS_ARE_FATAL (&ompi_mpi_errors_are_fatal) +#define MPI_ERRORS_RETURN (&ompi_mpi_errors_return) + +/* Typeclass definition for MPI_Type_match_size */ +#define MPI_TYPECLASS_INTEGER 1 +#define MPI_TYPECLASS_REAL 2 +#define MPI_TYPECLASS_COMPLEX 3 + +/* + * For applications still using the old [non-standard] ROMIO conventions + */ +#define MPIO_Request MPI_Request +#define MPIO_Test MPI_Test +#define MPIO_Wait MPI_Wait + + +/* + * MPI API + */ + +OMPI_DECLSPEC int MPI_Abort(MPI_Comm comm, int errorcode); +OMPI_DECLSPEC int MPI_Accumulate(void *origin_addr, int origin_count, MPI_Datatype origin_datatype, + int target_rank, MPI_Aint target_disp, int target_count, + MPI_Datatype target_datatype, MPI_Op op, MPI_Win win); +OMPI_DECLSPEC int MPI_Add_error_class(int *errorclass); +OMPI_DECLSPEC int MPI_Add_error_code(int errorclass, int *errorcode); +OMPI_DECLSPEC int MPI_Add_error_string(int errorcode, char *string); +OMPI_DECLSPEC int MPI_Address(void *location, MPI_Aint *address); +OMPI_DECLSPEC int MPI_Allgather(void *sendbuf, int sendcount, MPI_Datatype sendtype, + void *recvbuf, int recvcount, + MPI_Datatype recvtype, MPI_Comm comm); +OMPI_DECLSPEC int MPI_Allgatherv(void *sendbuf, int sendcount, MPI_Datatype sendtype, + void *recvbuf, int *recvcounts, + int *displs, MPI_Datatype recvtype, MPI_Comm comm); +OMPI_DECLSPEC int MPI_Alloc_mem(MPI_Aint size, MPI_Info info, + void *baseptr); +OMPI_DECLSPEC int MPI_Allreduce(void *sendbuf, void *recvbuf, int count, + MPI_Datatype datatype, MPI_Op op, MPI_Comm comm); +OMPI_DECLSPEC int MPI_Alltoall(void *sendbuf, int sendcount, MPI_Datatype sendtype, + void *recvbuf, int recvcount, + MPI_Datatype recvtype, MPI_Comm comm); +OMPI_DECLSPEC int MPI_Alltoallv(void *sendbuf, int *sendcounts, int *sdispls, + MPI_Datatype sendtype, void *recvbuf, int *recvcounts, + int *rdispls, MPI_Datatype recvtype, MPI_Comm comm); +OMPI_DECLSPEC int MPI_Alltoallw(void *sendbuf, int *sendcounts, int *sdispls, MPI_Datatype *sendtypes, + void *recvbuf, int *recvcounts, int *rdispls, MPI_Datatype *recvtypes, + MPI_Comm comm); +OMPI_DECLSPEC int MPI_Attr_delete(MPI_Comm comm, int keyval); +OMPI_DECLSPEC int MPI_Attr_get(MPI_Comm comm, int keyval, void *attribute_val, int *flag); +OMPI_DECLSPEC int MPI_Attr_put(MPI_Comm comm, int keyval, void *attribute_val); +OMPI_DECLSPEC int MPI_Barrier(MPI_Comm comm); +OMPI_DECLSPEC int MPI_Bcast(void *buffer, int count, MPI_Datatype datatype, + int root, MPI_Comm comm); +OMPI_DECLSPEC int MPI_Bsend(void *buf, int count, MPI_Datatype datatype, + int dest, int tag, MPI_Comm comm); +OMPI_DECLSPEC int MPI_Bsend_init(void *buf, int count, MPI_Datatype datatype, + int dest, int tag, MPI_Comm comm, MPI_Request *request); +OMPI_DECLSPEC int MPI_Buffer_attach(void *buffer, int size); +OMPI_DECLSPEC int MPI_Buffer_detach(void *buffer, int *size); +OMPI_DECLSPEC int MPI_Cancel(MPI_Request *request); +OMPI_DECLSPEC int MPI_Cart_coords(MPI_Comm comm, int rank, int maxdims, int *coords); +OMPI_DECLSPEC int MPI_Cart_create(MPI_Comm old_comm, int ndims, int *dims, + int *periods, int reorder, MPI_Comm *comm_cart); +OMPI_DECLSPEC int MPI_Cart_get(MPI_Comm comm, int maxdims, int *dims, + int *periods, int *coords); +OMPI_DECLSPEC int MPI_Cart_map(MPI_Comm comm, int ndims, int *dims, + int *periods, int *newrank); +OMPI_DECLSPEC int MPI_Cart_rank(MPI_Comm comm, int *coords, int *rank); +OMPI_DECLSPEC int MPI_Cart_shift(MPI_Comm comm, int direction, int disp, + int *rank_source, int *rank_dest); +OMPI_DECLSPEC int MPI_Cart_sub(MPI_Comm comm, int *remain_dims, MPI_Comm *new_comm); +OMPI_DECLSPEC int MPI_Cartdim_get(MPI_Comm comm, int *ndims); +OMPI_DECLSPEC int MPI_Close_port(char *port_name); +OMPI_DECLSPEC int MPI_Comm_accept(char *port_name, MPI_Info info, int root, + MPI_Comm comm, MPI_Comm *newcomm); +OMPI_DECLSPEC MPI_Fint MPI_Comm_c2f(MPI_Comm comm); +OMPI_DECLSPEC int MPI_Comm_call_errhandler(MPI_Comm comm, int errorcode); +OMPI_DECLSPEC int MPI_Comm_compare(MPI_Comm comm1, MPI_Comm comm2, int *result); +OMPI_DECLSPEC int MPI_Comm_connect(char *port_name, MPI_Info info, int root, + MPI_Comm comm, MPI_Comm *newcomm); +OMPI_DECLSPEC int MPI_Comm_create_errhandler(MPI_Comm_errhandler_fn *function, + MPI_Errhandler *errhandler); +OMPI_DECLSPEC int MPI_Comm_create_keyval(MPI_Comm_copy_attr_function *comm_copy_attr_fn, + MPI_Comm_delete_attr_function *comm_delete_attr_fn, + int *comm_keyval, void *extra_state); +OMPI_DECLSPEC int MPI_Comm_create(MPI_Comm comm, MPI_Group group, MPI_Comm *newcomm); +OMPI_DECLSPEC int MPI_Comm_delete_attr(MPI_Comm comm, int comm_keyval); +OMPI_DECLSPEC int MPI_Comm_disconnect(MPI_Comm *comm); +OMPI_DECLSPEC int MPI_Comm_dup(MPI_Comm comm, MPI_Comm *newcomm); +OMPI_DECLSPEC MPI_Comm MPI_Comm_f2c(MPI_Fint comm); +OMPI_DECLSPEC int MPI_Comm_free_keyval(int *comm_keyval); +OMPI_DECLSPEC int MPI_Comm_free(MPI_Comm *comm); +OMPI_DECLSPEC int MPI_Comm_get_attr(MPI_Comm comm, int comm_keyval, + void *attribute_val, int *flag); +OMPI_DECLSPEC int MPI_Comm_get_errhandler(MPI_Comm comm, MPI_Errhandler *erhandler); +OMPI_DECLSPEC int MPI_Comm_get_name(MPI_Comm comm, char *comm_name, int *resultlen); +OMPI_DECLSPEC int MPI_Comm_get_parent(MPI_Comm *parent); +OMPI_DECLSPEC int MPI_Comm_group(MPI_Comm comm, MPI_Group *group); +OMPI_DECLSPEC int MPI_Comm_join(int fd, MPI_Comm *intercomm); +OMPI_DECLSPEC int MPI_Comm_rank(MPI_Comm comm, int *rank); +OMPI_DECLSPEC int MPI_Comm_remote_group(MPI_Comm comm, MPI_Group *group); +OMPI_DECLSPEC int MPI_Comm_remote_size(MPI_Comm comm, int *size); +OMPI_DECLSPEC int MPI_Comm_set_attr(MPI_Comm comm, int comm_keyval, void *attribute_val); +OMPI_DECLSPEC int MPI_Comm_set_errhandler(MPI_Comm comm, MPI_Errhandler errhandler); +OMPI_DECLSPEC int MPI_Comm_set_name(MPI_Comm comm, char *comm_name); +OMPI_DECLSPEC int MPI_Comm_size(MPI_Comm comm, int *size); +OMPI_DECLSPEC int MPI_Comm_spawn(char *command, char **argv, int maxprocs, MPI_Info info, + int root, MPI_Comm comm, MPI_Comm *intercomm, + int *array_of_errcodes); +OMPI_DECLSPEC int MPI_Comm_spawn_multiple(int count, char **array_of_commands, char ***array_of_argv, + int *array_of_maxprocs, MPI_Info *array_of_info, + int root, MPI_Comm comm, MPI_Comm *intercomm, + int *array_of_errcodes); +OMPI_DECLSPEC int MPI_Comm_split(MPI_Comm comm, int color, int key, MPI_Comm *newcomm); +OMPI_DECLSPEC int MPI_Comm_test_inter(MPI_Comm comm, int *flag); +OMPI_DECLSPEC int MPI_Dims_create(int nnodes, int ndims, int *dims); +OMPI_DECLSPEC MPI_Fint MPI_Errhandler_c2f(MPI_Errhandler errhandler); +OMPI_DECLSPEC int MPI_Errhandler_create(MPI_Handler_function *function, + MPI_Errhandler *errhandler); +OMPI_DECLSPEC MPI_Errhandler MPI_Errhandler_f2c(MPI_Fint errhandler); +OMPI_DECLSPEC int MPI_Errhandler_free(MPI_Errhandler *errhandler); +OMPI_DECLSPEC int MPI_Errhandler_get(MPI_Comm comm, MPI_Errhandler *errhandler); +OMPI_DECLSPEC int MPI_Errhandler_set(MPI_Comm comm, MPI_Errhandler errhandler); +OMPI_DECLSPEC int MPI_Error_class(int errorcode, int *errorclass); +OMPI_DECLSPEC int MPI_Error_string(int errorcode, char *string, int *resultlen); +OMPI_DECLSPEC int MPI_Exscan(void *sendbuf, void *recvbuf, int count, + MPI_Datatype datatype, MPI_Op op, MPI_Comm comm); +OMPI_DECLSPEC MPI_Fint MPI_File_c2f(MPI_File file); +OMPI_DECLSPEC MPI_File MPI_File_f2c(MPI_Fint file); +OMPI_DECLSPEC int MPI_File_call_errhandler(MPI_File fh, int errorcode); +OMPI_DECLSPEC int MPI_File_create_errhandler(MPI_File_errhandler_fn *function, + MPI_Errhandler *errhandler); +OMPI_DECLSPEC int MPI_File_set_errhandler( MPI_File file, MPI_Errhandler errhandler); +OMPI_DECLSPEC int MPI_File_get_errhandler( MPI_File file, MPI_Errhandler *errhandler); +OMPI_DECLSPEC int MPI_File_open(MPI_Comm comm, char *filename, int amode, + MPI_Info info, MPI_File *fh); +OMPI_DECLSPEC int MPI_File_close(MPI_File *fh); +OMPI_DECLSPEC int MPI_File_delete(char *filename, MPI_Info info); +OMPI_DECLSPEC int MPI_File_set_size(MPI_File fh, MPI_Offset size); +OMPI_DECLSPEC int MPI_File_preallocate(MPI_File fh, MPI_Offset size); +OMPI_DECLSPEC int MPI_File_get_size(MPI_File fh, MPI_Offset *size); +OMPI_DECLSPEC int MPI_File_get_group(MPI_File fh, MPI_Group *group); +OMPI_DECLSPEC int MPI_File_get_amode(MPI_File fh, int *amode); +OMPI_DECLSPEC int MPI_File_set_info(MPI_File fh, MPI_Info info); +OMPI_DECLSPEC int MPI_File_get_info(MPI_File fh, MPI_Info *info_used); +OMPI_DECLSPEC int MPI_File_set_view(MPI_File fh, MPI_Offset disp, MPI_Datatype etype, + MPI_Datatype filetype, char *datarep, MPI_Info info); +OMPI_DECLSPEC int MPI_File_get_view(MPI_File fh, MPI_Offset *disp, + MPI_Datatype *etype, + MPI_Datatype *filetype, char *datarep); +OMPI_DECLSPEC int MPI_File_read_at(MPI_File fh, MPI_Offset offset, void *buf, + int count, MPI_Datatype datatype, MPI_Status *status); +OMPI_DECLSPEC int MPI_File_read_at_all(MPI_File fh, MPI_Offset offset, void *buf, + int count, MPI_Datatype datatype, MPI_Status *status); +OMPI_DECLSPEC int MPI_File_write_at(MPI_File fh, MPI_Offset offset, void *buf, + int count, MPI_Datatype datatype, MPI_Status *status); +OMPI_DECLSPEC int MPI_File_write_at_all(MPI_File fh, MPI_Offset offset, void *buf, + int count, MPI_Datatype datatype, MPI_Status *status); +OMPI_DECLSPEC int MPI_File_iread_at(MPI_File fh, MPI_Offset offset, void *buf, + int count, MPI_Datatype datatype, MPI_Request *request); +OMPI_DECLSPEC int MPI_File_iwrite_at(MPI_File fh, MPI_Offset offset, void *buf, + int count, MPI_Datatype datatype, MPI_Request *request); +OMPI_DECLSPEC int MPI_File_read(MPI_File fh, void *buf, int count, + MPI_Datatype datatype, MPI_Status *status); +OMPI_DECLSPEC int MPI_File_read_all(MPI_File fh, void *buf, int count, + MPI_Datatype datatype, MPI_Status *status); +OMPI_DECLSPEC int MPI_File_write(MPI_File fh, void *buf, int count, + MPI_Datatype datatype, MPI_Status *status); +OMPI_DECLSPEC int MPI_File_write_all(MPI_File fh, void *buf, int count, + MPI_Datatype datatype, MPI_Status *status); +OMPI_DECLSPEC int MPI_File_iread(MPI_File fh, void *buf, int count, + MPI_Datatype datatype, MPI_Request *request); +OMPI_DECLSPEC int MPI_File_iwrite(MPI_File fh, void *buf, int count, + MPI_Datatype datatype, MPI_Request *request); +OMPI_DECLSPEC int MPI_File_seek(MPI_File fh, MPI_Offset offset, int whence); +OMPI_DECLSPEC int MPI_File_get_position(MPI_File fh, MPI_Offset *offset); +OMPI_DECLSPEC int MPI_File_get_byte_offset(MPI_File fh, MPI_Offset offset, + MPI_Offset *disp); +OMPI_DECLSPEC int MPI_File_read_shared(MPI_File fh, void *buf, int count, + MPI_Datatype datatype, MPI_Status *status); +OMPI_DECLSPEC int MPI_File_write_shared(MPI_File fh, void *buf, int count, + MPI_Datatype datatype, MPI_Status *status); +OMPI_DECLSPEC int MPI_File_iread_shared(MPI_File fh, void *buf, int count, + MPI_Datatype datatype, MPI_Request *request); +OMPI_DECLSPEC int MPI_File_iwrite_shared(MPI_File fh, void *buf, int count, + MPI_Datatype datatype, MPI_Request *request); +OMPI_DECLSPEC int MPI_File_read_ordered(MPI_File fh, void *buf, int count, + MPI_Datatype datatype, MPI_Status *status); +OMPI_DECLSPEC int MPI_File_write_ordered(MPI_File fh, void *buf, int count, + MPI_Datatype datatype, MPI_Status *status); +OMPI_DECLSPEC int MPI_File_seek_shared(MPI_File fh, MPI_Offset offset, int whence); +OMPI_DECLSPEC int MPI_File_get_position_shared(MPI_File fh, MPI_Offset *offset); +OMPI_DECLSPEC int MPI_File_read_at_all_begin(MPI_File fh, MPI_Offset offset, void *buf, + int count, MPI_Datatype datatype); +OMPI_DECLSPEC int MPI_File_read_at_all_end(MPI_File fh, void *buf, MPI_Status *status); +OMPI_DECLSPEC int MPI_File_write_at_all_begin(MPI_File fh, MPI_Offset offset, void *buf, + int count, MPI_Datatype datatype); +OMPI_DECLSPEC int MPI_File_write_at_all_end(MPI_File fh, void *buf, MPI_Status *status); +OMPI_DECLSPEC int MPI_File_read_all_begin(MPI_File fh, void *buf, int count, + MPI_Datatype datatype); +OMPI_DECLSPEC int MPI_File_read_all_end(MPI_File fh, void *buf, MPI_Status *status); +OMPI_DECLSPEC int MPI_File_write_all_begin(MPI_File fh, void *buf, int count, + MPI_Datatype datatype); +OMPI_DECLSPEC int MPI_File_write_all_end(MPI_File fh, void *buf, MPI_Status *status); +OMPI_DECLSPEC int MPI_File_read_ordered_begin(MPI_File fh, void *buf, int count, + MPI_Datatype datatype); +OMPI_DECLSPEC int MPI_File_read_ordered_end(MPI_File fh, void *buf, MPI_Status *status); +OMPI_DECLSPEC int MPI_File_write_ordered_begin(MPI_File fh, void *buf, int count, + MPI_Datatype datatype); +OMPI_DECLSPEC int MPI_File_write_ordered_end(MPI_File fh, void *buf, MPI_Status *status); +OMPI_DECLSPEC int MPI_File_get_type_extent(MPI_File fh, MPI_Datatype datatype, + MPI_Aint *extent); +OMPI_DECLSPEC int MPI_File_set_atomicity(MPI_File fh, int flag); +OMPI_DECLSPEC int MPI_File_get_atomicity(MPI_File fh, int *flag); +OMPI_DECLSPEC int MPI_File_sync(MPI_File fh); +/* + * file functions end + */ +OMPI_DECLSPEC int MPI_Finalize(void); +OMPI_DECLSPEC int MPI_Finalized(int *flag); +OMPI_DECLSPEC int MPI_Free_mem(void *base); +OMPI_DECLSPEC int MPI_Gather(void *sendbuf, int sendcount, MPI_Datatype sendtype, + void *recvbuf, int recvcount, MPI_Datatype recvtype, + int root, MPI_Comm comm); +OMPI_DECLSPEC int MPI_Gatherv(void *sendbuf, int sendcount, MPI_Datatype sendtype, + void *recvbuf, int *recvcounts, int *displs, + MPI_Datatype recvtype, int root, MPI_Comm comm); +OMPI_DECLSPEC int MPI_Get_address(void *location, MPI_Aint *address); +OMPI_DECLSPEC int MPI_Get_count(MPI_Status *status, MPI_Datatype datatype, int *count); +OMPI_DECLSPEC int MPI_Get_elements(MPI_Status *status, MPI_Datatype datatype, int *count); +OMPI_DECLSPEC int MPI_Get(void *origin_addr, int origin_count, + MPI_Datatype origin_datatype, int target_rank, + MPI_Aint target_disp, int target_count, + MPI_Datatype target_datatype, MPI_Win win); +OMPI_DECLSPEC int MPI_Get_processor_name(char *name, int *resultlen); +OMPI_DECLSPEC int MPI_Get_version(int *version, int *subversion); +OMPI_DECLSPEC int MPI_Graph_create(MPI_Comm comm_old, int nnodes, int *index, + int *edges, int reorder, MPI_Comm *comm_graph); +OMPI_DECLSPEC int MPI_Graph_get(MPI_Comm comm, int maxindex, int maxedges, + int *index, int *edges); +OMPI_DECLSPEC int MPI_Graph_map(MPI_Comm comm, int nnodes, int *index, int *edges, + int *newrank); +OMPI_DECLSPEC int MPI_Graph_neighbors_count(MPI_Comm comm, int rank, int *nneighbors); +OMPI_DECLSPEC int MPI_Graph_neighbors(MPI_Comm comm, int rank, int maxneighbors, + int *neighbors); +OMPI_DECLSPEC int MPI_Graphdims_get(MPI_Comm comm, int *nnodes, int *nedges); +OMPI_DECLSPEC int MPI_Grequest_complete(MPI_Request request); +OMPI_DECLSPEC int MPI_Grequest_start(MPI_Grequest_query_function *query_fn, + MPI_Grequest_free_function *free_fn, + MPI_Grequest_cancel_function *cancel_fn, + void *extra_state, MPI_Request *request); +OMPI_DECLSPEC MPI_Fint MPI_Group_c2f(MPI_Group group); +OMPI_DECLSPEC int MPI_Group_compare(MPI_Group group1, MPI_Group group2, int *result); +OMPI_DECLSPEC int MPI_Group_difference(MPI_Group group1, MPI_Group group2, + MPI_Group *newgroup); +OMPI_DECLSPEC int MPI_Group_excl(MPI_Group group, int n, int *ranks, + MPI_Group *newgroup); +OMPI_DECLSPEC MPI_Group MPI_Group_f2c(MPI_Fint group); +OMPI_DECLSPEC int MPI_Group_free(MPI_Group *group); +OMPI_DECLSPEC int MPI_Group_incl(MPI_Group group, int n, int *ranks, + MPI_Group *newgroup); +OMPI_DECLSPEC int MPI_Group_intersection(MPI_Group group1, MPI_Group group2, + MPI_Group *newgroup); +OMPI_DECLSPEC int MPI_Group_range_excl(MPI_Group group, int n, int ranges[][3], + MPI_Group *newgroup); +OMPI_DECLSPEC int MPI_Group_range_incl(MPI_Group group, int n, int ranges[][3], + MPI_Group *newgroup); +OMPI_DECLSPEC int MPI_Group_rank(MPI_Group group, int *rank); +OMPI_DECLSPEC int MPI_Group_size(MPI_Group group, int *size); +OMPI_DECLSPEC int MPI_Group_translate_ranks(MPI_Group group1, int n, int *ranks1, + MPI_Group group2, int *ranks2); +OMPI_DECLSPEC int MPI_Group_union(MPI_Group group1, MPI_Group group2, + MPI_Group *newgroup); +OMPI_DECLSPEC int MPI_Ibsend(void *buf, int count, MPI_Datatype datatype, int dest, + int tag, MPI_Comm comm, MPI_Request *request); +OMPI_DECLSPEC MPI_Fint MPI_Info_c2f(MPI_Info info); +OMPI_DECLSPEC int MPI_Info_create(MPI_Info *info); +OMPI_DECLSPEC int MPI_Info_delete(MPI_Info info, char *key); +OMPI_DECLSPEC int MPI_Info_dup(MPI_Info info, MPI_Info *newinfo); +OMPI_DECLSPEC MPI_Info MPI_Info_f2c(MPI_Fint info); +OMPI_DECLSPEC int MPI_Info_free(MPI_Info *info); +OMPI_DECLSPEC int MPI_Info_get(MPI_Info info, char *key, int valuelen, + char *value, int *flag); +OMPI_DECLSPEC int MPI_Info_get_nkeys(MPI_Info info, int *nkeys); +OMPI_DECLSPEC int MPI_Info_get_nthkey(MPI_Info info, int n, char *key); +OMPI_DECLSPEC int MPI_Info_get_valuelen(MPI_Info info, char *key, int *valuelen, + int *flag); +OMPI_DECLSPEC int MPI_Info_set(MPI_Info info, char *key, char *value); +OMPI_DECLSPEC int MPI_Init(int *argc, char ***argv); +OMPI_DECLSPEC int MPI_Initialized(int *flag); +OMPI_DECLSPEC int MPI_Init_thread(int *argc, char ***argv, int required, + int *provided); +OMPI_DECLSPEC int MPI_Intercomm_create(MPI_Comm local_comm, int local_leader, + MPI_Comm bridge_comm, int remote_leader, + int tag, MPI_Comm *newintercomm); +OMPI_DECLSPEC int MPI_Intercomm_merge(MPI_Comm intercomm, int high, + MPI_Comm *newintercomm); +OMPI_DECLSPEC int MPI_Iprobe(int source, int tag, MPI_Comm comm, int *flag, + MPI_Status *status); +OMPI_DECLSPEC int MPI_Irecv(void *buf, int count, MPI_Datatype datatype, int source, + int tag, MPI_Comm comm, MPI_Request *request); +OMPI_DECLSPEC int MPI_Irsend(void *buf, int count, MPI_Datatype datatype, int dest, + int tag, MPI_Comm comm, MPI_Request *request); +OMPI_DECLSPEC int MPI_Isend(void *buf, int count, MPI_Datatype datatype, int dest, + int tag, MPI_Comm comm, MPI_Request *request); +OMPI_DECLSPEC int MPI_Issend(void *buf, int count, MPI_Datatype datatype, int dest, + int tag, MPI_Comm comm, MPI_Request *request); +OMPI_DECLSPEC int MPI_Is_thread_main(int *flag); +OMPI_DECLSPEC int MPI_Keyval_create(MPI_Copy_function *copy_fn, + MPI_Delete_function *delete_fn, + int *keyval, void *extra_state); +OMPI_DECLSPEC int MPI_Keyval_free(int *keyval); +OMPI_DECLSPEC int MPI_Lookup_name(char *service_name, MPI_Info info, char *port_name); +OMPI_DECLSPEC MPI_Fint MPI_Op_c2f(MPI_Op op); +OMPI_DECLSPEC int MPI_Op_create(MPI_User_function *function, int commute, MPI_Op *op); +OMPI_DECLSPEC int MPI_Open_port(MPI_Info info, char *port_name); +OMPI_DECLSPEC MPI_Op MPI_Op_f2c(MPI_Fint op); +OMPI_DECLSPEC int MPI_Op_free(MPI_Op *op); +OMPI_DECLSPEC int MPI_Pack_external(char *datarep, void *inbuf, int incount, + MPI_Datatype datatype, void *outbuf, + MPI_Aint outsize, MPI_Aint *position); +OMPI_DECLSPEC int MPI_Pack_external_size(char *datarep, int incount, + MPI_Datatype datatype, MPI_Aint *size); +OMPI_DECLSPEC int MPI_Pack(void *inbuf, int incount, MPI_Datatype datatype, + void *outbuf, int outsize, int *position, MPI_Comm comm); +OMPI_DECLSPEC int MPI_Pack_size(int incount, MPI_Datatype datatype, MPI_Comm comm, + int *size); +OMPI_DECLSPEC int MPI_Pcontrol(const int level, ...); +OMPI_DECLSPEC int MPI_Probe(int source, int tag, MPI_Comm comm, MPI_Status *status); +OMPI_DECLSPEC int MPI_Publish_name(char *service_name, MPI_Info info, + char *port_name); +OMPI_DECLSPEC int MPI_Put(void *origin_addr, int origin_count, MPI_Datatype origin_datatype, + int target_rank, MPI_Aint target_disp, int target_count, + MPI_Datatype target_datatype, MPI_Win win); +OMPI_DECLSPEC int MPI_Query_thread(int *provided); +OMPI_DECLSPEC int MPI_Recv_init(void *buf, int count, MPI_Datatype datatype, int source, + int tag, MPI_Comm comm, MPI_Request *request); +OMPI_DECLSPEC int MPI_Recv(void *buf, int count, MPI_Datatype datatype, int source, + int tag, MPI_Comm comm, MPI_Status *status); +OMPI_DECLSPEC int MPI_Reduce(void *sendbuf, void *recvbuf, int count, + MPI_Datatype datatype, MPI_Op op, int root, MPI_Comm comm); +OMPI_DECLSPEC int MPI_Reduce_scatter(void *sendbuf, void *recvbuf, int *recvcounts, + MPI_Datatype datatype, MPI_Op op, MPI_Comm comm); +OMPI_DECLSPEC int MPI_Register_datarep(char *datarep, + MPI_Datarep_conversion_function *read_conversion_fn, + MPI_Datarep_conversion_function *write_conversion_fn, + MPI_Datarep_extent_function *dtype_file_extent_fn, + void *extra_state); +OMPI_DECLSPEC MPI_Fint MPI_Request_c2f(MPI_Request request); +OMPI_DECLSPEC MPI_Request MPI_Request_f2c(MPI_Fint request); +OMPI_DECLSPEC int MPI_Request_free(MPI_Request *request); +OMPI_DECLSPEC int MPI_Request_get_status(MPI_Request request, int *flag, + MPI_Status *status); +OMPI_DECLSPEC int MPI_Rsend(void *ibuf, int count, MPI_Datatype datatype, int dest, + int tag, MPI_Comm comm); +OMPI_DECLSPEC int MPI_Rsend_init(void *buf, int count, MPI_Datatype datatype, + int dest, int tag, MPI_Comm comm, + MPI_Request *request); +OMPI_DECLSPEC int MPI_Scan(void *sendbuf, void *recvbuf, int count, + MPI_Datatype datatype, MPI_Op op, MPI_Comm comm); +OMPI_DECLSPEC int MPI_Scatter(void *sendbuf, int sendcount, MPI_Datatype sendtype, + void *recvbuf, int recvcount, MPI_Datatype recvtype, + int root, MPI_Comm comm); +OMPI_DECLSPEC int MPI_Scatterv(void *sendbuf, int *sendcounts, int *displs, + MPI_Datatype sendtype, void *recvbuf, int recvcount, + MPI_Datatype recvtype, int root, MPI_Comm comm); +OMPI_DECLSPEC int MPI_Send_init(void *buf, int count, MPI_Datatype datatype, + int dest, int tag, MPI_Comm comm, + MPI_Request *request); +OMPI_DECLSPEC int MPI_Send(void *buf, int count, MPI_Datatype datatype, int dest, + int tag, MPI_Comm comm); +OMPI_DECLSPEC int MPI_Sendrecv(void *sendbuf, int sendcount, MPI_Datatype sendtype, + int dest, int sendtag, void *recvbuf, int recvcount, + MPI_Datatype recvtype, int source, int recvtag, + MPI_Comm comm, MPI_Status *status); +OMPI_DECLSPEC int MPI_Sendrecv_replace(void * buf, int count, MPI_Datatype datatype, + int dest, int sendtag, int source, int recvtag, + MPI_Comm comm, MPI_Status *status); +OMPI_DECLSPEC int MPI_Ssend_init(void *buf, int count, MPI_Datatype datatype, + int dest, int tag, MPI_Comm comm, + MPI_Request *request); +OMPI_DECLSPEC int MPI_Ssend(void *buf, int count, MPI_Datatype datatype, int dest, + int tag, MPI_Comm comm); +OMPI_DECLSPEC int MPI_Start(MPI_Request *request); +OMPI_DECLSPEC int MPI_Startall(int count, MPI_Request *array_of_requests); +OMPI_DECLSPEC int MPI_Status_c2f(MPI_Status *c_status, MPI_Fint *f_status); +OMPI_DECLSPEC int MPI_Status_f2c(MPI_Fint *f_status, MPI_Status *c_status); +OMPI_DECLSPEC int MPI_Status_set_cancelled(MPI_Status *status, int flag); +OMPI_DECLSPEC int MPI_Status_set_elements(MPI_Status *status, MPI_Datatype datatype, + int count); +OMPI_DECLSPEC int MPI_Testall(int count, MPI_Request array_of_requests[], int *flag, + MPI_Status array_of_statuses[]); +OMPI_DECLSPEC int MPI_Testany(int count, MPI_Request array_of_requests[], int *index, + int *flag, MPI_Status *status); +OMPI_DECLSPEC int MPI_Test(MPI_Request *request, int *flag, MPI_Status *status); +OMPI_DECLSPEC int MPI_Test_cancelled(MPI_Status *status, int *flag); +OMPI_DECLSPEC int MPI_Testsome(int incount, MPI_Request array_of_requests[], + int *outcount, int array_of_indices[], + MPI_Status array_of_statuses[]); +OMPI_DECLSPEC int MPI_Topo_test(MPI_Comm comm, int *status); +OMPI_DECLSPEC MPI_Fint MPI_Type_c2f(MPI_Datatype datatype); +OMPI_DECLSPEC int MPI_Type_commit(MPI_Datatype *type); +OMPI_DECLSPEC int MPI_Type_contiguous(int count, MPI_Datatype oldtype, + MPI_Datatype *newtype); +OMPI_DECLSPEC int MPI_Type_create_darray(int size, int rank, int ndims, + int gsize_array[], int distrib_array[], + int darg_array[], int psize_array[], + int order, MPI_Datatype oldtype, + MPI_Datatype *newtype); +OMPI_DECLSPEC int MPI_Type_create_f90_complex(int p, int r, MPI_Datatype *newtype); +OMPI_DECLSPEC int MPI_Type_create_f90_integer(int r, MPI_Datatype *newtype); +OMPI_DECLSPEC int MPI_Type_create_f90_real(int p, int r, MPI_Datatype *newtype); +OMPI_DECLSPEC int MPI_Type_create_hindexed(int count, int array_of_blocklengths[], + MPI_Aint array_of_displacements[], + MPI_Datatype oldtype, + MPI_Datatype *newtype); +OMPI_DECLSPEC int MPI_Type_create_hvector(int count, int blocklength, MPI_Aint stride, + MPI_Datatype oldtype, + MPI_Datatype *newtype); +OMPI_DECLSPEC int MPI_Type_create_keyval(MPI_Type_copy_attr_function *type_copy_attr_fn, + MPI_Type_delete_attr_function *type_delete_attr_fn, + int *type_keyval, void *extra_state); +OMPI_DECLSPEC int MPI_Type_create_indexed_block(int count, int blocklength, + int array_of_displacements[], + MPI_Datatype oldtype, + MPI_Datatype *newtype); +OMPI_DECLSPEC int MPI_Type_create_struct(int count, int array_of_block_lengths[], + MPI_Aint array_of_displacements[], + MPI_Datatype array_of_types[], + MPI_Datatype *newtype); +OMPI_DECLSPEC int MPI_Type_create_subarray(int ndims, int size_array[], int subsize_array[], + int start_array[], int order, + MPI_Datatype oldtype, MPI_Datatype *newtype); +OMPI_DECLSPEC int MPI_Type_create_resized(MPI_Datatype oldtype, MPI_Aint lb, + MPI_Aint extent, MPI_Datatype *newtype); +OMPI_DECLSPEC int MPI_Type_delete_attr(MPI_Datatype type, int type_keyval); +OMPI_DECLSPEC int MPI_Type_dup(MPI_Datatype type, MPI_Datatype *newtype); +OMPI_DECLSPEC int MPI_Type_extent(MPI_Datatype type, MPI_Aint *extent); +OMPI_DECLSPEC int MPI_Type_free(MPI_Datatype *type); +OMPI_DECLSPEC int MPI_Type_free_keyval(int *type_keyval); +OMPI_DECLSPEC MPI_Datatype MPI_Type_f2c(MPI_Fint datatype); +OMPI_DECLSPEC int MPI_Type_get_attr(MPI_Datatype type, int type_keyval, + void *attribute_val, int *flag); +OMPI_DECLSPEC int MPI_Type_get_contents(MPI_Datatype mtype, int max_integers, + int max_addresses, int max_datatypes, + int array_of_integers[], + MPI_Aint array_of_addresses[], + MPI_Datatype array_of_datatypes[]); +OMPI_DECLSPEC int MPI_Type_get_envelope(MPI_Datatype type, int *num_integers, + int *num_addresses, int *num_datatypes, + int *combiner); +OMPI_DECLSPEC int MPI_Type_get_extent(MPI_Datatype type, MPI_Aint *lb, + MPI_Aint *extent); +OMPI_DECLSPEC int MPI_Type_get_name(MPI_Datatype type, char *type_name, + int *resultlen); +OMPI_DECLSPEC int MPI_Type_get_true_extent(MPI_Datatype datatype, MPI_Aint *true_lb, + MPI_Aint *true_extent); +OMPI_DECLSPEC int MPI_Type_hindexed(int count, int array_of_blocklengths[], + MPI_Aint array_of_displacements[], + MPI_Datatype oldtype, MPI_Datatype *newtype); +OMPI_DECLSPEC int MPI_Type_hvector(int count, int blocklength, MPI_Aint stride, + MPI_Datatype oldtype, MPI_Datatype *newtype); +OMPI_DECLSPEC int MPI_Type_indexed(int count, int array_of_blocklengths[], + int array_of_displacements[], + MPI_Datatype oldtype, MPI_Datatype *newtype); +OMPI_DECLSPEC int MPI_Type_lb(MPI_Datatype type, MPI_Aint *lb); +OMPI_DECLSPEC int MPI_Type_match_size(int typeclass, int size, MPI_Datatype *type); +OMPI_DECLSPEC int MPI_Type_set_attr(MPI_Datatype type, int type_keyval, + void *attr_val); +OMPI_DECLSPEC int MPI_Type_set_name(MPI_Datatype type, char *type_name); +OMPI_DECLSPEC int MPI_Type_size(MPI_Datatype type, int *size); +OMPI_DECLSPEC int MPI_Type_struct(int count, int array_of_blocklengths[], + MPI_Aint array_of_displacements[], + MPI_Datatype array_of_types[], + MPI_Datatype *newtype); +OMPI_DECLSPEC int MPI_Type_ub(MPI_Datatype mtype, MPI_Aint *ub); +OMPI_DECLSPEC int MPI_Type_vector(int count, int blocklength, int stride, + MPI_Datatype oldtype, MPI_Datatype *newtype); +OMPI_DECLSPEC int MPI_Unpack(void *inbuf, int insize, int *position, + void *outbuf, int outcount, MPI_Datatype datatype, + MPI_Comm comm); +OMPI_DECLSPEC int MPI_Unpublish_name(char *service_name, MPI_Info info, char *port_name); +OMPI_DECLSPEC int MPI_Unpack_external (char *datarep, void *inbuf, MPI_Aint insize, + MPI_Aint *position, void *outbuf, int outcount, + MPI_Datatype datatype); +OMPI_DECLSPEC int MPI_Waitall(int count, MPI_Request *array_of_requests, + MPI_Status *array_of_statuses); +OMPI_DECLSPEC int MPI_Waitany(int count, MPI_Request *array_of_requests, + int *index, MPI_Status *status); +OMPI_DECLSPEC int MPI_Wait(MPI_Request *request, MPI_Status *status); +OMPI_DECLSPEC int MPI_Waitsome(int incount, MPI_Request *array_of_requests, + int *outcount, int *array_of_indices, + MPI_Status *array_of_statuses); +OMPI_DECLSPEC MPI_Fint MPI_Win_c2f(MPI_Win win); +OMPI_DECLSPEC int MPI_Win_call_errhandler(MPI_Win win, int errorcode); +OMPI_DECLSPEC int MPI_Win_complete(MPI_Win win); +OMPI_DECLSPEC int MPI_Win_create(void *base, MPI_Aint size, int disp_unit, + MPI_Info info, MPI_Comm comm, MPI_Win *win); +OMPI_DECLSPEC int MPI_Win_create_errhandler(MPI_Win_errhandler_fn *function, + MPI_Errhandler *errhandler); +OMPI_DECLSPEC int MPI_Win_create_keyval(MPI_Win_copy_attr_function *win_copy_attr_fn, + MPI_Win_delete_attr_function *win_delete_attr_fn, + int *win_keyval, void *extra_state); +OMPI_DECLSPEC int MPI_Win_delete_attr(MPI_Win win, int win_keyval); +OMPI_DECLSPEC MPI_Win MPI_Win_f2c(MPI_Fint win); +OMPI_DECLSPEC int MPI_Win_fence(int assert, MPI_Win win); +OMPI_DECLSPEC int MPI_Win_free(MPI_Win *win); +OMPI_DECLSPEC int MPI_Win_free_keyval(int *win_keyval); +OMPI_DECLSPEC int MPI_Win_get_attr(MPI_Win win, int win_keyval, + void *attribute_val, int *flag); +OMPI_DECLSPEC int MPI_Win_get_errhandler(MPI_Win win, MPI_Errhandler *errhandler); +OMPI_DECLSPEC int MPI_Win_get_group(MPI_Win win, MPI_Group *group); +OMPI_DECLSPEC int MPI_Win_get_name(MPI_Win win, char *win_name, int *resultlen); +OMPI_DECLSPEC int MPI_Win_lock(int lock_type, int rank, int assert, MPI_Win win); +OMPI_DECLSPEC int MPI_Win_post(MPI_Group group, int assert, MPI_Win win); +OMPI_DECLSPEC int MPI_Win_set_attr(MPI_Win win, int win_keyval, void *attribute_val); +OMPI_DECLSPEC int MPI_Win_set_errhandler(MPI_Win win, MPI_Errhandler errhandler); +OMPI_DECLSPEC int MPI_Win_set_name(MPI_Win win, char *win_name); +OMPI_DECLSPEC int MPI_Win_start(MPI_Group group, int assert, MPI_Win win); +OMPI_DECLSPEC int MPI_Win_test(MPI_Win win, int *flag); +OMPI_DECLSPEC int MPI_Win_unlock(int rank, MPI_Win win); +OMPI_DECLSPEC int MPI_Win_wait(MPI_Win win); +OMPI_DECLSPEC double MPI_Wtick(void); +OMPI_DECLSPEC double MPI_Wtime(void); + + + /* + * Profiling MPI API + */ +OMPI_DECLSPEC int PMPI_Abort(MPI_Comm comm, int errorcode); +OMPI_DECLSPEC int PMPI_Accumulate(void *origin_addr, int origin_count, MPI_Datatype origin_datatype, + int target_rank, MPI_Aint target_disp, int target_count, + MPI_Datatype target_datatype, MPI_Op op, MPI_Win win); +OMPI_DECLSPEC int PMPI_Add_error_class(int *errorclass); +OMPI_DECLSPEC int PMPI_Add_error_code(int errorclass, int *errorcode); +OMPI_DECLSPEC int PMPI_Add_error_string(int errorcode, char *string); +OMPI_DECLSPEC int PMPI_Address(void *location, MPI_Aint *address); +OMPI_DECLSPEC int PMPI_Allgather(void *sendbuf, int sendcount, MPI_Datatype sendtype, + void *recvbuf, int recvcount, + MPI_Datatype recvtype, MPI_Comm comm); +OMPI_DECLSPEC int PMPI_Allgatherv(void *sendbuf, int sendcount, MPI_Datatype sendtype, + void *recvbuf, int *recvcounts, + int *displs, MPI_Datatype recvtype, MPI_Comm comm); +OMPI_DECLSPEC int PMPI_Alloc_mem(MPI_Aint size, MPI_Info info, + void *baseptr); +OMPI_DECLSPEC int PMPI_Allreduce(void *sendbuf, void *recvbuf, int count, + MPI_Datatype datatype, MPI_Op op, MPI_Comm comm); +OMPI_DECLSPEC int PMPI_Alltoall(void *sendbuf, int sendcount, MPI_Datatype sendtype, + void *recvbuf, int recvcount, + MPI_Datatype recvtype, MPI_Comm comm); +OMPI_DECLSPEC int PMPI_Alltoallv(void *sendbuf, int *sendcounts, int *sdispls, + MPI_Datatype sendtype, void *recvbuf, int *recvcounts, + int *rdispls, MPI_Datatype recvtype, MPI_Comm comm); +OMPI_DECLSPEC int PMPI_Alltoallw(void *sendbuf, int *sendcounts, int *sdispls, MPI_Datatype *sendtypes, + void *recvbuf, int *recvcounts, int *rdispls, MPI_Datatype *recvtypes, + MPI_Comm comm); +OMPI_DECLSPEC int PMPI_Attr_delete(MPI_Comm comm, int keyval); +OMPI_DECLSPEC int PMPI_Attr_get(MPI_Comm comm, int keyval, void *attribute_val, int *flag); +OMPI_DECLSPEC int PMPI_Attr_put(MPI_Comm comm, int keyval, void *attribute_val); +OMPI_DECLSPEC int PMPI_Barrier(MPI_Comm comm); +OMPI_DECLSPEC int PMPI_Bcast(void *buffer, int count, MPI_Datatype datatype, + int root, MPI_Comm comm); +OMPI_DECLSPEC int PMPI_Bsend(void *buf, int count, MPI_Datatype datatype, + int dest, int tag, MPI_Comm comm); +OMPI_DECLSPEC int PMPI_Bsend_init(void *buf, int count, MPI_Datatype datatype, + int dest, int tag, MPI_Comm comm, MPI_Request *request); +OMPI_DECLSPEC int PMPI_Buffer_attach(void *buffer, int size); +OMPI_DECLSPEC int PMPI_Buffer_detach(void *buffer, int *size); +OMPI_DECLSPEC int PMPI_Cancel(MPI_Request *request); +OMPI_DECLSPEC int PMPI_Cart_coords(MPI_Comm comm, int rank, int maxdims, int *coords); +OMPI_DECLSPEC int PMPI_Cart_create(MPI_Comm old_comm, int ndims, int *dims, + int *periods, int reorder, MPI_Comm *comm_cart); +OMPI_DECLSPEC int PMPI_Cart_get(MPI_Comm comm, int maxdims, int *dims, + int *periods, int *coords); +OMPI_DECLSPEC int PMPI_Cart_map(MPI_Comm comm, int ndims, int *dims, + int *periods, int *newrank); +OMPI_DECLSPEC int PMPI_Cart_rank(MPI_Comm comm, int *coords, int *rank); +OMPI_DECLSPEC int PMPI_Cart_shift(MPI_Comm comm, int direction, int disp, + int *rank_source, int *rank_dest); +OMPI_DECLSPEC int PMPI_Cart_sub(MPI_Comm comm, int *remain_dims, MPI_Comm *new_comm); +OMPI_DECLSPEC int PMPI_Cartdim_get(MPI_Comm comm, int *ndims); +OMPI_DECLSPEC int PMPI_Close_port(char *port_name); +OMPI_DECLSPEC int PMPI_Comm_accept(char *port_name, MPI_Info info, int root, + MPI_Comm comm, MPI_Comm *newcomm); +OMPI_DECLSPEC MPI_Fint PMPI_Comm_c2f(MPI_Comm comm); +OMPI_DECLSPEC int PMPI_Comm_call_errhandler(MPI_Comm comm, int errorcode); +OMPI_DECLSPEC int PMPI_Comm_compare(MPI_Comm comm1, MPI_Comm comm2, int *result); +OMPI_DECLSPEC int PMPI_Comm_connect(char *port_name, MPI_Info info, int root, + MPI_Comm comm, MPI_Comm *newcomm); +OMPI_DECLSPEC int PMPI_Comm_create_errhandler(MPI_Comm_errhandler_fn *function, + MPI_Errhandler *errhandler); +OMPI_DECLSPEC int PMPI_Comm_create_keyval(MPI_Comm_copy_attr_function *comm_copy_attr_fn, + MPI_Comm_delete_attr_function *comm_delete_attr_fn, + int *comm_keyval, void *extra_state); +OMPI_DECLSPEC int PMPI_Comm_create(MPI_Comm comm, MPI_Group group, MPI_Comm *newcomm); +OMPI_DECLSPEC int PMPI_Comm_delete_attr(MPI_Comm comm, int comm_keyval); +OMPI_DECLSPEC int PMPI_Comm_disconnect(MPI_Comm *comm); +OMPI_DECLSPEC int PMPI_Comm_dup(MPI_Comm comm, MPI_Comm *newcomm); +OMPI_DECLSPEC MPI_Comm PMPI_Comm_f2c(MPI_Fint comm); +OMPI_DECLSPEC int PMPI_Comm_free_keyval(int *comm_keyval); +OMPI_DECLSPEC int PMPI_Comm_free(MPI_Comm *comm); +OMPI_DECLSPEC int PMPI_Comm_get_attr(MPI_Comm comm, int comm_keyval, + void *attribute_val, int *flag); +OMPI_DECLSPEC int PMPI_Comm_get_errhandler(MPI_Comm comm, MPI_Errhandler *erhandler); +OMPI_DECLSPEC int PMPI_Comm_get_name(MPI_Comm comm, char *comm_name, int *resultlen); +OMPI_DECLSPEC int PMPI_Comm_get_parent(MPI_Comm *parent); +OMPI_DECLSPEC int PMPI_Comm_group(MPI_Comm comm, MPI_Group *group); +OMPI_DECLSPEC int PMPI_Comm_join(int fd, MPI_Comm *intercomm); +OMPI_DECLSPEC int PMPI_Comm_rank(MPI_Comm comm, int *rank); +OMPI_DECLSPEC int PMPI_Comm_remote_group(MPI_Comm comm, MPI_Group *group); +OMPI_DECLSPEC int PMPI_Comm_remote_size(MPI_Comm comm, int *size); +OMPI_DECLSPEC int PMPI_Comm_set_attr(MPI_Comm comm, int comm_keyval, void *attribute_val); +OMPI_DECLSPEC int PMPI_Comm_set_errhandler(MPI_Comm comm, MPI_Errhandler errhandler); +OMPI_DECLSPEC int PMPI_Comm_set_name(MPI_Comm comm, char *comm_name); +OMPI_DECLSPEC int PMPI_Comm_size(MPI_Comm comm, int *size); +OMPI_DECLSPEC int PMPI_Comm_spawn(char *command, char **argv, int maxprocs, MPI_Info info, + int root, MPI_Comm comm, MPI_Comm *intercomm, + int *array_of_errcodes); +OMPI_DECLSPEC int PMPI_Comm_spawn_multiple(int count, char **array_of_commands, char ***array_of_argv, + int *array_of_maxprocs, MPI_Info *array_of_info, + int root, MPI_Comm comm, MPI_Comm *intercomm, + int *array_of_errcodes); +OMPI_DECLSPEC int PMPI_Comm_split(MPI_Comm comm, int color, int key, MPI_Comm *newcomm); +OMPI_DECLSPEC int PMPI_Comm_test_inter(MPI_Comm comm, int *flag); +OMPI_DECLSPEC int PMPI_Dims_create(int nnodes, int ndims, int *dims); +OMPI_DECLSPEC MPI_Fint PMPI_Errhandler_c2f(MPI_Errhandler errhandler); +OMPI_DECLSPEC int PMPI_Errhandler_create(MPI_Handler_function *function, + MPI_Errhandler *errhandler); +OMPI_DECLSPEC MPI_Errhandler PMPI_Errhandler_f2c(MPI_Fint errhandler); +OMPI_DECLSPEC int PMPI_Errhandler_free(MPI_Errhandler *errhandler); +OMPI_DECLSPEC int PMPI_Errhandler_get(MPI_Comm comm, MPI_Errhandler *errhandler); +OMPI_DECLSPEC int PMPI_Errhandler_set(MPI_Comm comm, MPI_Errhandler errhandler); +OMPI_DECLSPEC int PMPI_Error_class(int errorcode, int *errorclass); +OMPI_DECLSPEC int PMPI_Error_string(int errorcode, char *string, int *resultlen); +OMPI_DECLSPEC int PMPI_Exscan(void *sendbuf, void *recvbuf, int count, + MPI_Datatype datatype, MPI_Op op, MPI_Comm comm); +OMPI_DECLSPEC MPI_Fint PMPI_File_c2f(MPI_File file); +OMPI_DECLSPEC MPI_File PMPI_File_f2c(MPI_Fint file); +OMPI_DECLSPEC int PMPI_File_call_errhandler(MPI_File fh, int errorcode); +OMPI_DECLSPEC int PMPI_File_create_errhandler(MPI_File_errhandler_fn *function, + MPI_Errhandler *errhandler); +OMPI_DECLSPEC int PMPI_File_set_errhandler( MPI_File file, MPI_Errhandler errhandler); +OMPI_DECLSPEC int PMPI_File_get_errhandler( MPI_File file, MPI_Errhandler *errhandler); +OMPI_DECLSPEC int PMPI_File_open(MPI_Comm comm, char *filename, int amode, + MPI_Info info, MPI_File *fh); +OMPI_DECLSPEC int PMPI_File_close(MPI_File *fh); +OMPI_DECLSPEC int PMPI_File_delete(char *filename, MPI_Info info); +OMPI_DECLSPEC int PMPI_File_set_size(MPI_File fh, MPI_Offset size); +OMPI_DECLSPEC int PMPI_File_preallocate(MPI_File fh, MPI_Offset size); +OMPI_DECLSPEC int PMPI_File_get_size(MPI_File fh, MPI_Offset *size); +OMPI_DECLSPEC int PMPI_File_get_group(MPI_File fh, MPI_Group *group); +OMPI_DECLSPEC int PMPI_File_get_amode(MPI_File fh, int *amode); +OMPI_DECLSPEC int PMPI_File_set_info(MPI_File fh, MPI_Info info); +OMPI_DECLSPEC int PMPI_File_get_info(MPI_File fh, MPI_Info *info_used); +OMPI_DECLSPEC int PMPI_File_set_view(MPI_File fh, MPI_Offset disp, MPI_Datatype etype, + MPI_Datatype filetype, char *datarep, MPI_Info info); +OMPI_DECLSPEC int PMPI_File_get_view(MPI_File fh, MPI_Offset *disp, + MPI_Datatype *etype, + MPI_Datatype *filetype, char *datarep); +OMPI_DECLSPEC int PMPI_File_read_at(MPI_File fh, MPI_Offset offset, void *buf, + int count, MPI_Datatype datatype, MPI_Status *status); +OMPI_DECLSPEC int PMPI_File_read_at_all(MPI_File fh, MPI_Offset offset, void *buf, + int count, MPI_Datatype datatype, MPI_Status *status); +OMPI_DECLSPEC int PMPI_File_write_at(MPI_File fh, MPI_Offset offset, void *buf, + int count, MPI_Datatype datatype, MPI_Status *status); +OMPI_DECLSPEC int PMPI_File_write_at_all(MPI_File fh, MPI_Offset offset, void *buf, + int count, MPI_Datatype datatype, MPI_Status *status); +OMPI_DECLSPEC int PMPI_File_iread_at(MPI_File fh, MPI_Offset offset, void *buf, + int count, MPI_Datatype datatype, MPI_Request *request); +OMPI_DECLSPEC int PMPI_File_iwrite_at(MPI_File fh, MPI_Offset offset, void *buf, + int count, MPI_Datatype datatype, MPI_Request *request); +OMPI_DECLSPEC int PMPI_File_read(MPI_File fh, void *buf, int count, + MPI_Datatype datatype, MPI_Status *status); +OMPI_DECLSPEC int PMPI_File_read_all(MPI_File fh, void *buf, int count, + MPI_Datatype datatype, MPI_Status *status); +OMPI_DECLSPEC int PMPI_File_write(MPI_File fh, void *buf, int count, + MPI_Datatype datatype, MPI_Status *status); +OMPI_DECLSPEC int PMPI_File_write_all(MPI_File fh, void *buf, int count, + MPI_Datatype datatype, MPI_Status *status); +OMPI_DECLSPEC int PMPI_File_iread(MPI_File fh, void *buf, int count, + MPI_Datatype datatype, MPI_Request *request); +OMPI_DECLSPEC int PMPI_File_iwrite(MPI_File fh, void *buf, int count, + MPI_Datatype datatype, MPI_Request *request); +OMPI_DECLSPEC int PMPI_File_seek(MPI_File fh, MPI_Offset offset, int whence); +OMPI_DECLSPEC int PMPI_File_get_position(MPI_File fh, MPI_Offset *offset); +OMPI_DECLSPEC int PMPI_File_get_byte_offset(MPI_File fh, MPI_Offset offset, + MPI_Offset *disp); +OMPI_DECLSPEC int PMPI_File_read_shared(MPI_File fh, void *buf, int count, + MPI_Datatype datatype, MPI_Status *status); +OMPI_DECLSPEC int PMPI_File_write_shared(MPI_File fh, void *buf, int count, + MPI_Datatype datatype, MPI_Status *status); +OMPI_DECLSPEC int PMPI_File_iread_shared(MPI_File fh, void *buf, int count, + MPI_Datatype datatype, MPI_Request *request); +OMPI_DECLSPEC int PMPI_File_iwrite_shared(MPI_File fh, void *buf, int count, + MPI_Datatype datatype, MPI_Request *request); +OMPI_DECLSPEC int PMPI_File_read_ordered(MPI_File fh, void *buf, int count, + MPI_Datatype datatype, MPI_Status *status); +OMPI_DECLSPEC int PMPI_File_write_ordered(MPI_File fh, void *buf, int count, + MPI_Datatype datatype, MPI_Status *status); +OMPI_DECLSPEC int PMPI_File_seek_shared(MPI_File fh, MPI_Offset offset, int whence); +OMPI_DECLSPEC int PMPI_File_get_position_shared(MPI_File fh, MPI_Offset *offset); +OMPI_DECLSPEC int PMPI_File_read_at_all_begin(MPI_File fh, MPI_Offset offset, void *buf, + int count, MPI_Datatype datatype); +OMPI_DECLSPEC int PMPI_File_read_at_all_end(MPI_File fh, void *buf, MPI_Status *status); +OMPI_DECLSPEC int PMPI_File_write_at_all_begin(MPI_File fh, MPI_Offset offset, void *buf, + int count, MPI_Datatype datatype); +OMPI_DECLSPEC int PMPI_File_write_at_all_end(MPI_File fh, void *buf, MPI_Status *status); +OMPI_DECLSPEC int PMPI_File_read_all_begin(MPI_File fh, void *buf, int count, + MPI_Datatype datatype); +OMPI_DECLSPEC int PMPI_File_read_all_end(MPI_File fh, void *buf, MPI_Status *status); +OMPI_DECLSPEC int PMPI_File_write_all_begin(MPI_File fh, void *buf, int count, + MPI_Datatype datatype); +OMPI_DECLSPEC int PMPI_File_write_all_end(MPI_File fh, void *buf, MPI_Status *status); +OMPI_DECLSPEC int PMPI_File_read_ordered_begin(MPI_File fh, void *buf, int count, + MPI_Datatype datatype); +OMPI_DECLSPEC int PMPI_File_read_ordered_end(MPI_File fh, void *buf, MPI_Status *status); +OMPI_DECLSPEC int PMPI_File_write_ordered_begin(MPI_File fh, void *buf, int count, + MPI_Datatype datatype); +OMPI_DECLSPEC int PMPI_File_write_ordered_end(MPI_File fh, void *buf, MPI_Status *status); +OMPI_DECLSPEC int PMPI_File_get_type_extent(MPI_File fh, MPI_Datatype datatype, + MPI_Aint *extent); +OMPI_DECLSPEC int PMPI_File_set_atomicity(MPI_File fh, int flag); +OMPI_DECLSPEC int PMPI_File_get_atomicity(MPI_File fh, int *flag); +OMPI_DECLSPEC int PMPI_File_sync(MPI_File fh); +OMPI_DECLSPEC int PMPI_Finalize(void); +OMPI_DECLSPEC int PMPI_Finalized(int *flag); +OMPI_DECLSPEC int PMPI_Free_mem(void *base); +OMPI_DECLSPEC int PMPI_Gather(void *sendbuf, int sendcount, MPI_Datatype sendtype, + void *recvbuf, int recvcount, MPI_Datatype recvtype, + int root, MPI_Comm comm); +OMPI_DECLSPEC int PMPI_Gatherv(void *sendbuf, int sendcount, MPI_Datatype sendtype, + void *recvbuf, int *recvcounts, int *displs, + MPI_Datatype recvtype, int root, MPI_Comm comm); +OMPI_DECLSPEC int PMPI_Get_address(void *location, MPI_Aint *address); +OMPI_DECLSPEC int PMPI_Get_count(MPI_Status *status, MPI_Datatype datatype, int *count); +OMPI_DECLSPEC int PMPI_Get_elements(MPI_Status *status, MPI_Datatype datatype, + int *count); +OMPI_DECLSPEC int PMPI_Get(void *origin_addr, int origin_count, + MPI_Datatype origin_datatype, int target_rank, + MPI_Aint target_disp, int target_count, + MPI_Datatype target_datatype, MPI_Win win); +OMPI_DECLSPEC int PMPI_Get_processor_name(char *name, int *resultlen); +OMPI_DECLSPEC int PMPI_Get_version(int *version, int *subversion); +OMPI_DECLSPEC int PMPI_Graph_create(MPI_Comm comm_old, int nnodes, int *index, + int *edges, int reorder, MPI_Comm *comm_graph); +OMPI_DECLSPEC int PMPI_Graph_get(MPI_Comm comm, int maxindex, int maxedges, + int *index, int *edges); +OMPI_DECLSPEC int PMPI_Graph_map(MPI_Comm comm, int nnodes, int *index, int *edges, + int *newrank); +OMPI_DECLSPEC int PMPI_Graph_neighbors_count(MPI_Comm comm, int rank, int *nneighbors); +OMPI_DECLSPEC int PMPI_Graph_neighbors(MPI_Comm comm, int rank, int maxneighbors, + int *neighbors); +OMPI_DECLSPEC int PMPI_Graphdims_get(MPI_Comm comm, int *nnodes, int *nedges); +OMPI_DECLSPEC int PMPI_Grequest_complete(MPI_Request request); +OMPI_DECLSPEC int PMPI_Grequest_start(MPI_Grequest_query_function *query_fn, + MPI_Grequest_free_function *free_fn, + MPI_Grequest_cancel_function *cancel_fn, + void *extra_state, MPI_Request *request); +OMPI_DECLSPEC MPI_Fint PMPI_Group_c2f(MPI_Group group); +OMPI_DECLSPEC int PMPI_Group_compare(MPI_Group group1, MPI_Group group2, int *result); +OMPI_DECLSPEC int PMPI_Group_difference(MPI_Group group1, MPI_Group group2, + MPI_Group *newgroup); +OMPI_DECLSPEC int PMPI_Group_excl(MPI_Group group, int n, int *ranks, + MPI_Group *newgroup); +OMPI_DECLSPEC MPI_Group PMPI_Group_f2c(MPI_Fint group); +OMPI_DECLSPEC int PMPI_Group_free(MPI_Group *group); +OMPI_DECLSPEC int PMPI_Group_incl(MPI_Group group, int n, int *ranks, + MPI_Group *newgroup); +OMPI_DECLSPEC int PMPI_Group_intersection(MPI_Group group1, MPI_Group group2, + MPI_Group *newgroup); +OMPI_DECLSPEC int PMPI_Group_range_excl(MPI_Group group, int n, int ranges[][3], + MPI_Group *newgroup); +OMPI_DECLSPEC int PMPI_Group_range_incl(MPI_Group group, int n, int ranges[][3], + MPI_Group *newgroup); +OMPI_DECLSPEC int PMPI_Group_rank(MPI_Group group, int *rank); +OMPI_DECLSPEC int PMPI_Group_size(MPI_Group group, int *size); +OMPI_DECLSPEC int PMPI_Group_translate_ranks(MPI_Group group1, int n, int *ranks1, + MPI_Group group2, int *ranks2); +OMPI_DECLSPEC int PMPI_Group_union(MPI_Group group1, MPI_Group group2, + MPI_Group *newgroup); +OMPI_DECLSPEC int PMPI_Ibsend(void *buf, int count, MPI_Datatype datatype, int dest, + int tag, MPI_Comm comm, MPI_Request *request); +OMPI_DECLSPEC MPI_Fint PMPI_Info_c2f(MPI_Info info); +OMPI_DECLSPEC int PMPI_Info_create(MPI_Info *info); +OMPI_DECLSPEC int PMPI_Info_delete(MPI_Info info, char *key); +OMPI_DECLSPEC int PMPI_Info_dup(MPI_Info info, MPI_Info *newinfo); +OMPI_DECLSPEC MPI_Info PMPI_Info_f2c(MPI_Fint info); +OMPI_DECLSPEC int PMPI_Info_free(MPI_Info *info); +OMPI_DECLSPEC int PMPI_Info_get(MPI_Info info, char *key, int valuelen, + char *value, int *flag); +OMPI_DECLSPEC int PMPI_Info_get_nkeys(MPI_Info info, int *nkeys); +OMPI_DECLSPEC int PMPI_Info_get_nthkey(MPI_Info info, int n, char *key); +OMPI_DECLSPEC int PMPI_Info_get_valuelen(MPI_Info info, char *key, int *valuelen, + int *flag); +OMPI_DECLSPEC int PMPI_Info_set(MPI_Info info, char *key, char *value); +OMPI_DECLSPEC int PMPI_Init(int *argc, char ***argv); +OMPI_DECLSPEC int PMPI_Initialized(int *flag); +OMPI_DECLSPEC int PMPI_Init_thread(int *argc, char ***argv, int required, + int *provided); +OMPI_DECLSPEC int PMPI_Intercomm_create(MPI_Comm local_comm, int local_leader, + MPI_Comm bridge_comm, int remote_leader, + int tag, MPI_Comm *newintercomm); +OMPI_DECLSPEC int PMPI_Intercomm_merge(MPI_Comm intercomm, int high, + MPI_Comm *newintercomm); +OMPI_DECLSPEC int PMPI_Iprobe(int source, int tag, MPI_Comm comm, int *flag, + MPI_Status *status); +OMPI_DECLSPEC int PMPI_Irecv(void *buf, int count, MPI_Datatype datatype, int source, + int tag, MPI_Comm comm, MPI_Request *request); +OMPI_DECLSPEC int PMPI_Irsend(void *buf, int count, MPI_Datatype datatype, int dest, + int tag, MPI_Comm comm, MPI_Request *request); +OMPI_DECLSPEC int PMPI_Isend(void *buf, int count, MPI_Datatype datatype, int dest, + int tag, MPI_Comm comm, MPI_Request *request); +OMPI_DECLSPEC int PMPI_Issend(void *buf, int count, MPI_Datatype datatype, int dest, + int tag, MPI_Comm comm, MPI_Request *request); +OMPI_DECLSPEC int PMPI_Is_thread_main(int *flag); +OMPI_DECLSPEC int PMPI_Keyval_create(MPI_Copy_function *copy_fn, + MPI_Delete_function *delete_fn, + int *keyval, void *extra_state); +OMPI_DECLSPEC int PMPI_Keyval_free(int *keyval); +OMPI_DECLSPEC int PMPI_Lookup_name(char *service_name, MPI_Info info, char *port_name); +OMPI_DECLSPEC MPI_Fint PMPI_Op_c2f(MPI_Op op); +OMPI_DECLSPEC int PMPI_Op_create(MPI_User_function *function, int commute, + MPI_Op *op); +OMPI_DECLSPEC int PMPI_Open_port(MPI_Info info, char *port_name); +OMPI_DECLSPEC MPI_Op PMPI_Op_f2c(MPI_Fint op); +OMPI_DECLSPEC int PMPI_Op_free(MPI_Op *op); +OMPI_DECLSPEC int PMPI_Pack_external(char *datarep, void *inbuf, int incount, + MPI_Datatype datatype, void *outbuf, + MPI_Aint outsize, MPI_Aint *position); +OMPI_DECLSPEC int PMPI_Pack_external_size(char *datarep, int incount, + MPI_Datatype datatype, MPI_Aint *size); +OMPI_DECLSPEC int PMPI_Pack(void *inbuf, int incount, MPI_Datatype datatype, + void *outbuf, int outsize, int *position, MPI_Comm comm); +OMPI_DECLSPEC int PMPI_Pack_size(int incount, MPI_Datatype datatype, MPI_Comm comm, + int *size); +OMPI_DECLSPEC int PMPI_Pcontrol(const int level, ...); +OMPI_DECLSPEC int PMPI_Probe(int source, int tag, MPI_Comm comm, MPI_Status *status); +OMPI_DECLSPEC int PMPI_Publish_name(char *service_name, MPI_Info info, + char *port_name); +OMPI_DECLSPEC int PMPI_Put(void *origin_addr, int origin_count, MPI_Datatype origin_datatype, + int target_rank, MPI_Aint target_disp, int target_count, + MPI_Datatype target_datatype, MPI_Win win); +OMPI_DECLSPEC int PMPI_Query_thread(int *provided); +OMPI_DECLSPEC int PMPI_Recv_init(void *buf, int count, MPI_Datatype datatype, int source, + int tag, MPI_Comm comm, MPI_Request *request); +OMPI_DECLSPEC int PMPI_Recv(void *buf, int count, MPI_Datatype datatype, int source, + int tag, MPI_Comm comm, MPI_Status *status); +OMPI_DECLSPEC int PMPI_Reduce(void *sendbuf, void *recvbuf, int count, + MPI_Datatype datatype, MPI_Op op, int root, MPI_Comm comm); +OMPI_DECLSPEC int PMPI_Reduce_scatter(void *sendbuf, void *recvbuf, int *recvcounts, + MPI_Datatype datatype, MPI_Op op, MPI_Comm comm); +OMPI_DECLSPEC int PMPI_Register_datarep(char *datarep, + MPI_Datarep_conversion_function *read_conversion_fn, + MPI_Datarep_conversion_function *write_conversion_fn, + MPI_Datarep_extent_function *dtype_file_extent_fn, + void *extra_state); +OMPI_DECLSPEC MPI_Fint PMPI_Request_c2f(MPI_Request request); +OMPI_DECLSPEC MPI_Request PMPI_Request_f2c(MPI_Fint request); +OMPI_DECLSPEC int PMPI_Request_free(MPI_Request *request); +OMPI_DECLSPEC int PMPI_Request_get_status(MPI_Request request, int *flag, + MPI_Status *status); +OMPI_DECLSPEC int PMPI_Rsend(void *ibuf, int count, MPI_Datatype datatype, int dest, + int tag, MPI_Comm comm); +OMPI_DECLSPEC int PMPI_Rsend_init(void *buf, int count, MPI_Datatype datatype, + int dest, int tag, MPI_Comm comm, + MPI_Request *request); +OMPI_DECLSPEC int PMPI_Scan(void *sendbuf, void *recvbuf, int count, + MPI_Datatype datatype, MPI_Op op, MPI_Comm comm); +OMPI_DECLSPEC int PMPI_Scatter(void *sendbuf, int sendcount, MPI_Datatype sendtype, + void *recvbuf, int recvcount, MPI_Datatype recvtype, + int root, MPI_Comm comm); +OMPI_DECLSPEC int PMPI_Scatterv(void *sendbuf, int *sendcounts, int *displs, + MPI_Datatype sendtype, void *recvbuf, int recvcount, + MPI_Datatype recvtype, int root, MPI_Comm comm); +OMPI_DECLSPEC int PMPI_Send_init(void *buf, int count, MPI_Datatype datatype, + int dest, int tag, MPI_Comm comm, + MPI_Request *request); +OMPI_DECLSPEC int PMPI_Send(void *buf, int count, MPI_Datatype datatype, int dest, + int tag, MPI_Comm comm); +OMPI_DECLSPEC int PMPI_Sendrecv(void *sendbuf, int sendcount, MPI_Datatype sendtype, + int dest, int sendtag, void *recvbuf, int recvcount, + MPI_Datatype recvtype, int source, int recvtag, + MPI_Comm comm, MPI_Status *status); +OMPI_DECLSPEC int PMPI_Sendrecv_replace(void * buf, int count, MPI_Datatype datatype, + int dest, int sendtag, int source, int recvtag, + MPI_Comm comm, MPI_Status *status); +OMPI_DECLSPEC int PMPI_Ssend_init(void *buf, int count, MPI_Datatype datatype, + int dest, int tag, MPI_Comm comm, + MPI_Request *request); +OMPI_DECLSPEC int PMPI_Ssend(void *buf, int count, MPI_Datatype datatype, int dest, + int tag, MPI_Comm comm); +OMPI_DECLSPEC int PMPI_Start(MPI_Request *request); +OMPI_DECLSPEC int PMPI_Startall(int count, MPI_Request *array_of_requests); +OMPI_DECLSPEC int PMPI_Status_c2f(MPI_Status *c_status, MPI_Fint *f_status); +OMPI_DECLSPEC int PMPI_Status_f2c(MPI_Fint *f_status, MPI_Status *c_status); +OMPI_DECLSPEC int PMPI_Status_set_cancelled(MPI_Status *status, int flag); +OMPI_DECLSPEC int PMPI_Status_set_elements(MPI_Status *status, MPI_Datatype datatype, + int count); +OMPI_DECLSPEC int PMPI_Testall(int count, MPI_Request array_of_requests[], int *flag, + MPI_Status array_of_statuses[]); +OMPI_DECLSPEC int PMPI_Testany(int count, MPI_Request array_of_requests[], int *index, int *flag, MPI_Status *status); +OMPI_DECLSPEC int PMPI_Test(MPI_Request *request, int *flag, MPI_Status *status); +OMPI_DECLSPEC int PMPI_Test_cancelled(MPI_Status *status, int *flag); +OMPI_DECLSPEC int PMPI_Testsome(int incount, MPI_Request array_of_requests[], + int *outcount, int array_of_indices[], + MPI_Status array_of_statuses[]); +OMPI_DECLSPEC int PMPI_Topo_test(MPI_Comm comm, int *status); +OMPI_DECLSPEC MPI_Fint PMPI_Type_c2f(MPI_Datatype datatype); +OMPI_DECLSPEC int PMPI_Type_commit(MPI_Datatype *type); +OMPI_DECLSPEC int PMPI_Type_contiguous(int count, MPI_Datatype oldtype, + MPI_Datatype *newtype); +OMPI_DECLSPEC int PMPI_Type_create_darray(int size, int rank, int ndims, + int gsize_array[], int distrib_array[], + int darg_array[], int psize_array[], + int order, MPI_Datatype oldtype, + MPI_Datatype *newtype); +OMPI_DECLSPEC int PMPI_Type_create_f90_complex(int p, int r, MPI_Datatype *newtype); +OMPI_DECLSPEC int PMPI_Type_create_f90_integer(int r, MPI_Datatype *newtype); +OMPI_DECLSPEC int PMPI_Type_create_f90_real(int p, int r, MPI_Datatype *newtype); +OMPI_DECLSPEC int PMPI_Type_create_hindexed(int count, int array_of_blocklengths[], + MPI_Aint array_of_displacements[], + MPI_Datatype oldtype, + MPI_Datatype *newtype); +OMPI_DECLSPEC int PMPI_Type_create_hvector(int count, int blocklength, MPI_Aint stride, + MPI_Datatype oldtype, + MPI_Datatype *newtype); +OMPI_DECLSPEC int PMPI_Type_create_keyval(MPI_Type_copy_attr_function *type_copy_attr_fn, + MPI_Type_delete_attr_function *type_delete_attr_fn, + int *type_keyval, void *extra_state); +OMPI_DECLSPEC int PMPI_Type_create_indexed_block(int count, int blocklength, + int array_of_displacements[], + MPI_Datatype oldtype, + MPI_Datatype *newtype); +OMPI_DECLSPEC int PMPI_Type_create_struct(int count, int array_of_block_lengths[], + MPI_Aint array_of_displacements[], + MPI_Datatype array_of_types[], + MPI_Datatype *newtype); +OMPI_DECLSPEC int PMPI_Type_create_subarray(int ndims, int size_array[], int subsize_array[], + int start_array[], int order, + MPI_Datatype oldtype, MPI_Datatype *newtype); +OMPI_DECLSPEC int PMPI_Type_create_resized(MPI_Datatype oldtype, MPI_Aint lb, + MPI_Aint extent, MPI_Datatype *newtype); +OMPI_DECLSPEC int PMPI_Type_delete_attr(MPI_Datatype type, int type_keyval); +OMPI_DECLSPEC int PMPI_Type_dup(MPI_Datatype type, MPI_Datatype *newtype); +OMPI_DECLSPEC int PMPI_Type_extent(MPI_Datatype type, MPI_Aint *extent); +OMPI_DECLSPEC int PMPI_Type_free(MPI_Datatype *type); +OMPI_DECLSPEC int PMPI_Type_free_keyval(int *type_keyval); +OMPI_DECLSPEC MPI_Datatype PMPI_Type_f2c(MPI_Fint datatype); +OMPI_DECLSPEC int PMPI_Type_get_attr(MPI_Datatype type, int type_keyval, + void *attribute_val, int *flag); +OMPI_DECLSPEC int PMPI_Type_get_contents(MPI_Datatype mtype, int max_integers, + int max_addresses, int max_datatypes, + int array_of_integers[], + MPI_Aint array_of_addresses[], + MPI_Datatype array_of_datatypes[]); +OMPI_DECLSPEC int PMPI_Type_get_envelope(MPI_Datatype type, int *num_integers, + int *num_addresses, int *num_datatypes, + int *combiner); +OMPI_DECLSPEC int PMPI_Type_get_extent(MPI_Datatype type, MPI_Aint *lb, + MPI_Aint *extent); +OMPI_DECLSPEC int PMPI_Type_get_name(MPI_Datatype type, char *type_name, + int *resultlen); +OMPI_DECLSPEC int PMPI_Type_get_true_extent(MPI_Datatype datatype, MPI_Aint *true_lb, + MPI_Aint *true_extent); +OMPI_DECLSPEC int PMPI_Type_hindexed(int count, int array_of_blocklengths[], + MPI_Aint array_of_displacements[], + MPI_Datatype oldtype, MPI_Datatype *newtype); +OMPI_DECLSPEC int PMPI_Type_hvector(int count, int blocklength, MPI_Aint stride, + MPI_Datatype oldtype, MPI_Datatype *newtype); +OMPI_DECLSPEC int PMPI_Type_indexed(int count, int array_of_blocklengths[], + int array_of_displacements[], + MPI_Datatype oldtype, MPI_Datatype *newtype); +OMPI_DECLSPEC int PMPI_Type_lb(MPI_Datatype type, MPI_Aint *lb); +OMPI_DECLSPEC int PMPI_Type_match_size(int typeclass, int size, MPI_Datatype *type); +OMPI_DECLSPEC int PMPI_Type_set_attr(MPI_Datatype type, int type_keyval, + void *attr_val); +OMPI_DECLSPEC int PMPI_Type_set_name(MPI_Datatype type, char *type_name); +OMPI_DECLSPEC int PMPI_Type_size(MPI_Datatype type, int *size); +OMPI_DECLSPEC int PMPI_Type_struct(int count, int array_of_blocklengths[], + MPI_Aint array_of_displacements[], + MPI_Datatype array_of_types[], + MPI_Datatype *newtype); +OMPI_DECLSPEC int PMPI_Type_ub(MPI_Datatype mtype, MPI_Aint *ub); +OMPI_DECLSPEC int PMPI_Type_vector(int count, int blocklength, int stride, + MPI_Datatype oldtype, MPI_Datatype *newtype); +OMPI_DECLSPEC int PMPI_Unpack(void *inbuf, int insize, int *position, + void *outbuf, int outcount, MPI_Datatype datatype, + MPI_Comm comm); +OMPI_DECLSPEC int PMPI_Unpublish_name(char *service_name, MPI_Info info, + char *port_name); +OMPI_DECLSPEC int PMPI_Unpack_external (char *datarep, void *inbuf, MPI_Aint insize, + MPI_Aint *position, void *outbuf, int outcount, + MPI_Datatype datatype); +OMPI_DECLSPEC int PMPI_Waitall(int count, MPI_Request *array_of_requests, + MPI_Status *array_of_statuses); +OMPI_DECLSPEC int PMPI_Waitany(int count, MPI_Request *array_of_requests, + int *index, MPI_Status *status); +OMPI_DECLSPEC int PMPI_Wait(MPI_Request *request, MPI_Status *status); +OMPI_DECLSPEC int PMPI_Waitsome(int incount, MPI_Request *array_of_requests, + int *outcount, int *array_of_indices, + MPI_Status *array_of_statuses); +OMPI_DECLSPEC MPI_Fint PMPI_Win_c2f(MPI_Win win); +OMPI_DECLSPEC int PMPI_Win_call_errhandler(MPI_Win win, int errorcode); +OMPI_DECLSPEC int PMPI_Win_complete(MPI_Win win); +OMPI_DECLSPEC int PMPI_Win_create(void *base, MPI_Aint size, int disp_unit, + MPI_Info info, MPI_Comm comm, MPI_Win *win); +OMPI_DECLSPEC int PMPI_Win_create_errhandler(MPI_Win_errhandler_fn *function, + MPI_Errhandler *errhandler); +OMPI_DECLSPEC int PMPI_Win_create_keyval(MPI_Win_copy_attr_function *win_copy_attr_fn, + MPI_Win_delete_attr_function *win_delete_attr_fn, + int *win_keyval, void *extra_state); +OMPI_DECLSPEC int PMPI_Win_delete_attr(MPI_Win win, int win_keyval); +OMPI_DECLSPEC MPI_Win PMPI_Win_f2c(MPI_Fint win); +OMPI_DECLSPEC int PMPI_Win_fence(int assert, MPI_Win win); +OMPI_DECLSPEC int PMPI_Win_free(MPI_Win *win); +OMPI_DECLSPEC int PMPI_Win_free_keyval(int *win_keyval); +OMPI_DECLSPEC int PMPI_Win_get_attr(MPI_Win win, int win_keyval, + void *attribute_val, int *flag); +OMPI_DECLSPEC int PMPI_Win_get_errhandler(MPI_Win win, MPI_Errhandler *errhandler); +OMPI_DECLSPEC int PMPI_Win_get_group(MPI_Win win, MPI_Group *group); +OMPI_DECLSPEC int PMPI_Win_get_name(MPI_Win win, char *win_name, int *resultlen); +OMPI_DECLSPEC int PMPI_Win_lock(int lock_type, int rank, int assert, MPI_Win win); +OMPI_DECLSPEC int PMPI_Win_post(MPI_Group group, int assert, MPI_Win win); +OMPI_DECLSPEC int PMPI_Win_set_attr(MPI_Win win, int win_keyval, void *attribute_val); +OMPI_DECLSPEC int PMPI_Win_set_errhandler(MPI_Win win, MPI_Errhandler errhandler); +OMPI_DECLSPEC int PMPI_Win_set_name(MPI_Win win, char *win_name); +OMPI_DECLSPEC int PMPI_Win_start(MPI_Group group, int assert, MPI_Win win); +OMPI_DECLSPEC int PMPI_Win_test(MPI_Win win, int *flag); +OMPI_DECLSPEC int PMPI_Win_unlock(int rank, MPI_Win win); +OMPI_DECLSPEC int PMPI_Win_wait(MPI_Win win); +OMPI_DECLSPEC double PMPI_Wtick(void); +OMPI_DECLSPEC double PMPI_Wtime(void); + +#if defined(c_plusplus) || defined(__cplusplus) +} +#endif + +/* + * Conditional MPI 2 C++ bindings support. Include if: + * - The user does not explicitly request us to skip it (when a C++ compiler + * is used to compile C code). + * - We want C++ bindings support + * - We are not building OMPI itself + * - We are using a C++ compiler + */ +#if !defined(OMPI_SKIP_MPICXX) && OMPI_WANT_CXX_BINDINGS && !OMPI_BUILDING +#if defined(__cplusplus) || defined(c_plusplus) +#include "openmpi/ompi/mpi/cxx/mpicxx.h" +#endif +#endif + +#endif /* OMPI_MPI_H */ diff --git a/contrib/platform/win32/ompi/mca/allocator/base/static-components.h b/contrib/platform/win32/ompi/mca/allocator/base/static-components.h new file mode 100644 index 0000000000..3b0307380a --- /dev/null +++ b/contrib/platform/win32/ompi/mca/allocator/base/static-components.h @@ -0,0 +1,20 @@ +/* + * $HEADER$ + */ +#if defined(c_plusplus) || defined(__cplusplus) +extern "C" { +#endif + +extern const mca_base_component_t mca_allocator_basic_component; +extern const mca_base_component_t mca_allocator_bucket_component; + +const mca_base_component_t *mca_allocator_base_static_components[] = { + &mca_allocator_basic_component, + &mca_allocator_bucket_component, + NULL +}; + +#if defined(c_plusplus) || defined(__cplusplus) +} +#endif + diff --git a/contrib/platform/win32/ompi/mca/bml/base/static-components.h b/contrib/platform/win32/ompi/mca/bml/base/static-components.h new file mode 100644 index 0000000000..128984a459 --- /dev/null +++ b/contrib/platform/win32/ompi/mca/bml/base/static-components.h @@ -0,0 +1,18 @@ +/* + * $HEADER$ + */ +#if defined(c_plusplus) || defined(__cplusplus) +extern "C" { +#endif + +extern const mca_base_component_t mca_bml_r2_component; + +const mca_base_component_t *mca_bml_base_static_components[] = { + &mca_bml_r2_component, + NULL +}; + +#if defined(c_plusplus) || defined(__cplusplus) +} +#endif + diff --git a/contrib/platform/win32/ompi/mca/btl/base/static-components.h b/contrib/platform/win32/ompi/mca/btl/base/static-components.h new file mode 100644 index 0000000000..e9ce19d1fc --- /dev/null +++ b/contrib/platform/win32/ompi/mca/btl/base/static-components.h @@ -0,0 +1,22 @@ +/* + * $HEADER$ + */ +#if defined(c_plusplus) || defined(__cplusplus) +extern "C" { +#endif + +extern const mca_base_component_t mca_btl_self_component; +extern const mca_base_component_t mca_btl_sm_component; +extern const mca_base_component_t mca_btl_tcp_component; + +const mca_base_component_t *mca_btl_base_static_components[] = { + &mca_btl_self_component, + &mca_btl_sm_component, + &mca_btl_tcp_component, + NULL +}; + +#if defined(c_plusplus) || defined(__cplusplus) +} +#endif + diff --git a/contrib/platform/win32/ompi/mca/coll/base/static-components.h b/contrib/platform/win32/ompi/mca/coll/base/static-components.h new file mode 100644 index 0000000000..459dfbacf6 --- /dev/null +++ b/contrib/platform/win32/ompi/mca/coll/base/static-components.h @@ -0,0 +1,26 @@ +/* + * $HEADER$ + */ +#if defined(c_plusplus) || defined(__cplusplus) +extern "C" { +#endif + +extern const mca_base_component_t mca_coll_basic_component; +extern const mca_base_component_t mca_coll_hierarch_component; +extern const mca_base_component_t mca_coll_self_component; +extern const mca_base_component_t mca_coll_sm_component; +extern const mca_base_component_t mca_coll_tuned_component; + +const mca_base_component_t *mca_coll_base_static_components[] = { + &mca_coll_basic_component, + &mca_coll_hierarch_component, + &mca_coll_self_component, + &mca_coll_sm_component, + &mca_coll_tuned_component, + NULL +}; + +#if defined(c_plusplus) || defined(__cplusplus) +} +#endif + diff --git a/contrib/platform/win32/ompi/mca/crcp/base/static-components.h b/contrib/platform/win32/ompi/mca/crcp/base/static-components.h new file mode 100644 index 0000000000..9f64ef894e --- /dev/null +++ b/contrib/platform/win32/ompi/mca/crcp/base/static-components.h @@ -0,0 +1,18 @@ +/* + * $HEADER$ + */ +#if defined(c_plusplus) || defined(__cplusplus) +extern "C" { +#endif + + + +const mca_base_component_t *mca_crcp_base_static_components[] = { + + NULL +}; + +#if defined(c_plusplus) || defined(__cplusplus) +} +#endif + diff --git a/contrib/platform/win32/ompi/mca/io/base/static-components.h b/contrib/platform/win32/ompi/mca/io/base/static-components.h new file mode 100644 index 0000000000..6cc34731c5 --- /dev/null +++ b/contrib/platform/win32/ompi/mca/io/base/static-components.h @@ -0,0 +1,18 @@ +/* + * $HEADER$ + */ +#if defined(c_plusplus) || defined(__cplusplus) +extern "C" { +#endif + + + +const mca_base_component_t *mca_io_base_static_components[] = { + + NULL +}; + +#if defined(c_plusplus) || defined(__cplusplus) +} +#endif + diff --git a/contrib/platform/win32/ompi/mca/mpool/base/static-components.h b/contrib/platform/win32/ompi/mca/mpool/base/static-components.h new file mode 100644 index 0000000000..1d86f232a2 --- /dev/null +++ b/contrib/platform/win32/ompi/mca/mpool/base/static-components.h @@ -0,0 +1,18 @@ +/* + * $HEADER$ + */ +#if defined(c_plusplus) || defined(__cplusplus) +extern "C" { +#endif + +extern const mca_base_component_t mca_mpool_sm_component; + +const mca_base_component_t *mca_mpool_base_static_components[] = { + &mca_mpool_sm_component, + NULL +}; + +#if defined(c_plusplus) || defined(__cplusplus) +} +#endif + diff --git a/contrib/platform/win32/ompi/mca/mtl/base/static-components.h b/contrib/platform/win32/ompi/mca/mtl/base/static-components.h new file mode 100644 index 0000000000..0a044e823e --- /dev/null +++ b/contrib/platform/win32/ompi/mca/mtl/base/static-components.h @@ -0,0 +1,18 @@ +/* + * $HEADER$ + */ +#if defined(c_plusplus) || defined(__cplusplus) +extern "C" { +#endif + + + +const mca_base_component_t *mca_mtl_base_static_components[] = { + + NULL +}; + +#if defined(c_plusplus) || defined(__cplusplus) +} +#endif + diff --git a/contrib/platform/win32/ompi/mca/osc/base/static-components.h b/contrib/platform/win32/ompi/mca/osc/base/static-components.h new file mode 100644 index 0000000000..e20dcac40a --- /dev/null +++ b/contrib/platform/win32/ompi/mca/osc/base/static-components.h @@ -0,0 +1,20 @@ +/* + * $HEADER$ + */ +#if defined(c_plusplus) || defined(__cplusplus) +extern "C" { +#endif + +extern const mca_base_component_t mca_osc_pt2pt_component; +extern const mca_base_component_t mca_osc_rdma_component; + +const mca_base_component_t *mca_osc_base_static_components[] = { + &mca_osc_pt2pt_component, + &mca_osc_rdma_component, + NULL +}; + +#if defined(c_plusplus) || defined(__cplusplus) +} +#endif + diff --git a/contrib/platform/win32/ompi/mca/pml/base/static-components.h b/contrib/platform/win32/ompi/mca/pml/base/static-components.h new file mode 100644 index 0000000000..1cc2306baf --- /dev/null +++ b/contrib/platform/win32/ompi/mca/pml/base/static-components.h @@ -0,0 +1,22 @@ +/* + * $HEADER$ + */ +#if defined(c_plusplus) || defined(__cplusplus) +extern "C" { +#endif + +extern const mca_base_component_t mca_pml_cm_component; +extern const mca_base_component_t mca_pml_dr_component; +extern const mca_base_component_t mca_pml_ob1_component; + +const mca_base_component_t *mca_pml_base_static_components[] = { + &mca_pml_cm_component, + &mca_pml_dr_component, + &mca_pml_ob1_component, + NULL +}; + +#if defined(c_plusplus) || defined(__cplusplus) +} +#endif + diff --git a/contrib/platform/win32/ompi/mca/rcache/base/static-components.h b/contrib/platform/win32/ompi/mca/rcache/base/static-components.h new file mode 100644 index 0000000000..9876121c7d --- /dev/null +++ b/contrib/platform/win32/ompi/mca/rcache/base/static-components.h @@ -0,0 +1,18 @@ +/* + * $HEADER$ + */ +#if defined(c_plusplus) || defined(__cplusplus) +extern "C" { +#endif + +extern const mca_base_component_t mca_rcache_vma_component; + +const mca_base_component_t *mca_rcache_base_static_components[] = { + &mca_rcache_vma_component, + NULL +}; + +#if defined(c_plusplus) || defined(__cplusplus) +} +#endif + diff --git a/contrib/platform/win32/ompi/mca/topo/base/static-components.h b/contrib/platform/win32/ompi/mca/topo/base/static-components.h new file mode 100644 index 0000000000..96cb827b91 --- /dev/null +++ b/contrib/platform/win32/ompi/mca/topo/base/static-components.h @@ -0,0 +1,18 @@ +/* + * $HEADER$ + */ +#if defined(c_plusplus) || defined(__cplusplus) +extern "C" { +#endif + +extern const mca_base_component_t mca_topo_unity_component; + +const mca_base_component_t *mca_topo_base_static_components[] = { + &mca_topo_unity_component, + NULL +}; + +#if defined(c_plusplus) || defined(__cplusplus) +} +#endif + diff --git a/contrib/platform/win32/ompi/version.h b/contrib/platform/win32/ompi/version.h new file mode 100644 index 0000000000..108a9694e8 --- /dev/null +++ b/contrib/platform/win32/ompi/version.h @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, + * University of Stuttgart. All rights reserved. + * Copyright (c) 2004-2005 The Regents of the University of California. + * All rights reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + * + * This file should be included by any file that needs full + * version information for the OMPI project + */ + +#ifndef OMPI_VERSIONS_H +#define OMPI_VERSIONS_H + +#define OMPI_MAJOR_VERSION 1 +#define OMPI_MINOR_VERSION 3 +#define OMPI_RELEASE_VERSION 0 +#define OMPI_GREEK_VERSION "a1" +#define OMPI_WANT_SVN 1 +#define OMPI_SVN_R "r14150:14151" +#ifdef OMPI_VERSION +/* If we included version.h, we want the real version, not the + stripped (no-r number) version */ +#undef OMPI_VERSION +#endif +#define OMPI_VERSION "1.3a1r14150:14151" + +#endif diff --git a/contrib/platform/win32/ompi_config.h b/contrib/platform/win32/ompi_config.h new file mode 100644 index 0000000000..1b2a9e0196 --- /dev/null +++ b/contrib/platform/win32/ompi_config.h @@ -0,0 +1,109 @@ +/* ompi/include/ompi_config.h. Generated from ompi_config.h.in by configure. */ +/* -*- c -*- + * + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2006 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, + * University of Stuttgart. All rights reserved. + * Copyright (c) 2004-2005 The Regents of the University of California. + * All rights reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + * + * Function: - OS, CPU and compiler dependent configuration + */ + +#ifndef OMPI_CONFIG_H +#define OMPI_CONFIG_H + +#include "opal_config.h" + + +/*********************************************************************** + * + * OMPI-specific Fortran code that should be in ompi_config.h, but not + * in the other projects. + * + **********************************************************************/ + +/* MPI_Fint is the same as ompi_fortran_INTEGER_t */ +#define MPI_Fint ompi_fortran_integer_t + +/* MPI_Flogical is the same as the ompi_fortran_logical_t */ +#define MPI_Flogical ompi_fortran_logical_t + +#if OMPI_HAVE_FORTRAN_REAL && OMPI_HAVE_FORTRAN_COMPLEX +/* * C type for Fortran COMPLEX */ +typedef struct { + ompi_fortran_real_t real; + ompi_fortran_real_t imag; +} ompi_fortran_complex_t; +#endif + +#if OMPI_HAVE_FORTRAN_REAL4 && OMPI_HAVE_FORTRAN_COMPLEX8 +/* * C type for Fortran COMPLEX*8 */ +typedef struct { + ompi_fortran_real4_t real; + ompi_fortran_real4_t imag; +} ompi_fortran_complex8_t; +#endif + +#if OMPI_HAVE_FORTRAN_REAL8 && OMPI_HAVE_FORTRAN_COMPLEX16 +/* * C type for Fortran COMPLEX*16 */ +typedef struct { + ompi_fortran_real8_t real; + ompi_fortran_real8_t imag; +} ompi_fortran_complex16_t; +#endif + +#if OMPI_HAVE_FORTRAN_REAL16 && OMPI_HAVE_FORTRAN_COMPLEX32 +/* * C type for Fortran COMPLEX*32 */ +typedef struct { + ompi_fortran_real16_t real; + ompi_fortran_real16_t imag; +} ompi_fortran_complex32_t; +#endif + +#if OMPI_HAVE_FORTRAN_DOUBLE_PRECISION +/* * C type for Fortran DOUBLE COMPLEX */ +typedef struct { + ompi_fortran_double_precision_t real; + ompi_fortran_double_precision_t imag; +} ompi_fortran_double_complex_t; +#endif + +#if defined(__WINDOWS__) + +# if defined(_USRDLL) /* building shared libraries (.DLL) */ +# if defined(OMPI_EXPORTS) +# define OMPI_DECLSPEC __declspec(dllexport) +# define OMPI_MODULE_DECLSPEC +# else +# define OMPI_DECLSPEC __declspec(dllimport) +# if defined(OMPI_MODULE_EXPORTS) +# define OMPI_MODULE_DECLSPEC __declspec(dllexport) +# else +# define OMPI_MODULE_DECLSPEC __declspec(dllimport) +# endif /* defined(OMPI_MODULE_EXPORTS) */ +# endif /* defined(OMPI_EXPORTS) */ +# else /* building static library */ +# if defined(OMPI_IMPORTS) +# define OMPI_DECLSPEC __declspec(dllimport) +# else +# define OMPI_DECLSPEC +# endif /* defined(OMPI_IMPORTS) */ +# define OMPI_MODULE_DECLSPEC +# endif /* defined(_USRDLL) */ +#else +# define OMPI_DECLSPEC +# define OMPI_MODULE_DECLSPEC +#endif /* defined(__WINDOWS__) */ + +#endif diff --git a/contrib/platform/win32/opal/install_dirs.h b/contrib/platform/win32/opal/install_dirs.h new file mode 100644 index 0000000000..db924c0fb1 --- /dev/null +++ b/contrib/platform/win32/opal/install_dirs.h @@ -0,0 +1,115 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, + * University of Stuttgart. All rights reserved. + * Copyright (c) 2004-2005 The Regents of the University of California. + * All rights reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + * + * This file should be included by any file that needs the + * installation directories hard-coded into the object file. This + * should be avoided if at all possible, but there are some places + * (like the wrapper compilers) where it is infinitely easier to have + * the paths stored. + * + * If you have questions about which directory to use, we try as best + * we can to follow the GNU coding standards on this issue. The + * description of each directory can be found at the following URL: + * + * http://www.gnu.org/prep/standards/html_node/Directory-Variables.html + */ + +#ifndef OPAL_INST_DIRS_H +#define OPAL_INST_DIRS_H + +#define OPAL_PREFIX "C:\\Program files\\Open MPI" +#define OPAL_EXEC_PREFIX "C:\\Program files\\Open MPI" + +/* The directory for installing executable programs that users can + run. */ +#define OPAL_BINDIR "C:\\Program files\\Open MPI\\bin" + +/* The directory for installing executable programs that can be run + from the shell, but are only generally useful to system + administrators. */ +#define OPAL_SBINDIR "C:\\Program files\\Open MPI\\sbin" + +/* The directory for installing executable programs to be run by other + programs rather than by users. + + The definition of ‘libexecdir’ is the same for all packages, so + you should install your data in a subdirectory thereof. Most + packages install their data under $(libexecdir)/package-name/, + possibly within additional subdirectories thereof, such as + $(libexecdir)/package-name/machine/version. */ +#define OPAL_LIBEXECDIR "C:\\Program files\\Open MPI\\libexec" + +/* The directory for installing idiosyncratic read-only + architecture-independent data files for this program. + + The definition of ‘datadir’ is the same for all packages, so you + should install your data in a subdirectory thereof. Most packages + install their data under $(datadir)/package-name/. */ +#define OPAL_DATADIR "C:\\Program files\\Open MPI\\share" + +/* $(datadir)/package-name/. You probably want to use this instead of + OPAL_DATADIR */ +#define OPAL_PKGDATADIR "C:\\Program files\\Open MPI\\share\\openmpi" + +/* The directory for installing read-only data files that pertain to a + single machine–that is to say, files for configuring a host. Mailer + and network configuration files, /etc/passwd, and so forth belong + here. All the files in this directory should be ordinary ASCII text + files. + + Do not install executables here in this directory (they probably + belong in $(libexecdir) or $(sbindir)). Also do not install files + that are modified in the normal course of their use (programs whose + purpose is to change the configuration of the system + excluded). Those probably belong in $(localstatedir). */ +#define OPAL_SYSCONFDIR "C:\\Program files\\Open MPI\\etc" + +/* The directory for installing architecture-independent data files + which the programs modify while they run. */ +#define OPAL_SHAREDSTATEDIR "C:\\Program files\\Open MPI\\com" + +/* The directory for installing data files which the programs modify + while they run, and that pertain to one specific machine. Users + should never need to modify files in this directory to configure + the package's operation; put such configuration information in + separate files that go in $(datadir) or + $(sysconfdir). */ +#define OPAL_LOCALSTATEDIR "C:\\Program files\\Open MPI\\var" + +/* The directory for object files and libraries of object code. Do not + install executables here, they probably ought to go in + $(libexecdir) instead. */ +#define OPAL_LIBDIR "C:\\Program files\\Open MPI\\lib" + +/* $(libdir)/package-name/. This is where components should go */ +#define OPAL_PKGLIBDIR "C:\\Program files\\Open MPI\\lib\\openmpi" + +/* The directory for installing header files to be included by user + programs with the C ‘#include’ preprocessor directive. */ +#define OPAL_INCLUDEDIR "C:\\Program files\\Open MPI\\include" + +/* $(includedir)/package-name/. The devel headers go in here */ +#define OPAL_PKGINCLUDEDIR "C:\\Program files\\Open MPI\\include\\openmpi" + +/* The directory for installing the Info files for this package. */ +#define OPAL_INFODIR "C:\\Program files\\Open MPI\\share\\info" + +/* The top-level directory for installing the man pages (if any) for + this package. */ +#define OPAL_MANDIR "C:\\Program files\\Open MPI\\share\\man" + +#endif diff --git a/contrib/platform/win32/opal/libltdl/config.h b/contrib/platform/win32/opal/libltdl/config.h new file mode 100644 index 0000000000..8039ca71bf --- /dev/null +++ b/contrib/platform/win32/opal/libltdl/config.h @@ -0,0 +1,196 @@ +/* config.h. Generated from config-h.in by configure. */ +/* config-h.in. Generated from configure.ac by autoheader. */ + +/* Define to 1 if you have the `argz_append' function. */ +#define HAVE_ARGZ_APPEND 1 + +/* Define to 1 if you have the `argz_create_sep' function. */ +#define HAVE_ARGZ_CREATE_SEP 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_ARGZ_H 1 + +/* Define to 1 if you have the `argz_insert' function. */ +#define HAVE_ARGZ_INSERT 1 + +/* Define to 1 if you have the `argz_next' function. */ +#define HAVE_ARGZ_NEXT 1 + +/* Define to 1 if you have the `argz_stringify' function. */ +#define HAVE_ARGZ_STRINGIFY 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_ASSERT_H 1 + +/* Define to 1 if you have the `bcopy' function. */ +/* #undef HAVE_BCOPY */ + +/* Define to 1 if you have the `closedir' function. */ +#define HAVE_CLOSEDIR 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_CTYPE_H 1 + +/* Define to 1 if you have the header file, and it defines `DIR'. + */ +#define HAVE_DIRENT_H 1 + +/* Define if you have the GNU dld library. */ +/* #undef HAVE_DLD */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_DLD_H */ + +/* Define to 1 if you have the `dlerror' function. */ +#define HAVE_DLERROR 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_DLFCN_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_DL_H */ + +/* Define if you have the _dyld_func_lookup function. */ +/* #undef HAVE_DYLD */ + +/* Define to 1 if you have the header file. */ +#define HAVE_ERRNO_H 1 + +/* Define to 1 if the system has the type `error_t'. */ +#define HAVE_ERROR_T 1 + +/* Define to 1 if you have the `index' function. */ +/* #undef HAVE_INDEX */ + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* Define if you have the libdl library or equivalent. */ +#define HAVE_LIBDL 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_MACH_O_DYLD_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_MALLOC_H 1 + +/* Define to 1 if you have the `memcpy' function. */ +#define HAVE_MEMCPY 1 + +/* Define to 1 if you have the `memmove' function. */ +#define HAVE_MEMMOVE 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_MEMORY_H 1 + +/* Define to 1 if you have the header file, and it defines `DIR'. */ +/* #undef HAVE_NDIR_H */ + +/* Define to 1 if you have the `opendir' function. */ +#define HAVE_OPENDIR 1 + +/* Define if libtool can extract symbol lists from object files. */ +#define HAVE_PRELOADED_SYMBOLS 1 + +/* Define to 1 if you have the `readdir' function. */ +#define HAVE_READDIR 1 + +/* Define to 1 if you have the `rindex' function. */ +/* #undef HAVE_RINDEX */ + +/* Define if you have the shl_load function. */ +/* #undef HAVE_SHL_LOAD */ + +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDIO_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the `strchr' function. */ +#define HAVE_STRCHR 1 + +/* Define to 1 if you have the `strcmp' function. */ +#define HAVE_STRCMP 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the `strrchr' function. */ +#define HAVE_STRRCHR 1 + +/* Define to 1 if you have the header file, and it defines `DIR'. + */ +/* #undef HAVE_SYS_DIR_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_DL_H */ + +/* Define to 1 if you have the header file, and it defines `DIR'. + */ +/* #undef HAVE_SYS_NDIR_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_UNISTD_H 1 + +/* Define if the OS needs help to load dependent libraries for dlopen(). */ +#define LTDL_DLOPEN_DEPLIBS 1 + +/* Define to the sub-directory in which libtool stores uninstalled libraries. + */ +#define LTDL_OBJDIR ".libs/" + +/* Define to the name of the environment variable that determines the dynamic + library search path. */ +#define LTDL_SHLIBPATH_VAR "PATH" + +/* Define to the extension used for shared libraries, say, ".so". */ +#define LTDL_SHLIB_EXT ".dll" + +/* Define to the system default library search path. */ +#define LTDL_SYSSEARCHPATH "/lib:/usr/lib" + +/* Define if dlsym() requires a leading underscore in symbol names. */ +/* #undef NEED_USCORE */ + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "bug-libtool@gnu.org" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "libltdl" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "libltdl 1.2" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "libltdl" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "1.2" + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Define to empty if `const' does not conform to ANSI C. */ +/* #undef const */ + +/* Define to a type to use for `error_t' if it is not otherwise available. */ +/* #undef error_t */ + +/* Define to `__inline__' or `__inline' if that's what the C compiler + calls it, or to nothing if 'inline' is not supported under any name. */ +#ifndef __cplusplus +/* #undef inline */ +#endif diff --git a/contrib/platform/win32/opal/libltdl/ltdl.c b/contrib/platform/win32/opal/libltdl/ltdl.c new file mode 100644 index 0000000000..6e2b6a51bb --- /dev/null +++ b/contrib/platform/win32/opal/libltdl/ltdl.c @@ -0,0 +1,4528 @@ +/* ltdl.c -- system independent dlopen wrapper + Copyright (C) 1998, 1999, 2000, 2004, 2005, 2006 Free Software Foundation, Inc. + Originally by Thomas Tanner + This file is part of GNU Libtool. + +This library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; either +version 2 of the License, or (at your option) any later version. + +As a special exception to the GNU Lesser General Public License, +if you distribute this file as part of a program or library that +is built using GNU libtool, you may include it under the same +distribution terms that you use for the rest of that program. + +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with this library; if not, write to the Free Software +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA + +*/ + +#if HAVE_CONFIG_H +# include +#endif + +#if HAVE_UNISTD_H +# include +#endif + +#if HAVE_STDIO_H +# include +#endif + +/* Include the header defining malloc. On K&R C compilers, + that's , on ANSI C and ISO C compilers, that's . */ +#if HAVE_STDLIB_H +# include +#else +# if HAVE_MALLOC_H +# include +# endif +#endif + +#if HAVE_STRING_H +# include +#else +# if HAVE_STRINGS_H +# include +# endif +#endif + +#if HAVE_CTYPE_H +# include +#endif + +#if HAVE_MEMORY_H +# include +#endif + +#if HAVE_ERRNO_H +# include +#endif + + +#ifndef __WINDOWS__ +# ifdef __WIN32__ +# define __WINDOWS__ +# endif +#endif + + +#undef LT_USE_POSIX_DIRENT +#ifdef HAVE_CLOSEDIR +# ifdef HAVE_OPENDIR +# ifdef HAVE_READDIR +# ifdef HAVE_DIRENT_H +# define LT_USE_POSIX_DIRENT +# endif /* HAVE_DIRENT_H */ +# endif /* HAVE_READDIR */ +# endif /* HAVE_OPENDIR */ +#endif /* HAVE_CLOSEDIR */ + + +#undef LT_USE_WINDOWS_DIRENT_EMULATION +#ifndef LT_USE_POSIX_DIRENT +# ifdef __WINDOWS__ +# define LT_USE_WINDOWS_DIRENT_EMULATION +# endif /* __WINDOWS__ */ +#endif /* LT_USE_POSIX_DIRENT */ + + +#ifdef LT_USE_POSIX_DIRENT +# include +# define LT_D_NAMLEN(dirent) (strlen((dirent)->d_name)) +#else +# ifdef LT_USE_WINDOWS_DIRENT_EMULATION +# define LT_D_NAMLEN(dirent) (strlen((dirent)->d_name)) +# else +# define dirent direct +# define LT_D_NAMLEN(dirent) ((dirent)->d_namlen) +# if HAVE_SYS_NDIR_H +# include +# endif +# if HAVE_SYS_DIR_H +# include +# endif +# if HAVE_NDIR_H +# include +# endif +# endif +#endif + +#if HAVE_ARGZ_H +# include +#endif + +#if HAVE_ASSERT_H +# include +#else +# define assert(arg) ((void) 0) +#endif + +#include "ltdl.h" + +#if WITH_DMALLOC +# include +#endif + + + + +/* --- WINDOWS SUPPORT --- */ + +/* DLL building support on win32 hosts; mostly to workaround their + ridiculous implementation of data symbol exporting. */ +#ifndef LT_GLOBAL_DATA +# if defined(__WINDOWS__) || defined(__CYGWIN__) +# ifdef DLL_EXPORT /* defined by libtool (if required) */ +# define LT_GLOBAL_DATA __declspec(dllexport) +# endif +# endif +# ifndef LT_GLOBAL_DATA /* static linking or !__WINDOWS__ */ +# define LT_GLOBAL_DATA +# endif +#endif + +/* fopen() mode flags for reading a text file */ +#undef LT_READTEXT_MODE +#if defined(__WINDOWS__) || defined(__CYGWIN__) +# define LT_READTEXT_MODE "rt" +#else +# define LT_READTEXT_MODE "r" +#endif + +#ifdef LT_USE_WINDOWS_DIRENT_EMULATION + +#include + +#define dirent lt_dirent +#define DIR lt_DIR + +struct dirent +{ + char d_name[2048]; + int d_namlen; +}; + +typedef struct _DIR +{ + HANDLE hSearch; + WIN32_FIND_DATA Win32FindData; + BOOL firsttime; + struct dirent file_info; +} DIR; + +#endif /* LT_USE_WINDOWS_DIRENT_EMULATION */ + + +/* --- MANIFEST CONSTANTS --- */ + + +/* Standard libltdl search path environment variable name */ +#undef LTDL_SEARCHPATH_VAR +#define LTDL_SEARCHPATH_VAR "LTDL_LIBRARY_PATH" + +/* Standard libtool archive file extension. */ +#undef LTDL_ARCHIVE_EXT +#define LTDL_ARCHIVE_EXT ".la" + +/* max. filename length */ +#ifndef LT_FILENAME_MAX +# define LT_FILENAME_MAX 1024 +#endif + +/* This is the maximum symbol size that won't require malloc/free */ +#undef LT_SYMBOL_LENGTH +#define LT_SYMBOL_LENGTH 128 + +/* This accounts for the _LTX_ separator */ +#undef LT_SYMBOL_OVERHEAD +#define LT_SYMBOL_OVERHEAD 5 + + + + +/* --- MEMORY HANDLING --- */ + + +/* These are the functions used internally. In addition to making + use of the associated function pointers above, they also perform + error handling. */ +static char *lt_estrdup LT_PARAMS((const char *str)); +static lt_ptr lt_emalloc LT_PARAMS((size_t size)); +static lt_ptr lt_erealloc LT_PARAMS((lt_ptr addr, size_t size)); + +/* static lt_ptr rpl_realloc LT_PARAMS((lt_ptr ptr, size_t size)); */ +#define rpl_realloc realloc + +/* These are the pointers that can be changed by the caller: */ +LT_GLOBAL_DATA lt_ptr (*lt_dlmalloc) LT_PARAMS((size_t size)) + = (lt_ptr (*) LT_PARAMS((size_t))) malloc; +LT_GLOBAL_DATA lt_ptr (*lt_dlrealloc) LT_PARAMS((lt_ptr ptr, size_t size)) + = (lt_ptr (*) LT_PARAMS((lt_ptr, size_t))) rpl_realloc; +LT_GLOBAL_DATA void (*lt_dlfree) LT_PARAMS((lt_ptr ptr)) + = (void (*) LT_PARAMS((lt_ptr))) free; + +/* The following macros reduce the amount of typing needed to cast + assigned memory. */ +#if WITH_DMALLOC + +#define LT_DLMALLOC(tp, n) ((tp *) xmalloc ((n) * sizeof(tp))) +#define LT_DLREALLOC(tp, p, n) ((tp *) xrealloc ((p), (n) * sizeof(tp))) +#define LT_DLFREE(p) \ + LT_STMT_START { if (p) (p) = (xfree (p), (lt_ptr) 0); } LT_STMT_END + +#define LT_EMALLOC(tp, n) ((tp *) xmalloc ((n) * sizeof(tp))) +#define LT_EREALLOC(tp, p, n) ((tp *) xrealloc ((p), (n) * sizeof(tp))) + +#else + +#define LT_DLMALLOC(tp, n) ((tp *) lt_dlmalloc ((n) * sizeof(tp))) +#define LT_DLREALLOC(tp, p, n) ((tp *) lt_dlrealloc ((p), (n) * sizeof(tp))) +#define LT_DLFREE(p) \ + LT_STMT_START { if (p) (p) = (lt_dlfree (p), (lt_ptr) 0); } LT_STMT_END + +#define LT_EMALLOC(tp, n) ((tp *) lt_emalloc ((n) * sizeof(tp))) +#define LT_EREALLOC(tp, p, n) ((tp *) lt_erealloc ((p), (n) * sizeof(tp))) + +#endif + +#define LT_DLMEM_REASSIGN(p, q) LT_STMT_START { \ + if ((p) != (q)) { if (p) lt_dlfree (p); (p) = (q); (q) = 0; } \ + } LT_STMT_END + + +/* --- REPLACEMENT FUNCTIONS --- */ + + +#undef strdup +#define strdup rpl_strdup + +static char *strdup LT_PARAMS((const char *str)); + +static char * +strdup(str) + const char *str; +{ + char *tmp = 0; + + if (str) + { + tmp = LT_DLMALLOC (char, 1+ strlen (str)); + if (tmp) + { + strcpy(tmp, str); + } + } + + return tmp; +} + + +#if ! HAVE_STRCMP + +#undef strcmp +#define strcmp rpl_strcmp + +static int strcmp LT_PARAMS((const char *str1, const char *str2)); + +static int +strcmp (str1, str2) + const char *str1; + const char *str2; +{ + if (str1 == str2) + return 0; + if (str1 == 0) + return -1; + if (str2 == 0) + return 1; + + for (;*str1 && *str2; ++str1, ++str2) + { + if (*str1 != *str2) + break; + } + + return (int)(*str1 - *str2); +} +#endif + + +#if ! HAVE_STRCHR + +# if HAVE_INDEX +# define strchr index +# else +# define strchr rpl_strchr + +static const char *strchr LT_PARAMS((const char *str, int ch)); + +static const char* +strchr(str, ch) + const char *str; + int ch; +{ + const char *p; + + for (p = str; *p != (char)ch && *p != LT_EOS_CHAR; ++p) + /*NOWORK*/; + + return (*p == (char)ch) ? p : 0; +} + +# endif +#endif /* !HAVE_STRCHR */ + + +#if ! HAVE_STRRCHR + +# if HAVE_RINDEX +# define strrchr rindex +# else +# define strrchr rpl_strrchr + +static const char *strrchr LT_PARAMS((const char *str, int ch)); + +static const char* +strrchr(str, ch) + const char *str; + int ch; +{ + const char *p, *q = 0; + + for (p = str; *p != LT_EOS_CHAR; ++p) + { + if (*p == (char) ch) + { + q = p; + } + } + + return q; +} + +# endif +#endif + +/* NOTE: Neither bcopy nor the memcpy implementation below can + reliably handle copying in overlapping areas of memory. Use + memmove (for which there is a fallback implmentation below) + if you need that behaviour. */ +#if ! HAVE_MEMCPY + +# if HAVE_BCOPY +# define memcpy(dest, src, size) bcopy (src, dest, size) +# else +# define memcpy rpl_memcpy + +static lt_ptr memcpy LT_PARAMS((lt_ptr dest, const lt_ptr src, size_t size)); + +static lt_ptr +memcpy (dest, src, size) + lt_ptr dest; + const lt_ptr src; + size_t size; +{ + const char * s = src; + char * d = dest; + size_t i = 0; + + for (i = 0; i < size; ++i) + { + d[i] = s[i]; + } + + return dest; +} + +# endif /* !HAVE_BCOPY */ +#endif /* !HAVE_MEMCPY */ + +#if ! HAVE_MEMMOVE +# define memmove rpl_memmove + +static lt_ptr memmove LT_PARAMS((lt_ptr dest, const lt_ptr src, size_t size)); + +static lt_ptr +memmove (dest, src, size) + lt_ptr dest; + const lt_ptr src; + size_t size; +{ + const char * s = src; + char * d = dest; + size_t i; + + if (d < s) + for (i = 0; i < size; ++i) + { + d[i] = s[i]; + } + else if (d > s && size > 0) + for (i = size -1; ; --i) + { + d[i] = s[i]; + if (i == 0) + break; + } + + return dest; +} + +#endif /* !HAVE_MEMMOVE */ + +#ifdef LT_USE_WINDOWS_DIRENT_EMULATION + +static void closedir LT_PARAMS((DIR *entry)); + +static void +closedir(entry) + DIR *entry; +{ + assert(entry != (DIR *) NULL); + FindClose(entry->hSearch); + lt_dlfree((lt_ptr)entry); +} + + +static DIR * opendir LT_PARAMS((const char *path)); + +static DIR* +opendir (path) + const char *path; +{ + char file_specification[LT_FILENAME_MAX]; + DIR *entry; + + assert(path != (char *) NULL); + /* allow space for: path + '\\' '\\' '*' '.' '*' + '\0' */ + (void) strncpy (file_specification, path, LT_FILENAME_MAX-6); + file_specification[LT_FILENAME_MAX-6] = LT_EOS_CHAR; + (void) strcat(file_specification,"\\"); + entry = LT_DLMALLOC (DIR,sizeof(DIR)); + if (entry != (DIR *) 0) + { + entry->firsttime = TRUE; + entry->hSearch = FindFirstFile(file_specification,&entry->Win32FindData); + } + if (entry->hSearch == INVALID_HANDLE_VALUE) + { + (void) strcat(file_specification,"\\*.*"); + entry->hSearch = FindFirstFile(file_specification,&entry->Win32FindData); + if (entry->hSearch == INVALID_HANDLE_VALUE) + { + LT_DLFREE (entry); + return (DIR *) 0; + } + } + return(entry); +} + + +static struct dirent *readdir LT_PARAMS((DIR *entry)); + +static struct dirent *readdir(entry) + DIR *entry; +{ + int + status; + + if (entry == (DIR *) 0) + return((struct dirent *) 0); + if (!entry->firsttime) + { + status = FindNextFile(entry->hSearch,&entry->Win32FindData); + if (status == 0) + return((struct dirent *) 0); + } + entry->firsttime = FALSE; + (void) strncpy(entry->file_info.d_name,entry->Win32FindData.cFileName, + LT_FILENAME_MAX-1); + entry->file_info.d_name[LT_FILENAME_MAX - 1] = LT_EOS_CHAR; + entry->file_info.d_namlen = strlen(entry->file_info.d_name); + return(&entry->file_info); +} + +#endif /* LT_USE_WINDOWS_DIRENT_EMULATION */ + +/* According to Alexandre Oliva , + ``realloc is not entirely portable'' + In any case we want to use the allocator supplied by the user without + burdening them with an lt_dlrealloc function pointer to maintain. + Instead implement our own version (with known boundary conditions) + using lt_dlmalloc and lt_dlfree. */ + +/* #undef realloc + #define realloc rpl_realloc +*/ +#if 0 + /* You can't (re)define realloc unless you also (re)define malloc. + Right now, this code uses the size of the *destination* to decide + how much to copy. That's not right, but you can't know the size + of the source unless you know enough about, or wrote malloc. So + this code is disabled... */ + +static lt_ptr +realloc (ptr, size) + lt_ptr ptr; + size_t size; +{ + if (size == 0) + { + /* For zero or less bytes, free the original memory */ + if (ptr != 0) + { + lt_dlfree (ptr); + } + + return (lt_ptr) 0; + } + else if (ptr == 0) + { + /* Allow reallocation of a NULL pointer. */ + return lt_dlmalloc (size); + } + else + { + /* Allocate a new block, copy and free the old block. */ + lt_ptr mem = lt_dlmalloc (size); + + if (mem) + { + memcpy (mem, ptr, size); + lt_dlfree (ptr); + } + + /* Note that the contents of PTR are not damaged if there is + insufficient memory to realloc. */ + return mem; + } +} +#endif + + +#if ! HAVE_ARGZ_APPEND +# define argz_append rpl_argz_append + +static error_t argz_append LT_PARAMS((char **pargz, size_t *pargz_len, + const char *buf, size_t buf_len)); + +static error_t +argz_append (pargz, pargz_len, buf, buf_len) + char **pargz; + size_t *pargz_len; + const char *buf; + size_t buf_len; +{ + size_t argz_len; + char *argz; + + assert (pargz); + assert (pargz_len); + assert ((*pargz && *pargz_len) || (!*pargz && !*pargz_len)); + + /* If nothing needs to be appended, no more work is required. */ + if (buf_len == 0) + return 0; + + /* Ensure there is enough room to append BUF_LEN. */ + argz_len = *pargz_len + buf_len; + argz = LT_DLREALLOC (char, *pargz, argz_len); + if (!argz) + return ENOMEM; + + /* Copy characters from BUF after terminating '\0' in ARGZ. */ + memcpy (argz + *pargz_len, buf, buf_len); + + /* Assign new values. */ + *pargz = argz; + *pargz_len = argz_len; + + return 0; +} +#endif /* !HAVE_ARGZ_APPEND */ + + +#if ! HAVE_ARGZ_CREATE_SEP +# define argz_create_sep rpl_argz_create_sep + +static error_t argz_create_sep LT_PARAMS((const char *str, int delim, + char **pargz, size_t *pargz_len)); + +static error_t +argz_create_sep (str, delim, pargz, pargz_len) + const char *str; + int delim; + char **pargz; + size_t *pargz_len; +{ + size_t argz_len; + char *argz = 0; + + assert (str); + assert (pargz); + assert (pargz_len); + + /* Make a copy of STR, but replacing each occurrence of + DELIM with '\0'. */ + argz_len = 1+ LT_STRLEN (str); + if (argz_len) + { + const char *p; + char *q; + + argz = LT_DLMALLOC (char, argz_len); + if (!argz) + return ENOMEM; + + for (p = str, q = argz; *p != LT_EOS_CHAR; ++p) + { + if (*p == delim) + { + /* Ignore leading delimiters, and fold consecutive + delimiters in STR into a single '\0' in ARGZ. */ + if ((q > argz) && (q[-1] != LT_EOS_CHAR)) + *q++ = LT_EOS_CHAR; + else + --argz_len; + } + else + *q++ = *p; + } + /* Copy terminating LT_EOS_CHAR. */ + *q = *p; + } + + /* If ARGZ_LEN has shrunk to nothing, release ARGZ's memory. */ + if (!argz_len) + LT_DLFREE (argz); + + /* Assign new values. */ + *pargz = argz; + *pargz_len = argz_len; + + return 0; +} +#endif /* !HAVE_ARGZ_CREATE_SEP */ + + +#if ! HAVE_ARGZ_INSERT +# define argz_insert rpl_argz_insert + +static error_t argz_insert LT_PARAMS((char **pargz, size_t *pargz_len, + char *before, const char *entry)); + +static error_t +argz_insert (pargz, pargz_len, before, entry) + char **pargz; + size_t *pargz_len; + char *before; + const char *entry; +{ + assert (pargz); + assert (pargz_len); + assert (entry && *entry); + + /* No BEFORE address indicates ENTRY should be inserted after the + current last element. */ + if (!before) + return argz_append (pargz, pargz_len, entry, 1+ LT_STRLEN (entry)); + + /* This probably indicates a programmer error, but to preserve + semantics, scan back to the start of an entry if BEFORE points + into the middle of it. */ + while ((before > *pargz) && (before[-1] != LT_EOS_CHAR)) + --before; + + { + size_t entry_len = 1+ LT_STRLEN (entry); + size_t argz_len = *pargz_len + entry_len; + size_t offset = before - *pargz; + char *argz = LT_DLREALLOC (char, *pargz, argz_len); + + if (!argz) + return ENOMEM; + + /* Make BEFORE point to the equivalent offset in ARGZ that it + used to have in *PARGZ incase realloc() moved the block. */ + before = argz + offset; + + /* Move the ARGZ entries starting at BEFORE up into the new + space at the end -- making room to copy ENTRY into the + resulting gap. */ + memmove (before + entry_len, before, *pargz_len - offset); + memcpy (before, entry, entry_len); + + /* Assign new values. */ + *pargz = argz; + *pargz_len = argz_len; + } + + return 0; +} +#endif /* !HAVE_ARGZ_INSERT */ + + +#if ! HAVE_ARGZ_NEXT +# define argz_next rpl_argz_next + +static char *argz_next LT_PARAMS((char *argz, size_t argz_len, + const char *entry)); + +static char * +argz_next (argz, argz_len, entry) + char *argz; + size_t argz_len; + const char *entry; +{ + assert ((argz && argz_len) || (!argz && !argz_len)); + + if (entry) + { + /* Either ARGZ/ARGZ_LEN is empty, or ENTRY points into an address + within the ARGZ vector. */ + assert ((!argz && !argz_len) + || ((argz <= entry) && (entry < (argz + argz_len)))); + + /* Move to the char immediately after the terminating + '\0' of ENTRY. */ + entry = 1+ strchr (entry, LT_EOS_CHAR); + + /* Return either the new ENTRY, or else NULL if ARGZ is + exhausted. */ + return (entry >= argz + argz_len) ? 0 : (char *) entry; + } + else + { + /* This should probably be flagged as a programmer error, + since starting an argz_next loop with the iterator set + to ARGZ is safer. To preserve semantics, handle the NULL + case by returning the start of ARGZ (if any). */ + if (argz_len > 0) + return argz; + else + return 0; + } +} +#endif /* !HAVE_ARGZ_NEXT */ + + + +#if ! HAVE_ARGZ_STRINGIFY +# define argz_stringify rpl_argz_stringify + +static void argz_stringify LT_PARAMS((char *argz, size_t argz_len, + int sep)); + +static void +argz_stringify (argz, argz_len, sep) + char *argz; + size_t argz_len; + int sep; +{ + assert ((argz && argz_len) || (!argz && !argz_len)); + + if (sep) + { + --argz_len; /* don't stringify the terminating EOS */ + while (--argz_len > 0) + { + if (argz[argz_len] == LT_EOS_CHAR) + argz[argz_len] = sep; + } + } +} +#endif /* !HAVE_ARGZ_STRINGIFY */ + + + + +/* --- TYPE DEFINITIONS -- */ + + +/* This type is used for the array of caller data sets in each handler. */ +typedef struct { + lt_dlcaller_id key; + lt_ptr data; +} lt_caller_data; + + + + +/* --- OPAQUE STRUCTURES DECLARED IN LTDL.H --- */ + + +/* Extract the diagnostic strings from the error table macro in the same + order as the enumerated indices in ltdl.h. */ + +static const char *lt_dlerror_strings[] = + { +#define LT_ERROR(name, diagnostic) (diagnostic), + lt_dlerror_table +#undef LT_ERROR + + 0 + }; + +/* This structure is used for the list of registered loaders. */ +struct lt_dlloader { + struct lt_dlloader *next; + const char *loader_name; /* identifying name for each loader */ + const char *sym_prefix; /* prefix for symbols */ + lt_module_open *module_open; + lt_module_close *module_close; + lt_find_sym *find_sym; + lt_dlloader_exit *dlloader_exit; + lt_user_data dlloader_data; +}; + +struct lt_dlhandle_struct { + struct lt_dlhandle_struct *next; + lt_dlloader *loader; /* dlopening interface */ + lt_dlinfo info; + int depcount; /* number of dependencies */ + lt_dlhandle *deplibs; /* dependencies */ + lt_module module; /* system module handle */ + lt_ptr system; /* system specific data */ + lt_caller_data *caller_data; /* per caller associated data */ + int flags; /* various boolean stats */ +}; + +/* Various boolean flags can be stored in the flags field of an + lt_dlhandle_struct... */ +#define LT_DLGET_FLAG(handle, flag) (((handle)->flags & (flag)) == (flag)) +#define LT_DLSET_FLAG(handle, flag) ((handle)->flags |= (flag)) + +#define LT_DLRESIDENT_FLAG (0x01 << 0) +/* ...add more flags here... */ + +#define LT_DLIS_RESIDENT(handle) LT_DLGET_FLAG(handle, LT_DLRESIDENT_FLAG) + + +#define LT_DLSTRERROR(name) lt_dlerror_strings[LT_CONC(LT_ERROR_,name)] + +static const char objdir[] = LTDL_OBJDIR; +static const char archive_ext[] = LTDL_ARCHIVE_EXT; +#ifdef LTDL_SHLIB_EXT +static const char shlib_ext[] = LTDL_SHLIB_EXT; +#endif +#ifdef LTDL_SYSSEARCHPATH +static const char sys_search_path[] = LTDL_SYSSEARCHPATH; +#endif + + + + +/* --- MUTEX LOCKING --- */ + + +/* Macros to make it easier to run the lock functions only if they have + been registered. The reason for the complicated lock macro is to + ensure that the stored error message from the last error is not + accidentally erased if the current function doesn't generate an + error of its own. */ +#define LT_DLMUTEX_LOCK() LT_STMT_START { \ + if (lt_dlmutex_lock_func) (*lt_dlmutex_lock_func)(); \ + } LT_STMT_END +#define LT_DLMUTEX_UNLOCK() LT_STMT_START { \ + if (lt_dlmutex_unlock_func) (*lt_dlmutex_unlock_func)();\ + } LT_STMT_END +#define LT_DLMUTEX_SETERROR(errormsg) LT_STMT_START { \ + if (lt_dlmutex_seterror_func) \ + (*lt_dlmutex_seterror_func) (errormsg); \ + else lt_dllast_error = (errormsg); } LT_STMT_END +#define LT_DLMUTEX_GETERROR(errormsg) LT_STMT_START { \ + if (lt_dlmutex_geterror_func) \ + (errormsg) = (*lt_dlmutex_geterror_func) (); \ + else (errormsg) = lt_dllast_error; } LT_STMT_END + +/* The mutex functions stored here are global, and are necessarily the + same for all threads that wish to share access to libltdl. */ +static lt_dlmutex_lock *lt_dlmutex_lock_func = 0; +static lt_dlmutex_unlock *lt_dlmutex_unlock_func = 0; +static lt_dlmutex_seterror *lt_dlmutex_seterror_func = 0; +static lt_dlmutex_geterror *lt_dlmutex_geterror_func = 0; +static const char *lt_dllast_error = 0; + + +/* Either set or reset the mutex functions. Either all the arguments must + be valid functions, or else all can be NULL to turn off locking entirely. + The registered functions should be manipulating a static global lock + from the lock() and unlock() callbacks, which needs to be reentrant. */ +int +lt_dlmutex_register (lock, unlock, seterror, geterror) + lt_dlmutex_lock *lock; + lt_dlmutex_unlock *unlock; + lt_dlmutex_seterror *seterror; + lt_dlmutex_geterror *geterror; +{ + lt_dlmutex_unlock *old_unlock = unlock; + int errors = 0; + + /* Lock using the old lock() callback, if any. */ + LT_DLMUTEX_LOCK (); + + if ((lock && unlock && seterror && geterror) + || !(lock || unlock || seterror || geterror)) + { + lt_dlmutex_lock_func = lock; + lt_dlmutex_unlock_func = unlock; + lt_dlmutex_geterror_func = geterror; + } + else + { + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (INVALID_MUTEX_ARGS)); + ++errors; + } + + /* Use the old unlock() callback we saved earlier, if any. Otherwise + record any errors using internal storage. */ + if (old_unlock) + (*old_unlock) (); + + /* Return the number of errors encountered during the execution of + this function. */ + return errors; +} + + + + +/* --- ERROR HANDLING --- */ + + +static const char **user_error_strings = 0; +static int errorcount = LT_ERROR_MAX; + +int +lt_dladderror (diagnostic) + const char *diagnostic; +{ + int errindex = 0; + int result = -1; + const char **temp = (const char **) 0; + + assert (diagnostic); + + LT_DLMUTEX_LOCK (); + + errindex = errorcount - LT_ERROR_MAX; + temp = LT_EREALLOC (const char *, user_error_strings, 1 + errindex); + if (temp) + { + user_error_strings = temp; + user_error_strings[errindex] = diagnostic; + result = errorcount++; + } + + LT_DLMUTEX_UNLOCK (); + + return result; +} + +int +lt_dlseterror (errindex) + int errindex; +{ + int errors = 0; + + LT_DLMUTEX_LOCK (); + + if (errindex >= errorcount || errindex < 0) + { + /* Ack! Error setting the error message! */ + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (INVALID_ERRORCODE)); + ++errors; + } + else if (errindex < LT_ERROR_MAX) + { + /* No error setting the error message! */ + LT_DLMUTEX_SETERROR (lt_dlerror_strings[errindex]); + } + else + { + /* No error setting the error message! */ + LT_DLMUTEX_SETERROR (user_error_strings[errindex - LT_ERROR_MAX]); + } + + LT_DLMUTEX_UNLOCK (); + + return errors; +} + +static lt_ptr +lt_emalloc (size) + size_t size; +{ + lt_ptr mem = lt_dlmalloc (size); + if (size && !mem) + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (NO_MEMORY)); + return mem; +} + +static lt_ptr +lt_erealloc (addr, size) + lt_ptr addr; + size_t size; +{ + lt_ptr mem = lt_dlrealloc (addr, size); + if (size && !mem) + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (NO_MEMORY)); + return mem; +} + +static char * +lt_estrdup (str) + const char *str; +{ + char *copy = strdup (str); + if (LT_STRLEN (str) && !copy) + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (NO_MEMORY)); + return copy; +} + + + + +/* --- DLOPEN() INTERFACE LOADER --- */ + + +#if HAVE_LIBDL + +/* dynamic linking with dlopen/dlsym */ + +#if HAVE_DLFCN_H +# include +#endif + +#if HAVE_SYS_DL_H +# include +#endif + +#ifdef RTLD_GLOBAL +# define LT_GLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_GLOBAL DL_GLOBAL +# endif +#endif /* !RTLD_GLOBAL */ +#ifndef LT_GLOBAL +# define LT_GLOBAL 0 +#endif /* !LT_GLOBAL */ + +/* We may have to define LT_LAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_LAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_LAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_LAZY_OR_NOW DL_LAZY +# endif +# endif /* !RTLD_LAZY */ +#endif +#ifndef LT_LAZY_OR_NOW +# ifdef RTLD_NOW +# define LT_LAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_LAZY_OR_NOW DL_NOW +# endif +# endif /* !RTLD_NOW */ +#endif +#ifndef LT_LAZY_OR_NOW +# define LT_LAZY_OR_NOW 0 +#endif /* !LT_LAZY_OR_NOW */ + +#if HAVE_DLERROR +# define DLERROR(arg) dlerror () +#else +# define DLERROR(arg) LT_DLSTRERROR (arg) +#endif + +static lt_module +sys_dl_open (loader_data, filename) + lt_user_data loader_data; + const char *filename; +{ + lt_module module = dlopen (filename, LT_GLOBAL | LT_LAZY_OR_NOW); + + if (!module) + { + LT_DLMUTEX_SETERROR (DLERROR (CANNOT_OPEN)); + } + + return module; +} + +static int +sys_dl_close (loader_data, module) + lt_user_data loader_data; + lt_module module; +{ + int errors = 0; + + if (dlclose (module) != 0) + { + LT_DLMUTEX_SETERROR (DLERROR (CANNOT_CLOSE)); + ++errors; + } + + return errors; +} + +static lt_ptr +sys_dl_sym (loader_data, module, symbol) + lt_user_data loader_data; + lt_module module; + const char *symbol; +{ + lt_ptr address = dlsym (module, symbol); + + if (!address) + { + LT_DLMUTEX_SETERROR (DLERROR (SYMBOL_NOT_FOUND)); + } + + return address; +} + +static struct lt_user_dlloader sys_dl = + { +# ifdef NEED_USCORE + "_", +# else + 0, +# endif + sys_dl_open, sys_dl_close, sys_dl_sym, 0, 0 }; + + +#endif /* HAVE_LIBDL */ + + + +/* --- SHL_LOAD() INTERFACE LOADER --- */ + +#if HAVE_SHL_LOAD + +/* dynamic linking with shl_load (HP-UX) (comments from gmodule) */ + +#ifdef HAVE_DL_H +# include +#endif + +/* some flags are missing on some systems, so we provide + * harmless defaults. + * + * Mandatory: + * BIND_IMMEDIATE - Resolve symbol references when the library is loaded. + * BIND_DEFERRED - Delay code symbol resolution until actual reference. + * + * Optionally: + * BIND_FIRST - Place the library at the head of the symbol search + * order. + * BIND_NONFATAL - The default BIND_IMMEDIATE behavior is to treat all + * unsatisfied symbols as fatal. This flag allows + * binding of unsatisfied code symbols to be deferred + * until use. + * [Perl: For certain libraries, like DCE, deferred + * binding often causes run time problems. Adding + * BIND_NONFATAL to BIND_IMMEDIATE still allows + * unresolved references in situations like this.] + * BIND_NOSTART - Do not call the initializer for the shared library + * when the library is loaded, nor on a future call to + * shl_unload(). + * BIND_VERBOSE - Print verbose messages concerning possible + * unsatisfied symbols. + * + * hp9000s700/hp9000s800: + * BIND_RESTRICTED - Restrict symbols visible by the library to those + * present at library load time. + * DYNAMIC_PATH - Allow the loader to dynamically search for the + * library specified by the path argument. + */ + +#ifndef DYNAMIC_PATH +# define DYNAMIC_PATH 0 +#endif +#ifndef BIND_RESTRICTED +# define BIND_RESTRICTED 0 +#endif + +#define LT_BIND_FLAGS (BIND_IMMEDIATE | BIND_NONFATAL | DYNAMIC_PATH) + +static lt_module +sys_shl_open (loader_data, filename) + lt_user_data loader_data; + const char *filename; +{ + static shl_t self = (shl_t) 0; + lt_module module = shl_load (filename, LT_BIND_FLAGS, 0L); + + /* Since searching for a symbol against a NULL module handle will also + look in everything else that was already loaded and exported with + the -E compiler flag, we always cache a handle saved before any + modules are loaded. */ + if (!self) + { + lt_ptr address; + shl_findsym (&self, "main", TYPE_UNDEFINED, &address); + } + + if (!filename) + { + module = self; + } + else + { + module = shl_load (filename, LT_BIND_FLAGS, 0L); + + if (!module) + { + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (CANNOT_OPEN)); + } + } + + return module; +} + +static int +sys_shl_close (loader_data, module) + lt_user_data loader_data; + lt_module module; +{ + int errors = 0; + + if (module && (shl_unload ((shl_t) (module)) != 0)) + { + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (CANNOT_CLOSE)); + ++errors; + } + + return errors; +} + +static lt_ptr +sys_shl_sym (loader_data, module, symbol) + lt_user_data loader_data; + lt_module module; + const char *symbol; +{ + lt_ptr address = 0; + + /* sys_shl_open should never return a NULL module handle */ + if (module == (lt_module) 0) + { + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (INVALID_HANDLE)); + } + else if (!shl_findsym((shl_t*) &module, symbol, TYPE_UNDEFINED, &address)) + { + if (!address) + { + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (SYMBOL_NOT_FOUND)); + } + } + + return address; +} + +static struct lt_user_dlloader sys_shl = { + 0, sys_shl_open, sys_shl_close, sys_shl_sym, 0, 0 +}; + +#endif /* HAVE_SHL_LOAD */ + + + + +/* --- LOADLIBRARY() INTERFACE LOADER --- */ + +#ifdef __WINDOWS__ + +/* dynamic linking for Win32 */ + +#include + +/* Forward declaration; required to implement handle search below. */ +static lt_dlhandle handles; + +static lt_module +sys_wll_open (loader_data, filename) + lt_user_data loader_data; + const char *filename; +{ + lt_dlhandle cur; + lt_module module = 0; + const char *errormsg = 0; + char *searchname = 0; + char *ext; + char self_name_buf[MAX_PATH]; + + if (!filename) + { + /* Get the name of main module */ + *self_name_buf = 0; + GetModuleFileName (NULL, self_name_buf, sizeof (self_name_buf)); + filename = ext = self_name_buf; + } + else + { + ext = strrchr (filename, '.'); + } + + if (ext) + { + /* FILENAME already has an extension. */ + searchname = lt_estrdup (filename); + } + else + { + /* Append a `.' to stop Windows from adding an + implicit `.dll' extension. */ + searchname = LT_EMALLOC (char, 2+ LT_STRLEN (filename)); + if (searchname) + sprintf (searchname, "%s.", filename); + } + if (!searchname) + return 0; + + { + /* Silence dialog from LoadLibrary on some failures. + No way to get the error mode, but to set it, + so set it twice to preserve any previous flags. */ + UINT errormode = SetErrorMode(SEM_FAILCRITICALERRORS); + SetErrorMode(errormode | SEM_FAILCRITICALERRORS); + +#if defined(__CYGWIN__) + { + char wpath[MAX_PATH]; + cygwin_conv_to_full_win32_path (searchname, wpath); + module = LoadLibrary (wpath); + } +#else + module = LoadLibrary (searchname); +#endif + + /* Restore the error mode. */ + SetErrorMode(errormode); + } + + LT_DLFREE (searchname); + + /* libltdl expects this function to fail if it is unable + to physically load the library. Sadly, LoadLibrary + will search the loaded libraries for a match and return + one of them if the path search load fails. + + We check whether LoadLibrary is returning a handle to + an already loaded module, and simulate failure if we + find one. */ + LT_DLMUTEX_LOCK (); + cur = handles; + while (cur) + { + if (!cur->module) + { + cur = 0; + break; + } + + if (cur->module == module) + { + break; + } + + cur = cur->next; + } + LT_DLMUTEX_UNLOCK (); + + if (cur || !module) + { + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (CANNOT_OPEN)); + module = 0; + } + + return module; +} + +static int +sys_wll_close (loader_data, module) + lt_user_data loader_data; + lt_module module; +{ + int errors = 0; + + if (FreeLibrary(module) == 0) + { + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (CANNOT_CLOSE)); + ++errors; + } + + return errors; +} + +static lt_ptr +sys_wll_sym (loader_data, module, symbol) + lt_user_data loader_data; + lt_module module; + const char *symbol; +{ + lt_ptr address = GetProcAddress (module, symbol); + + if (!address) + { + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (SYMBOL_NOT_FOUND)); + } + + return address; +} + +static struct lt_user_dlloader sys_wll = { + 0, sys_wll_open, sys_wll_close, sys_wll_sym, 0, 0 +}; + +#endif /* __WINDOWS__ */ + + + + +/* --- LOAD_ADD_ON() INTERFACE LOADER --- */ + + +#ifdef __BEOS__ + +/* dynamic linking for BeOS */ + +#include + +static lt_module +sys_bedl_open (loader_data, filename) + lt_user_data loader_data; + const char *filename; +{ + image_id image = 0; + + if (filename) + { + image = load_add_on (filename); + } + else + { + image_info info; + int32 cookie = 0; + if (get_next_image_info (0, &cookie, &info) == B_OK) + image = load_add_on (info.name); + } + + if (image <= 0) + { + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (CANNOT_OPEN)); + image = 0; + } + + return (lt_module) image; +} + +static int +sys_bedl_close (loader_data, module) + lt_user_data loader_data; + lt_module module; +{ + int errors = 0; + + if (unload_add_on ((image_id) module) != B_OK) + { + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (CANNOT_CLOSE)); + ++errors; + } + + return errors; +} + +static lt_ptr +sys_bedl_sym (loader_data, module, symbol) + lt_user_data loader_data; + lt_module module; + const char *symbol; +{ + lt_ptr address = 0; + image_id image = (image_id) module; + + if (get_image_symbol (image, symbol, B_SYMBOL_TYPE_ANY, address) != B_OK) + { + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (SYMBOL_NOT_FOUND)); + address = 0; + } + + return address; +} + +static struct lt_user_dlloader sys_bedl = { + 0, sys_bedl_open, sys_bedl_close, sys_bedl_sym, 0, 0 +}; + +#endif /* __BEOS__ */ + + + + +/* --- DLD_LINK() INTERFACE LOADER --- */ + + +#if HAVE_DLD + +/* dynamic linking with dld */ + +#if HAVE_DLD_H +#include +#endif + +static lt_module +sys_dld_open (loader_data, filename) + lt_user_data loader_data; + const char *filename; +{ + lt_module module = strdup (filename); + + if (dld_link (filename) != 0) + { + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (CANNOT_OPEN)); + LT_DLFREE (module); + module = 0; + } + + return module; +} + +static int +sys_dld_close (loader_data, module) + lt_user_data loader_data; + lt_module module; +{ + int errors = 0; + + if (dld_unlink_by_file ((char*)(module), 1) != 0) + { + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (CANNOT_CLOSE)); + ++errors; + } + else + { + LT_DLFREE (module); + } + + return errors; +} + +static lt_ptr +sys_dld_sym (loader_data, module, symbol) + lt_user_data loader_data; + lt_module module; + const char *symbol; +{ + lt_ptr address = dld_get_func (symbol); + + if (!address) + { + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (SYMBOL_NOT_FOUND)); + } + + return address; +} + +static struct lt_user_dlloader sys_dld = { + 0, sys_dld_open, sys_dld_close, sys_dld_sym, 0, 0 +}; + +#endif /* HAVE_DLD */ + +/* --- DYLD() MACOSX/DARWIN INTERFACE LOADER --- */ +#if HAVE_DYLD + + +#if HAVE_MACH_O_DYLD_H +#if !defined(__APPLE_CC__) && !defined(__MWERKS__) && !defined(__private_extern__) +/* Is this correct? Does it still function properly? */ +#define __private_extern__ extern +#endif +# include +#endif +#include + +/* We have to put some stuff here that isn't in older dyld.h files */ +#ifndef ENUM_DYLD_BOOL +# define ENUM_DYLD_BOOL +# undef FALSE +# undef TRUE + enum DYLD_BOOL { + FALSE, + TRUE + }; +#endif +#ifndef LC_REQ_DYLD +# define LC_REQ_DYLD 0x80000000 +#endif +#ifndef LC_LOAD_WEAK_DYLIB +# define LC_LOAD_WEAK_DYLIB (0x18 | LC_REQ_DYLD) +#endif +static const struct mach_header * (*ltdl_NSAddImage)(const char *image_name, unsigned long options) = 0; +static NSSymbol (*ltdl_NSLookupSymbolInImage)(const struct mach_header *image,const char *symbolName, unsigned long options) = 0; +static enum DYLD_BOOL (*ltdl_NSIsSymbolNameDefinedInImage)(const struct mach_header *image, const char *symbolName) = 0; +static enum DYLD_BOOL (*ltdl_NSMakePrivateModulePublic)(NSModule module) = 0; + +#ifndef NSADDIMAGE_OPTION_NONE +#define NSADDIMAGE_OPTION_NONE 0x0 +#endif +#ifndef NSADDIMAGE_OPTION_RETURN_ON_ERROR +#define NSADDIMAGE_OPTION_RETURN_ON_ERROR 0x1 +#endif +#ifndef NSADDIMAGE_OPTION_WITH_SEARCHING +#define NSADDIMAGE_OPTION_WITH_SEARCHING 0x2 +#endif +#ifndef NSADDIMAGE_OPTION_RETURN_ONLY_IF_LOADED +#define NSADDIMAGE_OPTION_RETURN_ONLY_IF_LOADED 0x4 +#endif +#ifndef NSADDIMAGE_OPTION_MATCH_FILENAME_BY_INSTALLNAME +#define NSADDIMAGE_OPTION_MATCH_FILENAME_BY_INSTALLNAME 0x8 +#endif +#ifndef NSLOOKUPSYMBOLINIMAGE_OPTION_BIND +#define NSLOOKUPSYMBOLINIMAGE_OPTION_BIND 0x0 +#endif +#ifndef NSLOOKUPSYMBOLINIMAGE_OPTION_BIND_NOW +#define NSLOOKUPSYMBOLINIMAGE_OPTION_BIND_NOW 0x1 +#endif +#ifndef NSLOOKUPSYMBOLINIMAGE_OPTION_BIND_FULLY +#define NSLOOKUPSYMBOLINIMAGE_OPTION_BIND_FULLY 0x2 +#endif +#ifndef NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR +#define NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR 0x4 +#endif + + +static const char * +lt_int_dyld_error(othererror) + char* othererror; +{ +/* return the dyld error string, or the passed in error string if none */ + NSLinkEditErrors ler; + int lerno; + const char *errstr; + const char *file; + NSLinkEditError(&ler,&lerno,&file,&errstr); + if (!errstr || !strlen(errstr)) errstr = othererror; + return errstr; +} + +static const struct mach_header * +lt_int_dyld_get_mach_header_from_nsmodule(module) + NSModule module; +{ +/* There should probably be an apple dyld api for this */ + int i=_dyld_image_count(); + int j; + const char *modname=NSNameOfModule(module); + const struct mach_header *mh=NULL; + if (!modname) return NULL; + for (j = 0; j < i; j++) + { + if (!strcmp(_dyld_get_image_name(j),modname)) + { + mh=_dyld_get_image_header(j); + break; + } + } + return mh; +} + +static const char* lt_int_dyld_lib_install_name(mh) + const struct mach_header *mh; +{ +/* NSAddImage is also used to get the loaded image, but it only works if the lib + is installed, for uninstalled libs we need to check the install_names against + each other. Note that this is still broken if DYLD_IMAGE_SUFFIX is set and a + different lib was loaded as a result +*/ + int j; + struct load_command *lc; + unsigned long offset = sizeof(struct mach_header); + const char* retStr=NULL; + for (j = 0; j < mh->ncmds; j++) + { + lc = (struct load_command*)(((unsigned long)mh) + offset); + if (LC_ID_DYLIB == lc->cmd) + { + retStr=(char*)(((struct dylib_command*)lc)->dylib.name.offset + + (unsigned long)lc); + } + offset += lc->cmdsize; + } + return retStr; +} + +static const struct mach_header * +lt_int_dyld_match_loaded_lib_by_install_name(const char *name) +{ + int i=_dyld_image_count(); + int j; + const struct mach_header *mh=NULL; + const char *id=NULL; + for (j = 0; j < i; j++) + { + id=lt_int_dyld_lib_install_name(_dyld_get_image_header(j)); + if ((id) && (!strcmp(id,name))) + { + mh=_dyld_get_image_header(j); + break; + } + } + return mh; +} + +static NSSymbol +lt_int_dyld_NSlookupSymbolInLinkedLibs(symbol,mh) + const char *symbol; + const struct mach_header *mh; +{ + /* Safe to assume our mh is good */ + int j; + struct load_command *lc; + unsigned long offset = sizeof(struct mach_header); + NSSymbol retSym = 0; + const struct mach_header *mh1; + if ((ltdl_NSLookupSymbolInImage) && NSIsSymbolNameDefined(symbol) ) + { + for (j = 0; j < mh->ncmds; j++) + { + lc = (struct load_command*)(((unsigned long)mh) + offset); + if ((LC_LOAD_DYLIB == lc->cmd) || (LC_LOAD_WEAK_DYLIB == lc->cmd)) + { + mh1=lt_int_dyld_match_loaded_lib_by_install_name((char*)(((struct dylib_command*)lc)->dylib.name.offset + + (unsigned long)lc)); + if (!mh1) + { + /* Maybe NSAddImage can find it */ + mh1=ltdl_NSAddImage((char*)(((struct dylib_command*)lc)->dylib.name.offset + + (unsigned long)lc), + NSADDIMAGE_OPTION_RETURN_ONLY_IF_LOADED + + NSADDIMAGE_OPTION_WITH_SEARCHING + + NSADDIMAGE_OPTION_RETURN_ON_ERROR ); + } + if (mh1) + { + retSym = ltdl_NSLookupSymbolInImage(mh1, + symbol, + NSLOOKUPSYMBOLINIMAGE_OPTION_BIND_NOW + | NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR + ); + if (retSym) break; + } + } + offset += lc->cmdsize; + } + } + return retSym; +} + +static int +sys_dyld_init() +{ + int retCode = 0; + int err = 0; + if (!_dyld_present()) { + retCode=1; + } + else { + err = _dyld_func_lookup("__dyld_NSAddImage",(unsigned long*)<dl_NSAddImage); + err = _dyld_func_lookup("__dyld_NSLookupSymbolInImage",(unsigned long*)<dl_NSLookupSymbolInImage); + err = _dyld_func_lookup("__dyld_NSIsSymbolNameDefinedInImage",(unsigned long*)<dl_NSIsSymbolNameDefinedInImage); + err = _dyld_func_lookup("__dyld_NSMakePrivateModulePublic",(unsigned long*)<dl_NSMakePrivateModulePublic); + } + return retCode; +} + +static lt_module +sys_dyld_open (loader_data, filename) + lt_user_data loader_data; + const char *filename; +{ + lt_module module = 0; + NSObjectFileImage ofi = 0; + NSObjectFileImageReturnCode ofirc; + + if (!filename) + return (lt_module)-1; + ofirc = NSCreateObjectFileImageFromFile(filename, &ofi); + switch (ofirc) + { + case NSObjectFileImageSuccess: + module = NSLinkModule(ofi, filename, + NSLINKMODULE_OPTION_RETURN_ON_ERROR + | NSLINKMODULE_OPTION_PRIVATE + | NSLINKMODULE_OPTION_BINDNOW); + NSDestroyObjectFileImage(ofi); + if (module) + ltdl_NSMakePrivateModulePublic(module); + break; + case NSObjectFileImageInappropriateFile: + if (ltdl_NSIsSymbolNameDefinedInImage && ltdl_NSLookupSymbolInImage) + { + module = (lt_module)ltdl_NSAddImage(filename, NSADDIMAGE_OPTION_RETURN_ON_ERROR); + break; + } + default: + LT_DLMUTEX_SETERROR (lt_int_dyld_error(LT_DLSTRERROR(CANNOT_OPEN))); + return 0; + } + if (!module) LT_DLMUTEX_SETERROR (lt_int_dyld_error(LT_DLSTRERROR(CANNOT_OPEN))); + return module; +} + +static int +sys_dyld_close (loader_data, module) + lt_user_data loader_data; + lt_module module; +{ + int retCode = 0; + int flags = 0; + if (module == (lt_module)-1) return 0; +#ifdef __BIG_ENDIAN__ + if (((struct mach_header *)module)->magic == MH_MAGIC) +#else + if (((struct mach_header *)module)->magic == MH_CIGAM) +#endif + { + LT_DLMUTEX_SETERROR("Can not close a dylib"); + retCode = 1; + } + else + { +#if 1 +/* Currently, if a module contains c++ static destructors and it is unloaded, we + get a segfault in atexit(), due to compiler and dynamic loader differences of + opinion, this works around that. +*/ + if ((const struct section *)NULL != + getsectbynamefromheader(lt_int_dyld_get_mach_header_from_nsmodule(module), + "__DATA","__mod_term_func")) + { + flags += NSUNLINKMODULE_OPTION_KEEP_MEMORY_MAPPED; + } +#endif +#ifdef __ppc__ + flags += NSUNLINKMODULE_OPTION_RESET_LAZY_REFERENCES; +#endif + if (!NSUnLinkModule(module,flags)) + { + retCode=1; + LT_DLMUTEX_SETERROR (lt_int_dyld_error(LT_DLSTRERROR(CANNOT_CLOSE))); + } + } + + return retCode; +} + +static lt_ptr +sys_dyld_sym (loader_data, module, symbol) + lt_user_data loader_data; + lt_module module; + const char *symbol; +{ + lt_ptr address = 0; + NSSymbol *nssym = 0; + void *unused; + const struct mach_header *mh=NULL; + char saveError[256] = "Symbol not found"; + if (module == (lt_module)-1) + { + _dyld_lookup_and_bind(symbol,(unsigned long*)&address,&unused); + return address; + } +#ifdef __BIG_ENDIAN__ + if (((struct mach_header *)module)->magic == MH_MAGIC) +#else + if (((struct mach_header *)module)->magic == MH_CIGAM) +#endif + { + if (ltdl_NSIsSymbolNameDefinedInImage && ltdl_NSLookupSymbolInImage) + { + mh=module; + if (ltdl_NSIsSymbolNameDefinedInImage((struct mach_header*)module,symbol)) + { + nssym = ltdl_NSLookupSymbolInImage((struct mach_header*)module, + symbol, + NSLOOKUPSYMBOLINIMAGE_OPTION_BIND_NOW + | NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR + ); + } + } + + } + else { + nssym = NSLookupSymbolInModule(module, symbol); + } + if (!nssym) + { + strncpy(saveError, lt_int_dyld_error(LT_DLSTRERROR(SYMBOL_NOT_FOUND)), 255); + saveError[255] = 0; + if (!mh) mh=lt_int_dyld_get_mach_header_from_nsmodule(module); + nssym = lt_int_dyld_NSlookupSymbolInLinkedLibs(symbol,mh); + } + if (!nssym) + { + LT_DLMUTEX_SETERROR (saveError); + return NULL; + } + return NSAddressOfSymbol(nssym); +} + +static struct lt_user_dlloader sys_dyld = + { "_", sys_dyld_open, sys_dyld_close, sys_dyld_sym, 0, 0 }; + + +#endif /* HAVE_DYLD */ + + +/* --- DLPREOPEN() INTERFACE LOADER --- */ + + +/* emulate dynamic linking using preloaded_symbols */ + +typedef struct lt_dlsymlists_t +{ + struct lt_dlsymlists_t *next; + const lt_dlsymlist *syms; +} lt_dlsymlists_t; + +static const lt_dlsymlist *default_preloaded_symbols = 0; +static lt_dlsymlists_t *preloaded_symbols = 0; + +static int +presym_init (loader_data) + lt_user_data loader_data; +{ + int errors = 0; + + LT_DLMUTEX_LOCK (); + + preloaded_symbols = 0; + if (default_preloaded_symbols) + { + errors = lt_dlpreload (default_preloaded_symbols); + } + + LT_DLMUTEX_UNLOCK (); + + return errors; +} + +static int +presym_free_symlists () +{ + lt_dlsymlists_t *lists; + + LT_DLMUTEX_LOCK (); + + lists = preloaded_symbols; + while (lists) + { + lt_dlsymlists_t *tmp = lists; + + lists = lists->next; + LT_DLFREE (tmp); + } + preloaded_symbols = 0; + + LT_DLMUTEX_UNLOCK (); + + return 0; +} + +static int +presym_exit (loader_data) + lt_user_data loader_data; +{ + presym_free_symlists (); + return 0; +} + +static int +presym_add_symlist (preloaded) + const lt_dlsymlist *preloaded; +{ + lt_dlsymlists_t *tmp; + lt_dlsymlists_t *lists; + int errors = 0; + + LT_DLMUTEX_LOCK (); + + lists = preloaded_symbols; + while (lists) + { + if (lists->syms == preloaded) + { + goto done; + } + lists = lists->next; + } + + tmp = LT_EMALLOC (lt_dlsymlists_t, 1); + if (tmp) + { + memset (tmp, 0, sizeof(lt_dlsymlists_t)); + tmp->syms = preloaded; + tmp->next = preloaded_symbols; + preloaded_symbols = tmp; + } + else + { + ++errors; + } + + done: + LT_DLMUTEX_UNLOCK (); + return errors; +} + +static lt_module +presym_open (loader_data, filename) + lt_user_data loader_data; + const char *filename; +{ + lt_dlsymlists_t *lists; + lt_module module = (lt_module) 0; + + LT_DLMUTEX_LOCK (); + lists = preloaded_symbols; + + if (!lists) + { + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (NO_SYMBOLS)); + goto done; + } + + /* Can't use NULL as the reflective symbol header, as NULL is + used to mark the end of the entire symbol list. Self-dlpreopened + symbols follow this magic number, chosen to be an unlikely + clash with a real module name. */ + if (!filename) + { + filename = "@PROGRAM@"; + } + + while (lists) + { + const lt_dlsymlist *syms = lists->syms; + + while (syms->name) + { + if (!syms->address && strcmp(syms->name, filename) == 0) + { + module = (lt_module) syms; + goto done; + } + ++syms; + } + + lists = lists->next; + } + + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (FILE_NOT_FOUND)); + + done: + LT_DLMUTEX_UNLOCK (); + return module; +} + +static int +presym_close (loader_data, module) + lt_user_data loader_data; + lt_module module; +{ + /* Just to silence gcc -Wall */ + module = 0; + return 0; +} + +static lt_ptr +presym_sym (loader_data, module, symbol) + lt_user_data loader_data; + lt_module module; + const char *symbol; +{ + lt_dlsymlist *syms = (lt_dlsymlist*) module; + + ++syms; + while (syms->address) + { + if (strcmp(syms->name, symbol) == 0) + { + return syms->address; + } + + ++syms; + } + + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (SYMBOL_NOT_FOUND)); + + return 0; +} + +static struct lt_user_dlloader presym = { + 0, presym_open, presym_close, presym_sym, presym_exit, 0 +}; + + + + + +/* --- DYNAMIC MODULE LOADING --- */ + + +/* The type of a function used at each iteration of foreach_dirinpath(). */ +typedef int foreach_callback_func LT_PARAMS((char *filename, lt_ptr data1, + lt_ptr data2)); + +static int foreach_dirinpath LT_PARAMS((const char *search_path, + const char *base_name, + foreach_callback_func *func, + lt_ptr data1, lt_ptr data2)); + +static int find_file_callback LT_PARAMS((char *filename, lt_ptr data, + lt_ptr ignored)); +static int find_handle_callback LT_PARAMS((char *filename, lt_ptr data, + lt_ptr ignored)); +static int foreachfile_callback LT_PARAMS((char *filename, lt_ptr data1, + lt_ptr data2)); + + +static int canonicalize_path LT_PARAMS((const char *path, + char **pcanonical)); +static int argzize_path LT_PARAMS((const char *path, + char **pargz, + size_t *pargz_len)); +static FILE *find_file LT_PARAMS((const char *search_path, + const char *base_name, + char **pdir)); +static lt_dlhandle *find_handle LT_PARAMS((const char *search_path, + const char *base_name, + lt_dlhandle *handle)); +static int find_module LT_PARAMS((lt_dlhandle *handle, + const char *dir, + const char *libdir, + const char *dlname, + const char *old_name, + int installed)); +static int free_vars LT_PARAMS((char *dlname, char *oldname, + char *libdir, char *deplibs)); +static int load_deplibs LT_PARAMS((lt_dlhandle handle, + char *deplibs)); +static int trim LT_PARAMS((char **dest, + const char *str)); +static int try_dlopen LT_PARAMS((lt_dlhandle *handle, + const char *filename)); +static int tryall_dlopen LT_PARAMS((lt_dlhandle *handle, + const char *filename)); +static int unload_deplibs LT_PARAMS((lt_dlhandle handle)); +static int lt_argz_insert LT_PARAMS((char **pargz, + size_t *pargz_len, + char *before, + const char *entry)); +static int lt_argz_insertinorder LT_PARAMS((char **pargz, + size_t *pargz_len, + const char *entry)); +static int lt_argz_insertdir LT_PARAMS((char **pargz, + size_t *pargz_len, + const char *dirnam, + struct dirent *dp)); +static int lt_dlpath_insertdir LT_PARAMS((char **ppath, + char *before, + const char *dir)); +static int list_files_by_dir LT_PARAMS((const char *dirnam, + char **pargz, + size_t *pargz_len)); +static int file_not_found LT_PARAMS((void)); + +static char *user_search_path= 0; +static lt_dlloader *loaders = 0; +static lt_dlhandle handles = 0; +static int initialized = 0; + +/* Initialize libltdl. */ +int +lt_dlinit () +{ + int errors = 0; + + LT_DLMUTEX_LOCK (); + + /* Initialize only at first call. */ + if (++initialized == 1) + { + handles = 0; + user_search_path = 0; /* empty search path */ + +#if HAVE_LIBDL + errors += lt_dlloader_add (lt_dlloader_next (0), &sys_dl, "dlopen"); +#endif +#if HAVE_SHL_LOAD + errors += lt_dlloader_add (lt_dlloader_next (0), &sys_shl, "dlopen"); +#endif +#ifdef __WINDOWS__ + errors += lt_dlloader_add (lt_dlloader_next (0), &sys_wll, "dlopen"); +#endif +#ifdef __BEOS__ + errors += lt_dlloader_add (lt_dlloader_next (0), &sys_bedl, "dlopen"); +#endif +#if HAVE_DLD + errors += lt_dlloader_add (lt_dlloader_next (0), &sys_dld, "dld"); +#endif +#if HAVE_DYLD + errors += lt_dlloader_add (lt_dlloader_next (0), &sys_dyld, "dyld"); + errors += sys_dyld_init(); +#endif + errors += lt_dlloader_add (lt_dlloader_next (0), &presym, "dlpreload"); + + if (presym_init (presym.dlloader_data)) + { + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (INIT_LOADER)); + ++errors; + } + else if (errors != 0) + { + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (DLOPEN_NOT_SUPPORTED)); + ++errors; + } + } + + LT_DLMUTEX_UNLOCK (); + + return errors; +} + +int +lt_dlpreload (preloaded) + const lt_dlsymlist *preloaded; +{ + int errors = 0; + + if (preloaded) + { + errors = presym_add_symlist (preloaded); + } + else + { + presym_free_symlists(); + + LT_DLMUTEX_LOCK (); + if (default_preloaded_symbols) + { + errors = lt_dlpreload (default_preloaded_symbols); + } + LT_DLMUTEX_UNLOCK (); + } + + return errors; +} + +int +lt_dlpreload_default (preloaded) + const lt_dlsymlist *preloaded; +{ + LT_DLMUTEX_LOCK (); + default_preloaded_symbols = preloaded; + LT_DLMUTEX_UNLOCK (); + return 0; +} + +int +lt_dlexit () +{ + /* shut down libltdl */ + lt_dlloader *loader; + int errors = 0; + + LT_DLMUTEX_LOCK (); + loader = loaders; + + if (!initialized) + { + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (SHUTDOWN)); + ++errors; + goto done; + } + + /* shut down only at last call. */ + if (--initialized == 0) + { + int level; + + while (handles && LT_DLIS_RESIDENT (handles)) + { + handles = handles->next; + } + + /* close all modules */ + for (level = 1; handles; ++level) + { + lt_dlhandle cur = handles; + int saw_nonresident = 0; + + while (cur) + { + lt_dlhandle tmp = cur; + cur = cur->next; + if (!LT_DLIS_RESIDENT (tmp)) + saw_nonresident = 1; + if (!LT_DLIS_RESIDENT (tmp) && tmp->info.ref_count <= level) + { + if (lt_dlclose (tmp)) + { + ++errors; + } + } + } + /* done if only resident modules are left */ + if (!saw_nonresident) + break; + } + + /* close all loaders */ + while (loader) + { + lt_dlloader *next = loader->next; + lt_user_data data = loader->dlloader_data; + if (loader->dlloader_exit && loader->dlloader_exit (data)) + { + ++errors; + } + + LT_DLMEM_REASSIGN (loader, next); + } + loaders = 0; + } + + done: + LT_DLMUTEX_UNLOCK (); + return errors; +} + +static int +tryall_dlopen (handle, filename) + lt_dlhandle *handle; + const char *filename; +{ + lt_dlhandle cur; + lt_dlloader *loader; + const char *saved_error; + int errors = 0; + + LT_DLMUTEX_GETERROR (saved_error); + LT_DLMUTEX_LOCK (); + + cur = handles; + loader = loaders; + + /* check whether the module was already opened */ + while (cur) + { + /* try to dlopen the program itself? */ + if (!cur->info.filename && !filename) + { + break; + } + + if (cur->info.filename && filename + && strcmp (cur->info.filename, filename) == 0) + { + break; + } + + cur = cur->next; + } + + if (cur) + { + ++cur->info.ref_count; + *handle = cur; + goto done; + } + + cur = *handle; + if (filename) + { + /* Comment out the check of file permissions using access. + This call seems to always return -1 with error EACCES. + */ + /* We need to catch missing file errors early so that + file_not_found() can detect what happened. + if (access (filename, R_OK) != 0) + { + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (FILE_NOT_FOUND)); + ++errors; + goto done; + } */ + + cur->info.filename = lt_estrdup (filename); + if (!cur->info.filename) + { + ++errors; + goto done; + } + } + else + { + cur->info.filename = 0; + } + + while (loader) + { + lt_user_data data = loader->dlloader_data; + + cur->module = loader->module_open (data, filename); + + if (cur->module != 0) + { + break; + } + loader = loader->next; + } + + if (!loader) + { + LT_DLFREE (cur->info.filename); + ++errors; + goto done; + } + + cur->loader = loader; + LT_DLMUTEX_SETERROR (saved_error); + + done: + LT_DLMUTEX_UNLOCK (); + + return errors; +} + +static int +tryall_dlopen_module (handle, prefix, dirname, dlname) + lt_dlhandle *handle; + const char *prefix; + const char *dirname; + const char *dlname; +{ + int error = 0; + char *filename = 0; + size_t filename_len = 0; + size_t dirname_len = LT_STRLEN (dirname); + + assert (handle); + assert (dirname); + assert (dlname); +#ifdef LT_DIRSEP_CHAR + /* Only canonicalized names (i.e. with DIRSEP chars already converted) + should make it into this function: */ + assert (strchr (dirname, LT_DIRSEP_CHAR) == 0); +#endif + + if (dirname_len > 0) + if (dirname[dirname_len -1] == '/') + --dirname_len; + filename_len = dirname_len + 1 + LT_STRLEN (dlname); + + /* Allocate memory, and combine DIRNAME and MODULENAME into it. + The PREFIX (if any) is handled below. */ + filename = LT_EMALLOC (char, dirname_len + 1 + filename_len + 1); + if (!filename) + return 1; + + sprintf (filename, "%.*s/%s", (int) dirname_len, dirname, dlname); + + /* Now that we have combined DIRNAME and MODULENAME, if there is + also a PREFIX to contend with, simply recurse with the arguments + shuffled. Otherwise, attempt to open FILENAME as a module. */ + if (prefix) + { + error += tryall_dlopen_module (handle, + (const char *) 0, prefix, filename); + } + else if (tryall_dlopen (handle, filename) != 0) + { + ++error; + } + + LT_DLFREE (filename); + return error; +} + +static int +find_module (handle, dir, libdir, dlname, old_name, installed) + lt_dlhandle *handle; + const char *dir; + const char *libdir; + const char *dlname; + const char *old_name; + int installed; +{ + /* Try to open the old library first; if it was dlpreopened, + we want the preopened version of it, even if a dlopenable + module is available. */ + if (old_name && tryall_dlopen (handle, old_name) == 0) + { + return 0; + } + + /* Try to open the dynamic library. */ + if (dlname) + { + /* try to open the installed module */ + if (installed && libdir) + { + if (tryall_dlopen_module (handle, + (const char *) 0, libdir, dlname) == 0) + return 0; + } + + /* try to open the not-installed module */ + if (!installed) + { + if (tryall_dlopen_module (handle, dir, objdir, dlname) == 0) + return 0; + } + + /* maybe it was moved to another directory */ + { + if (dir && (tryall_dlopen_module (handle, + (const char *) 0, dir, dlname) == 0)) + return 0; + } + } + + return 1; +} + + +static int +canonicalize_path (path, pcanonical) + const char *path; + char **pcanonical; +{ + char *canonical = 0; + + assert (path && *path); + assert (pcanonical); + + canonical = LT_EMALLOC (char, 1+ LT_STRLEN (path)); + if (!canonical) + return 1; + + { + size_t dest = 0; + size_t src; + for (src = 0; path[src] != LT_EOS_CHAR; ++src) + { + /* Path separators are not copied to the beginning or end of + the destination, or if another separator would follow + immediately. */ + if (path[src] == LT_PATHSEP_CHAR) + { + if ((dest == 0) + || (path[1+ src] == LT_PATHSEP_CHAR) + || (path[1+ src] == LT_EOS_CHAR)) + continue; + } + + /* Anything other than a directory separator is copied verbatim. */ + if ((path[src] != '/') +#ifdef LT_DIRSEP_CHAR + && (path[src] != LT_DIRSEP_CHAR) +#endif + ) + { + canonical[dest++] = path[src]; + } + /* Directory separators are converted and copied only if they are + not at the end of a path -- i.e. before a path separator or + NULL terminator. */ + else if ((path[1+ src] != LT_PATHSEP_CHAR) + && (path[1+ src] != LT_EOS_CHAR) +#ifdef LT_DIRSEP_CHAR + && (path[1+ src] != LT_DIRSEP_CHAR) +#endif + && (path[1+ src] != '/')) + { + canonical[dest++] = '/'; + } + } + + /* Add an end-of-string marker at the end. */ + canonical[dest] = LT_EOS_CHAR; + } + + /* Assign new value. */ + *pcanonical = canonical; + + return 0; +} + +static int +argzize_path (path, pargz, pargz_len) + const char *path; + char **pargz; + size_t *pargz_len; +{ + error_t error; + + assert (path); + assert (pargz); + assert (pargz_len); + + if ((error = argz_create_sep (path, LT_PATHSEP_CHAR, pargz, pargz_len))) + { + switch (error) + { + case ENOMEM: + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (NO_MEMORY)); + break; + default: + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (UNKNOWN)); + break; + } + + return 1; + } + + return 0; +} + +/* Repeatedly call FUNC with each LT_PATHSEP_CHAR delimited element + of SEARCH_PATH and references to DATA1 and DATA2, until FUNC returns + non-zero or all elements are exhausted. If BASE_NAME is non-NULL, + it is appended to each SEARCH_PATH element before FUNC is called. */ +static int +foreach_dirinpath (search_path, base_name, func, data1, data2) + const char *search_path; + const char *base_name; + foreach_callback_func *func; + lt_ptr data1; + lt_ptr data2; +{ + int result = 0; + int filenamesize = 0; + size_t lenbase = LT_STRLEN (base_name); + size_t argz_len = 0; + char *argz = 0; + char *filename = 0; + char *canonical = 0; + + LT_DLMUTEX_LOCK (); + + if (!search_path || !*search_path) + { + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (FILE_NOT_FOUND)); + goto cleanup; + } + + if (canonicalize_path (search_path, &canonical) != 0) + goto cleanup; + + if (argzize_path (canonical, &argz, &argz_len) != 0) + goto cleanup; + + { + char *dir_name = 0; + while ((dir_name = argz_next (argz, argz_len, dir_name))) + { + size_t lendir = LT_STRLEN (dir_name); + + if (lendir +1 +lenbase >= filenamesize) + { + LT_DLFREE (filename); + filenamesize = lendir +1 +lenbase +1; /* "/d" + '/' + "f" + '\0' */ + filename = LT_EMALLOC (char, filenamesize); + if (!filename) + goto cleanup; + } + + assert (filenamesize > lendir); + strcpy (filename, dir_name); + + if (base_name && *base_name) + { + if (filename[lendir -1] != '/') + filename[lendir++] = '/'; + strcpy (filename +lendir, base_name); + } + + if ((result = (*func) (filename, data1, data2))) + { + break; + } + } + } + + cleanup: + LT_DLFREE (argz); + LT_DLFREE (canonical); + LT_DLFREE (filename); + + LT_DLMUTEX_UNLOCK (); + + return result; +} + +/* If FILEPATH can be opened, store the name of the directory component + in DATA1, and the opened FILE* structure address in DATA2. Otherwise + DATA1 is unchanged, but DATA2 is set to a pointer to NULL. */ +static int +find_file_callback (filename, data1, data2) + char *filename; + lt_ptr data1; + lt_ptr data2; +{ + char **pdir = (char **) data1; + FILE **pfile = (FILE **) data2; + int is_done = 0; + + assert (filename && *filename); + assert (pdir); + assert (pfile); + + if ((*pfile = fopen (filename, LT_READTEXT_MODE))) + { + char *dirend = strrchr (filename, '/'); + + if (dirend > filename) + *dirend = LT_EOS_CHAR; + + LT_DLFREE (*pdir); + *pdir = lt_estrdup (filename); + is_done = (*pdir == 0) ? -1 : 1; + } + + return is_done; +} + +static FILE * +find_file (search_path, base_name, pdir) + const char *search_path; + const char *base_name; + char **pdir; +{ + FILE *file = 0; + + foreach_dirinpath (search_path, base_name, find_file_callback, pdir, &file); + + return file; +} + +static int +find_handle_callback (filename, data, ignored) + char *filename; + lt_ptr data; + lt_ptr ignored; +{ + lt_dlhandle *handle = (lt_dlhandle *) data; + int notfound = access (filename, R_OK); + + /* Bail out if file cannot be read... */ + if (notfound) + return 0; + + /* Try to dlopen the file, but do not continue searching in any + case. */ + if (tryall_dlopen (handle, filename) != 0) + *handle = 0; + + return 1; +} + +/* If HANDLE was found return it, otherwise return 0. If HANDLE was + found but could not be opened, *HANDLE will be set to 0. */ +static lt_dlhandle * +find_handle (search_path, base_name, handle) + const char *search_path; + const char *base_name; + lt_dlhandle *handle; +{ + if (!search_path) + return 0; + + if (!foreach_dirinpath (search_path, base_name, find_handle_callback, + handle, 0)) + return 0; + + return handle; +} + +static int +load_deplibs (handle, deplibs) + lt_dlhandle handle; + char *deplibs; +{ +#if LTDL_DLOPEN_DEPLIBS + char *p, *save_search_path = 0; + int depcount = 0; + int i; + char **names = 0; +#endif + int errors = 0; + + handle->depcount = 0; + +#if LTDL_DLOPEN_DEPLIBS + if (!deplibs) + { + return errors; + } + ++errors; + + LT_DLMUTEX_LOCK (); + if (user_search_path) + { + save_search_path = lt_estrdup (user_search_path); + if (!save_search_path) + goto cleanup; + } + + /* extract search paths and count deplibs */ + p = deplibs; + while (*p) + { + if (!isspace ((int) *p)) + { + char *end = p+1; + while (*end && !isspace((int) *end)) + { + ++end; + } + + if (strncmp(p, "-L", 2) == 0 || strncmp(p, "-R", 2) == 0) + { + char save = *end; + *end = 0; /* set a temporary string terminator */ + if (lt_dladdsearchdir(p+2)) + { + goto cleanup; + } + *end = save; + } + else + { + ++depcount; + } + + p = end; + } + else + { + ++p; + } + } + + if (!depcount) + { + errors = 0; + goto cleanup; + } + + names = LT_EMALLOC (char *, depcount * sizeof (char*)); + if (!names) + goto cleanup; + + /* now only extract the actual deplibs */ + depcount = 0; + p = deplibs; + while (*p) + { + if (isspace ((int) *p)) + { + ++p; + } + else + { + char *end = p+1; + while (*end && !isspace ((int) *end)) + { + ++end; + } + + if (strncmp(p, "-L", 2) != 0 && strncmp(p, "-R", 2) != 0) + { + char *name; + char save = *end; + *end = 0; /* set a temporary string terminator */ + if (strncmp(p, "-l", 2) == 0) + { + size_t name_len = 3+ /* "lib" */ LT_STRLEN (p + 2); + name = LT_EMALLOC (char, 1+ name_len); + if (name) + sprintf (name, "lib%s", p+2); + } + else + name = lt_estrdup(p); + + if (!name) + goto cleanup_names; + + names[depcount++] = name; + *end = save; + } + p = end; + } + } + + /* load the deplibs (in reverse order) + At this stage, don't worry if the deplibs do not load correctly, + they may already be statically linked into the loading application + for instance. There will be a more enlightening error message + later on if the loaded module cannot resolve all of its symbols. */ + if (depcount) + { + int j = 0; + + handle->deplibs = (lt_dlhandle*) LT_EMALLOC (lt_dlhandle *, depcount); + if (!handle->deplibs) + goto cleanup_names; + + for (i = 0; i < depcount; ++i) + { + handle->deplibs[j] = lt_dlopenext(names[depcount-1-i]); + if (handle->deplibs[j]) + { + ++j; + } + } + + handle->depcount = j; /* Number of successfully loaded deplibs */ + errors = 0; + } + + cleanup_names: + for (i = 0; i < depcount; ++i) + { + LT_DLFREE (names[i]); + } + + cleanup: + LT_DLFREE (names); + /* restore the old search path */ + if (user_search_path) { + LT_DLFREE (user_search_path); + user_search_path = save_search_path; + } + LT_DLMUTEX_UNLOCK (); + +#endif + + return errors; +} + +static int +unload_deplibs (handle) + lt_dlhandle handle; +{ + int i; + int errors = 0; + + if (handle->depcount) + { + for (i = 0; i < handle->depcount; ++i) + { + if (!LT_DLIS_RESIDENT (handle->deplibs[i])) + { + errors += lt_dlclose (handle->deplibs[i]); + } + } + LT_DLFREE (handle->deplibs); + } + + return errors; +} + +static int +trim (dest, str) + char **dest; + const char *str; +{ + /* remove the leading and trailing "'" from str + and store the result in dest */ + const char *end = strrchr (str, '\''); + size_t len = LT_STRLEN (str); + char *tmp; + + LT_DLFREE (*dest); + + if (!end) + return 1; + + if (len > 3 && str[0] == '\'') + { + tmp = LT_EMALLOC (char, end - str); + if (!tmp) + return 1; + + strncpy(tmp, &str[1], (end - str) - 1); + tmp[len-3] = LT_EOS_CHAR; + *dest = tmp; + } + else + { + *dest = 0; + } + + return 0; +} + +static int +free_vars (dlname, oldname, libdir, deplibs) + char *dlname; + char *oldname; + char *libdir; + char *deplibs; +{ + LT_DLFREE (dlname); + LT_DLFREE (oldname); + LT_DLFREE (libdir); + LT_DLFREE (deplibs); + + return 0; +} + +static int +try_dlopen (phandle, filename) + lt_dlhandle *phandle; + const char *filename; +{ + const char * ext = 0; + const char * saved_error = 0; + char * canonical = 0; + char * base_name = 0; + char * dir = 0; + char * name = 0; + int errors = 0; + lt_dlhandle newhandle; + + assert (phandle); + assert (*phandle == 0); + + LT_DLMUTEX_GETERROR (saved_error); + + /* dlopen self? */ + if (!filename) + { + *phandle = (lt_dlhandle) LT_EMALLOC (struct lt_dlhandle_struct, 1); + if (*phandle == 0) + return 1; + + memset (*phandle, 0, sizeof(struct lt_dlhandle_struct)); + newhandle = *phandle; + + /* lt_dlclose()ing yourself is very bad! Disallow it. */ + LT_DLSET_FLAG (*phandle, LT_DLRESIDENT_FLAG); + + if (tryall_dlopen (&newhandle, 0) != 0) + { + LT_DLFREE (*phandle); + return 1; + } + + goto register_handle; + } + + assert (filename && *filename); + + /* Doing this immediately allows internal functions to safely + assume only canonicalized paths are passed. */ + if (canonicalize_path (filename, &canonical) != 0) + { + ++errors; + goto cleanup; + } + + /* If the canonical module name is a path (relative or absolute) + then split it into a directory part and a name part. */ + base_name = strrchr (canonical, '/'); + if (base_name) + { + size_t dirlen = (1+ base_name) - canonical; + + dir = LT_EMALLOC (char, 1+ dirlen); + if (!dir) + { + ++errors; + goto cleanup; + } + + strncpy (dir, canonical, dirlen); + dir[dirlen] = LT_EOS_CHAR; + + ++base_name; + } + else + base_name = canonical; + + assert (base_name && *base_name); + + /* Check whether we are opening a libtool module (.la extension). */ + ext = strrchr (base_name, '.'); + if (ext && strcmp (ext, archive_ext) == 0) + { + /* this seems to be a libtool module */ + FILE * file = 0; + char * dlname = 0; + char * old_name = 0; + char * libdir = 0; + char * deplibs = 0; + char * line = 0; + size_t line_len; + + /* if we can't find the installed flag, it is probably an + installed libtool archive, produced with an old version + of libtool */ + int installed = 1; + + /* extract the module name from the file name */ + name = LT_EMALLOC (char, ext - base_name + 1); + if (!name) + { + ++errors; + goto cleanup; + } + + /* canonicalize the module name */ + { + size_t i; + for (i = 0; i < ext - base_name; ++i) + { + if (isalnum ((int)(base_name[i]))) + { + name[i] = base_name[i]; + } + else + { + name[i] = '_'; + } + } + name[ext - base_name] = LT_EOS_CHAR; + } + + /* Now try to open the .la file. If there is no directory name + component, try to find it first in user_search_path and then other + prescribed paths. Otherwise (or in any case if the module was not + yet found) try opening just the module name as passed. */ + if (!dir) + { + const char *search_path; + + LT_DLMUTEX_LOCK (); + search_path = user_search_path; + if (search_path) + file = find_file (user_search_path, base_name, &dir); + LT_DLMUTEX_UNLOCK (); + + if (!file) + { + search_path = getenv (LTDL_SEARCHPATH_VAR); + if (search_path) + file = find_file (search_path, base_name, &dir); + } + +#ifdef LTDL_SHLIBPATH_VAR + if (!file) + { + search_path = getenv (LTDL_SHLIBPATH_VAR); + if (search_path) + file = find_file (search_path, base_name, &dir); + } +#endif +#ifdef LTDL_SYSSEARCHPATH + if (!file && sys_search_path) + { + file = find_file (sys_search_path, base_name, &dir); + } +#endif + } + if (!file) + { + file = fopen (filename, LT_READTEXT_MODE); + } + + /* If we didn't find the file by now, it really isn't there. Set + the status flag, and bail out. */ + if (!file) + { + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (FILE_NOT_FOUND)); + ++errors; + goto cleanup; + } + + line_len = LT_FILENAME_MAX; + line = LT_EMALLOC (char, line_len); + if (!line) + { + fclose (file); + ++errors; + goto cleanup; + } + + /* read the .la file */ + while (!feof (file)) + { + if (!fgets (line, (int) line_len, file)) + { + break; + } + + /* Handle the case where we occasionally need to read a line + that is longer than the initial buffer size. */ + while ((line[LT_STRLEN(line) -1] != '\n') && (!feof (file))) + { + line = LT_DLREALLOC (char, line, line_len *2); + if (!fgets (&line[line_len -1], (int) line_len +1, file)) + { + break; + } + line_len *= 2; + } + + if (line[0] == '\n' || line[0] == '#') + { + continue; + } + +#undef STR_DLNAME +#define STR_DLNAME "dlname=" + if (strncmp (line, STR_DLNAME, sizeof (STR_DLNAME) - 1) == 0) + { + errors += trim (&dlname, &line[sizeof (STR_DLNAME) - 1]); + } + +#undef STR_OLD_LIBRARY +#define STR_OLD_LIBRARY "old_library=" + else if (strncmp (line, STR_OLD_LIBRARY, + sizeof (STR_OLD_LIBRARY) - 1) == 0) + { + errors += trim (&old_name, &line[sizeof (STR_OLD_LIBRARY) - 1]); + } +#undef STR_LIBDIR +#define STR_LIBDIR "libdir=" + else if (strncmp (line, STR_LIBDIR, sizeof (STR_LIBDIR) - 1) == 0) + { + errors += trim (&libdir, &line[sizeof(STR_LIBDIR) - 1]); + } + +#undef STR_DL_DEPLIBS +#define STR_DL_DEPLIBS "dependency_libs=" + else if (strncmp (line, STR_DL_DEPLIBS, + sizeof (STR_DL_DEPLIBS) - 1) == 0) + { + errors += trim (&deplibs, &line[sizeof (STR_DL_DEPLIBS) - 1]); + } + else if (strcmp (line, "installed=yes\n") == 0) + { + installed = 1; + } + else if (strcmp (line, "installed=no\n") == 0) + { + installed = 0; + } + +#undef STR_LIBRARY_NAMES +#define STR_LIBRARY_NAMES "library_names=" + else if (! dlname && strncmp (line, STR_LIBRARY_NAMES, + sizeof (STR_LIBRARY_NAMES) - 1) == 0) + { + char *last_libname; + errors += trim (&dlname, &line[sizeof (STR_LIBRARY_NAMES) - 1]); + if (!errors + && dlname + && (last_libname = strrchr (dlname, ' ')) != 0) + { + last_libname = lt_estrdup (last_libname + 1); + if (!last_libname) + { + ++errors; + goto cleanup; + } + LT_DLMEM_REASSIGN (dlname, last_libname); + } + } + + if (errors) + break; + } + + fclose (file); + LT_DLFREE (line); + + /* allocate the handle */ + *phandle = (lt_dlhandle) LT_EMALLOC (struct lt_dlhandle_struct, 1); + if (*phandle == 0) + ++errors; + + if (errors) + { + free_vars (dlname, old_name, libdir, deplibs); + LT_DLFREE (*phandle); + goto cleanup; + } + + assert (*phandle); + + memset (*phandle, 0, sizeof(struct lt_dlhandle_struct)); + if (load_deplibs (*phandle, deplibs) == 0) + { + newhandle = *phandle; + /* find_module may replace newhandle */ + if (find_module (&newhandle, dir, libdir, dlname, old_name, installed)) + { + unload_deplibs (*phandle); + ++errors; + } + } + else + { + ++errors; + } + + free_vars (dlname, old_name, libdir, deplibs); + if (errors) + { + LT_DLFREE (*phandle); + goto cleanup; + } + + if (*phandle != newhandle) + { + unload_deplibs (*phandle); + } + } + else + { + /* not a libtool module */ + *phandle = (lt_dlhandle) LT_EMALLOC (struct lt_dlhandle_struct, 1); + if (*phandle == 0) + { + ++errors; + goto cleanup; + } + + memset (*phandle, 0, sizeof (struct lt_dlhandle_struct)); + newhandle = *phandle; + + /* If the module has no directory name component, try to find it + first in user_search_path and then other prescribed paths. + Otherwise (or in any case if the module was not yet found) try + opening just the module name as passed. */ + if ((dir || (!find_handle (user_search_path, base_name, &newhandle) + && !find_handle (getenv (LTDL_SEARCHPATH_VAR), base_name, + &newhandle) +#ifdef LTDL_SHLIBPATH_VAR + && !find_handle (getenv (LTDL_SHLIBPATH_VAR), base_name, + &newhandle) +#endif +#ifdef LTDL_SYSSEARCHPATH + && !find_handle (sys_search_path, base_name, &newhandle) +#endif + ))) + { + if (tryall_dlopen (&newhandle, filename) != 0) + { + newhandle = NULL; + } + } + + if (!newhandle) + { + LT_DLFREE (*phandle); + ++errors; + goto cleanup; + } + } + + register_handle: + LT_DLMEM_REASSIGN (*phandle, newhandle); + + if ((*phandle)->info.ref_count == 0) + { + (*phandle)->info.ref_count = 1; + LT_DLMEM_REASSIGN ((*phandle)->info.name, name); + + LT_DLMUTEX_LOCK (); + (*phandle)->next = handles; + handles = *phandle; + LT_DLMUTEX_UNLOCK (); + } + + LT_DLMUTEX_SETERROR (saved_error); + + cleanup: + LT_DLFREE (dir); + LT_DLFREE (name); + LT_DLFREE (canonical); + + return errors; +} + +lt_dlhandle +lt_dlopen (filename) + const char *filename; +{ + lt_dlhandle handle = 0; + + /* Just incase we missed a code path in try_dlopen() that reports + an error, but forgets to reset handle... */ + if (try_dlopen (&handle, filename) != 0) + return 0; + + return handle; +} + +/* If the last error messge store was `FILE_NOT_FOUND', then return + non-zero. */ +static int +file_not_found () +{ + const char *error = 0; + + LT_DLMUTEX_GETERROR (error); + if (error == LT_DLSTRERROR (FILE_NOT_FOUND)) + return 1; + + return 0; +} + +/* If FILENAME has an ARCHIVE_EXT or SHLIB_EXT extension, try to + open the FILENAME as passed. Otherwise try appending ARCHIVE_EXT, + and if a file is still not found try again with SHLIB_EXT appended + instead. */ +lt_dlhandle +lt_dlopenext (filename) + const char *filename; +{ + lt_dlhandle handle = 0; + char * tmp = 0; + char * ext = 0; + size_t len; + int errors = 0; + + if (!filename) + { + return lt_dlopen (filename); + } + + assert (filename); + + len = LT_STRLEN (filename); + ext = strrchr (filename, '.'); + + /* If FILENAME already bears a suitable extension, there is no need + to try appending additional extensions. */ + if (ext && ((strcmp (ext, archive_ext) == 0) +#ifdef LTDL_SHLIB_EXT + || (strcmp (ext, shlib_ext) == 0) +#endif + )) + { + return lt_dlopen (filename); + } + + /* First try appending ARCHIVE_EXT. */ + tmp = LT_EMALLOC (char, len + LT_STRLEN (archive_ext) + 1); + if (!tmp) + return 0; + + strcpy (tmp, filename); + strcat (tmp, archive_ext); + errors = try_dlopen (&handle, tmp); + + /* If we found FILENAME, stop searching -- whether we were able to + load the file as a module or not. If the file exists but loading + failed, it is better to return an error message here than to + report FILE_NOT_FOUND when the alternatives (foo.so etc) are not + in the module search path. */ + if (handle || ((errors > 0) && !file_not_found ())) + { + LT_DLFREE (tmp); + return handle; + } + +#ifdef LTDL_SHLIB_EXT + /* Try appending SHLIB_EXT. */ + if (LT_STRLEN (shlib_ext) > LT_STRLEN (archive_ext)) + { + LT_DLFREE (tmp); + tmp = LT_EMALLOC (char, len + LT_STRLEN (shlib_ext) + 1); + if (!tmp) + return 0; + + strcpy (tmp, filename); + } + else + { + tmp[len] = LT_EOS_CHAR; + } + + strcat(tmp, shlib_ext); + errors = try_dlopen (&handle, tmp); + + /* As before, if the file was found but loading failed, return now + with the current error message. */ + if (handle || ((errors > 0) && !file_not_found ())) + { + LT_DLFREE (tmp); + return handle; + } +#endif + + /* Still here? Then we really did fail to locate any of the file + names we tried. */ + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (FILE_NOT_FOUND)); + LT_DLFREE (tmp); + return 0; +} + + +static int +lt_argz_insert (pargz, pargz_len, before, entry) + char **pargz; + size_t *pargz_len; + char *before; + const char *entry; +{ + error_t error; + + /* Prior to Sep 8, 2005, newlib had a bug where argz_insert(pargz, + pargz_len, NULL, entry) failed with EINVAL. */ + if (before) + error = argz_insert (pargz, pargz_len, before, entry); + else + error = argz_append (pargz, pargz_len, entry, 1 + LT_STRLEN (entry)); + + if (error) + { + switch (error) + { + case ENOMEM: + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (NO_MEMORY)); + break; + default: + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (UNKNOWN)); + break; + } + return 1; + } + + return 0; +} + +static int +lt_argz_insertinorder (pargz, pargz_len, entry) + char **pargz; + size_t *pargz_len; + const char *entry; +{ + char *before = 0; + + assert (pargz); + assert (pargz_len); + assert (entry && *entry); + + if (*pargz) + while ((before = argz_next (*pargz, *pargz_len, before))) + { + int cmp = strcmp (entry, before); + + if (cmp < 0) break; + if (cmp == 0) return 0; /* No duplicates! */ + } + + return lt_argz_insert (pargz, pargz_len, before, entry); +} + +static int +lt_argz_insertdir (pargz, pargz_len, dirnam, dp) + char **pargz; + size_t *pargz_len; + const char *dirnam; + struct dirent *dp; +{ + char *buf = 0; + size_t buf_len = 0; + char *end = 0; + size_t end_offset = 0; + size_t dir_len = 0; + int errors = 0; + + assert (pargz); + assert (pargz_len); + assert (dp); + + dir_len = LT_STRLEN (dirnam); + end = dp->d_name + LT_D_NAMLEN(dp); + + /* Ignore version numbers. */ + { + char *p; + for (p = end; p -1 > dp->d_name; --p) + if (strchr (".0123456789", p[-1]) == 0) + break; + + if (*p == '.') + end = p; + } + + /* Ignore filename extension. */ + { + char *p; + for (p = end -1; p > dp->d_name; --p) + if (*p == '.') + { + end = p; + break; + } + } + + /* Prepend the directory name. */ + end_offset = end - dp->d_name; + buf_len = dir_len + 1+ end_offset; + buf = LT_EMALLOC (char, 1+ buf_len); + if (!buf) + return ++errors; + + assert (buf); + + strcpy (buf, dirnam); + strcat (buf, "/"); + strncat (buf, dp->d_name, end_offset); + buf[buf_len] = LT_EOS_CHAR; + + /* Try to insert (in order) into ARGZ/ARGZ_LEN. */ + if (lt_argz_insertinorder (pargz, pargz_len, buf) != 0) + ++errors; + + LT_DLFREE (buf); + + return errors; +} + +static int +list_files_by_dir (dirnam, pargz, pargz_len) + const char *dirnam; + char **pargz; + size_t *pargz_len; +{ + DIR *dirp = 0; + int errors = 0; + + assert (dirnam && *dirnam); + assert (pargz); + assert (pargz_len); + assert (dirnam[LT_STRLEN(dirnam) -1] != '/'); + + dirp = opendir (dirnam); + if (dirp) + { + struct dirent *dp = 0; + + while ((dp = readdir (dirp))) + if (dp->d_name[0] != '.') + if (lt_argz_insertdir (pargz, pargz_len, dirnam, dp)) + { + ++errors; + break; + } + + closedir (dirp); + } + else + ++errors; + + return errors; +} + + +/* If there are any files in DIRNAME, call the function passed in + DATA1 (with the name of each file and DATA2 as arguments). */ +static int +foreachfile_callback (dirname, data1, data2) + char *dirname; + lt_ptr data1; + lt_ptr data2; +{ + int (*func) LT_PARAMS((const char *filename, lt_ptr data)) + = (int (*) LT_PARAMS((const char *filename, lt_ptr data))) data1; + + int is_done = 0; + char *argz = 0; + size_t argz_len = 0; + + if (list_files_by_dir (dirname, &argz, &argz_len) != 0) + goto cleanup; + if (!argz) + goto cleanup; + + { + char *filename = 0; + while ((filename = argz_next (argz, argz_len, filename))) + if ((is_done = (*func) (filename, data2))) + break; + } + + cleanup: + LT_DLFREE (argz); + + return is_done; +} + + +/* Call FUNC for each unique extensionless file in SEARCH_PATH, along + with DATA. The filenames passed to FUNC would be suitable for + passing to lt_dlopenext. The extensions are stripped so that + individual modules do not generate several entries (e.g. libfoo.la, + libfoo.so, libfoo.so.1, libfoo.so.1.0.0). If SEARCH_PATH is NULL, + then the same directories that lt_dlopen would search are examined. */ +int +lt_dlforeachfile (search_path, func, data) + const char *search_path; + int (*func) LT_PARAMS ((const char *filename, lt_ptr data)); + lt_ptr data; +{ + int is_done = 0; + + if (search_path) + { + /* If a specific path was passed, search only the directories + listed in it. */ + is_done = foreach_dirinpath (search_path, 0, + foreachfile_callback, func, data); + } + else + { + /* Otherwise search the default paths. */ + is_done = foreach_dirinpath (user_search_path, 0, + foreachfile_callback, func, data); + if (!is_done) + { + is_done = foreach_dirinpath (getenv("LTDL_LIBRARY_PATH"), 0, + foreachfile_callback, func, data); + } + +#ifdef LTDL_SHLIBPATH_VAR + if (!is_done) + { + is_done = foreach_dirinpath (getenv(LTDL_SHLIBPATH_VAR), 0, + foreachfile_callback, func, data); + } +#endif +#ifdef LTDL_SYSSEARCHPATH + if (!is_done) + { + is_done = foreach_dirinpath (getenv(LTDL_SYSSEARCHPATH), 0, + foreachfile_callback, func, data); + } +#endif + } + + return is_done; +} + +int +lt_dlclose (handle) + lt_dlhandle handle; +{ + lt_dlhandle cur, last; + int errors = 0; + + LT_DLMUTEX_LOCK (); + + /* check whether the handle is valid */ + last = cur = handles; + while (cur && handle != cur) + { + last = cur; + cur = cur->next; + } + + if (!cur) + { + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (INVALID_HANDLE)); + ++errors; + goto done; + } + + handle->info.ref_count--; + + /* Note that even with resident modules, we must track the ref_count + correctly incase the user decides to reset the residency flag + later (even though the API makes no provision for that at the + moment). */ + if (handle->info.ref_count <= 0 && !LT_DLIS_RESIDENT (handle)) + { + lt_user_data data = handle->loader->dlloader_data; + + if (handle != handles) + { + last->next = handle->next; + } + else + { + handles = handle->next; + } + + errors += handle->loader->module_close (data, handle->module); + errors += unload_deplibs(handle); + + /* It is up to the callers to free the data itself. */ + LT_DLFREE (handle->caller_data); + + LT_DLFREE (handle->info.filename); + LT_DLFREE (handle->info.name); + LT_DLFREE (handle); + + goto done; + } + + if (LT_DLIS_RESIDENT (handle)) + { + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (CLOSE_RESIDENT_MODULE)); + ++errors; + } + + done: + LT_DLMUTEX_UNLOCK (); + + return errors; +} + +lt_ptr +lt_dlsym (handle, symbol) + lt_dlhandle handle; + const char *symbol; +{ + size_t lensym; + char lsym[LT_SYMBOL_LENGTH]; + char *sym; + lt_ptr address; + lt_user_data data; + + if (!handle) + { + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (INVALID_HANDLE)); + return 0; + } + + if (!symbol) + { + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (SYMBOL_NOT_FOUND)); + return 0; + } + + lensym = LT_STRLEN (symbol) + LT_STRLEN (handle->loader->sym_prefix) + + LT_STRLEN (handle->info.name); + + if (lensym + LT_SYMBOL_OVERHEAD < LT_SYMBOL_LENGTH) + { + sym = lsym; + } + else + { + sym = LT_EMALLOC (char, lensym + LT_SYMBOL_OVERHEAD + 1); + if (!sym) + { + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (BUFFER_OVERFLOW)); + return 0; + } + } + + data = handle->loader->dlloader_data; + if (handle->info.name) + { + const char *saved_error; + + LT_DLMUTEX_GETERROR (saved_error); + + /* this is a libtool module */ + if (handle->loader->sym_prefix) + { + strcpy(sym, handle->loader->sym_prefix); + strcat(sym, handle->info.name); + } + else + { + strcpy(sym, handle->info.name); + } + + strcat(sym, "_LTX_"); + strcat(sym, symbol); + + /* try "modulename_LTX_symbol" */ + address = handle->loader->find_sym (data, handle->module, sym); + if (address) + { + if (sym != lsym) + { + LT_DLFREE (sym); + } + return address; + } + LT_DLMUTEX_SETERROR (saved_error); + } + + /* otherwise try "symbol" */ + if (handle->loader->sym_prefix) + { + strcpy(sym, handle->loader->sym_prefix); + strcat(sym, symbol); + } + else + { + strcpy(sym, symbol); + } + + address = handle->loader->find_sym (data, handle->module, sym); + if (sym != lsym) + { + LT_DLFREE (sym); + } + + return address; +} + +const char * +lt_dlerror () +{ + const char *error; + + LT_DLMUTEX_GETERROR (error); + LT_DLMUTEX_SETERROR (0); + + return error ? error : NULL; +} + +static int +lt_dlpath_insertdir (ppath, before, dir) + char **ppath; + char *before; + const char *dir; +{ + int errors = 0; + char *canonical = 0; + char *argz = 0; + size_t argz_len = 0; + + assert (ppath); + assert (dir && *dir); + + if (canonicalize_path (dir, &canonical) != 0) + { + ++errors; + goto cleanup; + } + + assert (canonical && *canonical); + + /* If *PPATH is empty, set it to DIR. */ + if (*ppath == 0) + { + assert (!before); /* BEFORE cannot be set without PPATH. */ + assert (dir); /* Without DIR, don't call this function! */ + + *ppath = lt_estrdup (dir); + if (*ppath == 0) + ++errors; + + return errors; + } + + assert (ppath && *ppath); + + if (argzize_path (*ppath, &argz, &argz_len) != 0) + { + ++errors; + goto cleanup; + } + + /* Convert BEFORE into an equivalent offset into ARGZ. This only works + if *PPATH is already canonicalized, and hence does not change length + with respect to ARGZ. We canonicalize each entry as it is added to + the search path, and don't call this function with (uncanonicalized) + user paths, so this is a fair assumption. */ + if (before) + { + assert (*ppath <= before); + assert (before - *ppath <= strlen (*ppath)); + + before = before - *ppath + argz; + } + + if (lt_argz_insert (&argz, &argz_len, before, dir) != 0) + { + ++errors; + goto cleanup; + } + + argz_stringify (argz, argz_len, LT_PATHSEP_CHAR); + LT_DLMEM_REASSIGN (*ppath, argz); + + cleanup: + LT_DLFREE (canonical); + LT_DLFREE (argz); + + return errors; +} + +int +lt_dladdsearchdir (search_dir) + const char *search_dir; +{ + int errors = 0; + + if (search_dir && *search_dir) + { + LT_DLMUTEX_LOCK (); + if (lt_dlpath_insertdir (&user_search_path, 0, search_dir) != 0) + ++errors; + LT_DLMUTEX_UNLOCK (); + } + + return errors; +} + +int +lt_dlinsertsearchdir (before, search_dir) + const char *before; + const char *search_dir; +{ + int errors = 0; + + if (before) + { + LT_DLMUTEX_LOCK (); + if ((before < user_search_path) + || (before >= user_search_path + LT_STRLEN (user_search_path))) + { + LT_DLMUTEX_UNLOCK (); + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (INVALID_POSITION)); + return 1; + } + LT_DLMUTEX_UNLOCK (); + } + + if (search_dir && *search_dir) + { + LT_DLMUTEX_LOCK (); + if (lt_dlpath_insertdir (&user_search_path, + (char *) before, search_dir) != 0) + { + ++errors; + } + LT_DLMUTEX_UNLOCK (); + } + + return errors; +} + +int +lt_dlsetsearchpath (search_path) + const char *search_path; +{ + int errors = 0; + + LT_DLMUTEX_LOCK (); + LT_DLFREE (user_search_path); + LT_DLMUTEX_UNLOCK (); + + if (!search_path || !LT_STRLEN (search_path)) + { + return errors; + } + + LT_DLMUTEX_LOCK (); + if (canonicalize_path (search_path, &user_search_path) != 0) + ++errors; + LT_DLMUTEX_UNLOCK (); + + return errors; +} + +const char * +lt_dlgetsearchpath () +{ + const char *saved_path; + + LT_DLMUTEX_LOCK (); + saved_path = user_search_path; + LT_DLMUTEX_UNLOCK (); + + return saved_path; +} + +int +lt_dlmakeresident (handle) + lt_dlhandle handle; +{ + int errors = 0; + + if (!handle) + { + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (INVALID_HANDLE)); + ++errors; + } + else + { + LT_DLSET_FLAG (handle, LT_DLRESIDENT_FLAG); + } + + return errors; +} + +int +lt_dlisresident (handle) + lt_dlhandle handle; +{ + if (!handle) + { + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (INVALID_HANDLE)); + return -1; + } + + return LT_DLIS_RESIDENT (handle); +} + + + + +/* --- MODULE INFORMATION --- */ + +const lt_dlinfo * +lt_dlgetinfo (handle) + lt_dlhandle handle; +{ + if (!handle) + { + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (INVALID_HANDLE)); + return 0; + } + + return &(handle->info); +} + +lt_dlhandle +lt_dlhandle_next (place) + lt_dlhandle place; +{ + return place ? place->next : handles; +} + +int +lt_dlforeach (func, data) + int (*func) LT_PARAMS((lt_dlhandle handle, lt_ptr data)); + lt_ptr data; +{ + int errors = 0; + lt_dlhandle cur; + + LT_DLMUTEX_LOCK (); + + cur = handles; + while (cur) + { + lt_dlhandle tmp = cur; + + cur = cur->next; + if ((*func) (tmp, data)) + { + ++errors; + break; + } + } + + LT_DLMUTEX_UNLOCK (); + + return errors; +} + +lt_dlcaller_id +lt_dlcaller_register () +{ + static lt_dlcaller_id last_caller_id = 0; + int result; + + LT_DLMUTEX_LOCK (); + result = ++last_caller_id; + LT_DLMUTEX_UNLOCK (); + + return result; +} + +lt_ptr +lt_dlcaller_set_data (key, handle, data) + lt_dlcaller_id key; + lt_dlhandle handle; + lt_ptr data; +{ + int n_elements = 0; + lt_ptr stale = (lt_ptr) 0; + int i; + + /* This needs to be locked so that the caller data can be updated + simultaneously by different threads. */ + LT_DLMUTEX_LOCK (); + + if (handle->caller_data) + while (handle->caller_data[n_elements].key) + ++n_elements; + + for (i = 0; i < n_elements; ++i) + { + if (handle->caller_data[i].key == key) + { + stale = handle->caller_data[i].data; + break; + } + } + + /* Ensure that there is enough room in this handle's caller_data + array to accept a new element (and an empty end marker). */ + if (i == n_elements) + { + lt_caller_data *temp + = LT_DLREALLOC (lt_caller_data, handle->caller_data, 2+ n_elements); + + if (!temp) + { + stale = 0; + goto done; + } + + handle->caller_data = temp; + + /* We only need this if we needed to allocate a new caller_data. */ + handle->caller_data[i].key = key; + handle->caller_data[1+ i].key = 0; + } + + handle->caller_data[i].data = data; + + done: + LT_DLMUTEX_UNLOCK (); + + return stale; +} + +lt_ptr +lt_dlcaller_get_data (key, handle) + lt_dlcaller_id key; + lt_dlhandle handle; +{ + lt_ptr result = (lt_ptr) 0; + + /* This needs to be locked so that the caller data isn't updated by + another thread part way through this function. */ + LT_DLMUTEX_LOCK (); + + /* Locate the index of the element with a matching KEY. */ + { + int i; + for (i = 0; handle->caller_data[i].key; ++i) + { + if (handle->caller_data[i].key == key) + { + result = handle->caller_data[i].data; + break; + } + } + } + + LT_DLMUTEX_UNLOCK (); + + return result; +} + + + +/* --- USER MODULE LOADER API --- */ + + +int +lt_dlloader_add (place, dlloader, loader_name) + lt_dlloader *place; + const struct lt_user_dlloader *dlloader; + const char *loader_name; +{ + int errors = 0; + lt_dlloader *node = 0, *ptr = 0; + + if ((dlloader == 0) /* diagnose null parameters */ + || (dlloader->module_open == 0) + || (dlloader->module_close == 0) + || (dlloader->find_sym == 0)) + { + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (INVALID_LOADER)); + return 1; + } + + /* Create a new dlloader node with copies of the user callbacks. */ + node = LT_EMALLOC (lt_dlloader, 1); + if (!node) + return 1; + + node->next = 0; + node->loader_name = loader_name; + node->sym_prefix = dlloader->sym_prefix; + node->dlloader_exit = dlloader->dlloader_exit; + node->module_open = dlloader->module_open; + node->module_close = dlloader->module_close; + node->find_sym = dlloader->find_sym; + node->dlloader_data = dlloader->dlloader_data; + + LT_DLMUTEX_LOCK (); + if (!loaders) + { + /* If there are no loaders, NODE becomes the list! */ + loaders = node; + } + else if (!place) + { + /* If PLACE is not set, add NODE to the end of the + LOADERS list. */ + for (ptr = loaders; ptr->next; ptr = ptr->next) + { + /*NOWORK*/; + } + + ptr->next = node; + } + else if (loaders == place) + { + /* If PLACE is the first loader, NODE goes first. */ + node->next = place; + loaders = node; + } + else + { + /* Find the node immediately preceding PLACE. */ + for (ptr = loaders; ptr->next != place; ptr = ptr->next) + { + /*NOWORK*/; + } + + if (ptr->next != place) + { + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (INVALID_LOADER)); + ++errors; + } + else + { + /* Insert NODE between PTR and PLACE. */ + node->next = place; + ptr->next = node; + } + } + + LT_DLMUTEX_UNLOCK (); + + return errors; +} + +int +lt_dlloader_remove (loader_name) + const char *loader_name; +{ + lt_dlloader *place = lt_dlloader_find (loader_name); + lt_dlhandle handle; + int errors = 0; + + if (!place) + { + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (INVALID_LOADER)); + return 1; + } + + LT_DLMUTEX_LOCK (); + + /* Fail if there are any open modules which use this loader. */ + for (handle = handles; handle; handle = handle->next) + { + if (handle->loader == place) + { + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (REMOVE_LOADER)); + ++errors; + goto done; + } + } + + if (place == loaders) + { + /* PLACE is the first loader in the list. */ + loaders = loaders->next; + } + else + { + /* Find the loader before the one being removed. */ + lt_dlloader *prev; + for (prev = loaders; prev->next; prev = prev->next) + { + if (!strcmp (prev->next->loader_name, loader_name)) + { + break; + } + } + + place = prev->next; + prev->next = prev->next->next; + } + + if (place->dlloader_exit) + { + errors = place->dlloader_exit (place->dlloader_data); + } + + LT_DLFREE (place); + + done: + LT_DLMUTEX_UNLOCK (); + + return errors; +} + +lt_dlloader * +lt_dlloader_next (place) + lt_dlloader *place; +{ + lt_dlloader *next; + + LT_DLMUTEX_LOCK (); + next = place ? place->next : loaders; + LT_DLMUTEX_UNLOCK (); + + return next; +} + +const char * +lt_dlloader_name (place) + lt_dlloader *place; +{ + const char *name = 0; + + if (place) + { + LT_DLMUTEX_LOCK (); + name = place ? place->loader_name : 0; + LT_DLMUTEX_UNLOCK (); + } + else + { + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (INVALID_LOADER)); + } + + return name; +} + +lt_user_data * +lt_dlloader_data (place) + lt_dlloader *place; +{ + lt_user_data *data = 0; + + if (place) + { + LT_DLMUTEX_LOCK (); + data = place ? &(place->dlloader_data) : 0; + LT_DLMUTEX_UNLOCK (); + } + else + { + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (INVALID_LOADER)); + } + + return data; +} + +lt_dlloader * +lt_dlloader_find (loader_name) + const char *loader_name; +{ + lt_dlloader *place = 0; + + LT_DLMUTEX_LOCK (); + for (place = loaders; place; place = place->next) + { + if (strcmp (place->loader_name, loader_name) == 0) + { + break; + } + } + LT_DLMUTEX_UNLOCK (); + + return place; +} diff --git a/contrib/platform/win32/opal/libltdl/ltdl.h b/contrib/platform/win32/opal/libltdl/ltdl.h new file mode 100644 index 0000000000..ff7874ef63 --- /dev/null +++ b/contrib/platform/win32/opal/libltdl/ltdl.h @@ -0,0 +1,367 @@ +/* ltdl.h -- generic dlopen functions + Copyright (C) 1998-2000 Free Software Foundation, Inc. + Originally by Thomas Tanner + This file is part of GNU Libtool. + +This library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; either +version 2 of the License, or (at your option) any later version. + +As a special exception to the GNU Lesser General Public License, +if you distribute this file as part of a program or library that +is built using GNU libtool, you may include it under the same +distribution terms that you use for the rest of that program. + +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with this library; if not, write to the Free +Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA +*/ + +/* Only include this header file once. */ +#ifndef LTDL_H +#define LTDL_H 1 + +#include /* for size_t declaration */ + + +/* --- MACROS FOR PORTABILITY --- */ + + +/* Saves on those hard to debug '\0' typos.... */ +#define LT_EOS_CHAR '\0' + +/* LTDL_BEGIN_C_DECLS should be used at the beginning of your declarations, + so that C++ compilers don't mangle their names. Use LTDL_END_C_DECLS at + the end of C declarations. */ +#ifdef __cplusplus +# define LT_BEGIN_C_DECLS extern "C" { +# define LT_END_C_DECLS } +#else +# define LT_BEGIN_C_DECLS /* empty */ +# define LT_END_C_DECLS /* empty */ +#endif + +LT_BEGIN_C_DECLS + + +/* LT_PARAMS is a macro used to wrap function prototypes, so that compilers + that don't understand ANSI C prototypes still work, and ANSI C + compilers can issue warnings about type mismatches. */ +#if defined (__STDC__) || defined (_AIX) || (defined (__mips) && defined (_SYSTYPE_SVR4)) || defined(WIN32) || defined(__cplusplus) +# define LT_PARAMS(protos) protos +# define lt_ptr void* +#else +# define LT_PARAMS(protos) () +# define lt_ptr char* +#endif + +/* LT_STMT_START/END are used to create macros which expand to a + a single compound statement in a portable way. */ +#if defined (__GNUC__) && !defined (__STRICT_ANSI__) && !defined (__cplusplus) +# define LT_STMT_START (void)( +# define LT_STMT_END ) +#else +# if (defined (sun) || defined (__sun__)) +# define LT_STMT_START if (1) +# define LT_STMT_END else (void)0 +# else +# define LT_STMT_START do +# define LT_STMT_END while (0) +# endif +#endif + +/* LT_CONC creates a new concatenated symbol for the compiler + in a portable way. */ +#if defined(__STDC__) || defined(__cplusplus) || defined(_MSC_VER) +# define LT_CONC(s,t) s##t +#else +# define LT_CONC(s,t) s/**/t +#endif + +/* LT_STRLEN can be used safely on NULL pointers. */ +#define LT_STRLEN(s) (((s) && (s)[0]) ? strlen (s) : 0) + + + +/* --- WINDOWS SUPPORT --- */ + + +/* Canonicalise Windows and Cygwin recognition macros. */ +#ifdef __CYGWIN32__ +# ifndef __CYGWIN__ +# define __CYGWIN__ __CYGWIN32__ +# endif +#endif +#if defined(_WIN32) || defined(WIN32) +# ifndef __WINDOWS__ +# ifdef _WIN32 +# define __WINDOWS__ _WIN32 +# else +# ifdef WIN32 +# define __WINDOWS__ WIN32 +# endif +# endif +# endif +#endif + + +#ifdef __WINDOWS__ +# ifndef __CYGWIN__ +/* LT_DIRSEP_CHAR is accepted *in addition* to '/' as a directory + separator when it is set. */ +# define LT_DIRSEP_CHAR '\\' +# define LT_PATHSEP_CHAR ';' +# endif +#endif +#ifndef LT_PATHSEP_CHAR +# define LT_PATHSEP_CHAR ':' +#endif + +/* DLL building support on win32 hosts; mostly to workaround their + ridiculous implementation of data symbol exporting. */ +#ifndef LT_SCOPE +# if defined(__WINDOWS__) || defined(__CYGWIN__) +# ifdef DLL_EXPORT /* defined by libtool (if required) */ +# define LT_SCOPE __declspec(dllexport) +# endif +# ifdef LIBLTDL_DLL_IMPORT /* define if linking with this dll */ +# /* note: cygwin/mingw compilers can rely instead on auto-import */ +# define LT_SCOPE extern __declspec(dllimport) +# endif +# endif +# ifndef LT_SCOPE /* static linking or !__WINDOWS__ */ +# define LT_SCOPE extern +# endif +#endif + + +#if defined(_MSC_VER) /* Visual Studio */ +# define R_OK 4 +#endif + + + +/* --- DYNAMIC MODULE LOADING API --- */ + + +typedef struct lt_dlhandle_struct *lt_dlhandle; /* A loaded module. */ + +/* Initialisation and finalisation functions for libltdl. */ +LT_SCOPE int lt_dlinit LT_PARAMS((void)); +LT_SCOPE int lt_dlexit LT_PARAMS((void)); + +/* Module search path manipulation. */ +LT_SCOPE int lt_dladdsearchdir LT_PARAMS((const char *search_dir)); +LT_SCOPE int lt_dlinsertsearchdir LT_PARAMS((const char *before, + const char *search_dir)); +LT_SCOPE int lt_dlsetsearchpath LT_PARAMS((const char *search_path)); +LT_SCOPE const char *lt_dlgetsearchpath LT_PARAMS((void)); +LT_SCOPE int lt_dlforeachfile LT_PARAMS(( + const char *search_path, + int (*func) (const char *filename, lt_ptr data), + lt_ptr data)); + +/* Portable libltdl versions of the system dlopen() API. */ +LT_SCOPE lt_dlhandle lt_dlopen LT_PARAMS((const char *filename)); +LT_SCOPE lt_dlhandle lt_dlopenext LT_PARAMS((const char *filename)); +LT_SCOPE lt_ptr lt_dlsym LT_PARAMS((lt_dlhandle handle, + const char *name)); +LT_SCOPE const char *lt_dlerror LT_PARAMS((void)); +LT_SCOPE int lt_dlclose LT_PARAMS((lt_dlhandle handle)); + +/* Module residency management. */ +LT_SCOPE int lt_dlmakeresident LT_PARAMS((lt_dlhandle handle)); +LT_SCOPE int lt_dlisresident LT_PARAMS((lt_dlhandle handle)); + + + + +/* --- MUTEX LOCKING --- */ + + +typedef void lt_dlmutex_lock LT_PARAMS((void)); +typedef void lt_dlmutex_unlock LT_PARAMS((void)); +typedef void lt_dlmutex_seterror LT_PARAMS((const char *errmsg)); +typedef const char *lt_dlmutex_geterror LT_PARAMS((void)); + +LT_SCOPE int lt_dlmutex_register LT_PARAMS((lt_dlmutex_lock *lock, + lt_dlmutex_unlock *unlock, + lt_dlmutex_seterror *seterror, + lt_dlmutex_geterror *geterror)); + + + + +/* --- MEMORY HANDLING --- */ + + +/* By default, the realloc function pointer is set to our internal + realloc implementation which iself uses lt_dlmalloc and lt_dlfree. + libltdl relies on a featureful realloc, but if you are sure yours + has the right semantics then you can assign it directly. Generally, + it is safe to assign just a malloc() and a free() function. */ +LT_SCOPE lt_ptr (*lt_dlmalloc) LT_PARAMS((size_t size)); +LT_SCOPE lt_ptr (*lt_dlrealloc) LT_PARAMS((lt_ptr ptr, size_t size)); +LT_SCOPE void (*lt_dlfree) LT_PARAMS((lt_ptr ptr)); + + + + +/* --- PRELOADED MODULE SUPPORT --- */ + + +/* A preopened symbol. Arrays of this type comprise the exported + symbols for a dlpreopened module. */ +typedef struct { + const char *name; + lt_ptr address; +} lt_dlsymlist; + +LT_SCOPE int lt_dlpreload LT_PARAMS((const lt_dlsymlist *preloaded)); +LT_SCOPE int lt_dlpreload_default + LT_PARAMS((const lt_dlsymlist *preloaded)); + +#define LTDL_SET_PRELOADED_SYMBOLS() LT_STMT_START{ \ + extern const lt_dlsymlist lt_preloaded_symbols[]; \ + lt_dlpreload_default(lt_preloaded_symbols); \ + }LT_STMT_END + + + + +/* --- MODULE INFORMATION --- */ + + +/* Read only information pertaining to a loaded module. */ +typedef struct { + char *filename; /* file name */ + char *name; /* module name */ + int ref_count; /* number of times lt_dlopened minus + number of times lt_dlclosed. */ +} lt_dlinfo; + +LT_SCOPE const lt_dlinfo *lt_dlgetinfo LT_PARAMS((lt_dlhandle handle)); +LT_SCOPE lt_dlhandle lt_dlhandle_next LT_PARAMS((lt_dlhandle place)); +LT_SCOPE int lt_dlforeach LT_PARAMS(( + int (*func) (lt_dlhandle handle, lt_ptr data), + lt_ptr data)); + +/* Associating user data with loaded modules. */ +typedef unsigned lt_dlcaller_id; + +LT_SCOPE lt_dlcaller_id lt_dlcaller_register LT_PARAMS((void)); +LT_SCOPE lt_ptr lt_dlcaller_set_data LT_PARAMS((lt_dlcaller_id key, + lt_dlhandle handle, + lt_ptr data)); +LT_SCOPE lt_ptr lt_dlcaller_get_data LT_PARAMS((lt_dlcaller_id key, + lt_dlhandle handle)); + + + +/* --- USER MODULE LOADER API --- */ + + +typedef struct lt_dlloader lt_dlloader; +typedef lt_ptr lt_user_data; +typedef lt_ptr lt_module; + +/* Function pointer types for creating user defined module loaders. */ +typedef lt_module lt_module_open LT_PARAMS((lt_user_data loader_data, + const char *filename)); +typedef int lt_module_close LT_PARAMS((lt_user_data loader_data, + lt_module handle)); +typedef lt_ptr lt_find_sym LT_PARAMS((lt_user_data loader_data, + lt_module handle, + const char *symbol)); +typedef int lt_dlloader_exit LT_PARAMS((lt_user_data loader_data)); + +struct lt_user_dlloader { + const char *sym_prefix; + lt_module_open *module_open; + lt_module_close *module_close; + lt_find_sym *find_sym; + lt_dlloader_exit *dlloader_exit; + lt_user_data dlloader_data; +}; + +LT_SCOPE lt_dlloader *lt_dlloader_next LT_PARAMS((lt_dlloader *place)); +LT_SCOPE lt_dlloader *lt_dlloader_find LT_PARAMS(( + const char *loader_name)); +LT_SCOPE const char *lt_dlloader_name LT_PARAMS((lt_dlloader *place)); +LT_SCOPE lt_user_data *lt_dlloader_data LT_PARAMS((lt_dlloader *place)); +LT_SCOPE int lt_dlloader_add LT_PARAMS((lt_dlloader *place, + const struct lt_user_dlloader *dlloader, + const char *loader_name)); +LT_SCOPE int lt_dlloader_remove LT_PARAMS(( + const char *loader_name)); + + + +/* --- ERROR MESSAGE HANDLING --- */ + + +/* Defining error strings alongside their symbolic names in a macro in + this way allows us to expand the macro in different contexts with + confidence that the enumeration of symbolic names will map correctly + onto the table of error strings. */ +#define lt_dlerror_table \ + LT_ERROR(UNKNOWN, "unknown error") \ + LT_ERROR(DLOPEN_NOT_SUPPORTED, "dlopen support not available") \ + LT_ERROR(INVALID_LOADER, "invalid loader") \ + LT_ERROR(INIT_LOADER, "loader initialization failed") \ + LT_ERROR(REMOVE_LOADER, "loader removal failed") \ + LT_ERROR(FILE_NOT_FOUND, "file not found") \ + LT_ERROR(DEPLIB_NOT_FOUND, "dependency library not found") \ + LT_ERROR(NO_SYMBOLS, "no symbols defined") \ + LT_ERROR(CANNOT_OPEN, "can't open the module") \ + LT_ERROR(CANNOT_CLOSE, "can't close the module") \ + LT_ERROR(SYMBOL_NOT_FOUND, "symbol not found") \ + LT_ERROR(NO_MEMORY, "not enough memory") \ + LT_ERROR(INVALID_HANDLE, "invalid module handle") \ + LT_ERROR(BUFFER_OVERFLOW, "internal buffer overflow") \ + LT_ERROR(INVALID_ERRORCODE, "invalid errorcode") \ + LT_ERROR(SHUTDOWN, "library already shutdown") \ + LT_ERROR(CLOSE_RESIDENT_MODULE, "can't close resident module") \ + LT_ERROR(INVALID_MUTEX_ARGS, "invalid mutex handler registration") \ + LT_ERROR(INVALID_POSITION, "invalid search path insert position") + +/* Enumerate the symbolic error names. */ +enum { +#define LT_ERROR(name, diagnostic) LT_CONC(LT_ERROR_, name), + lt_dlerror_table +#undef LT_ERROR + + LT_ERROR_MAX +}; + +/* These functions are only useful from inside custom module loaders. */ +LT_SCOPE int lt_dladderror LT_PARAMS((const char *diagnostic)); +LT_SCOPE int lt_dlseterror LT_PARAMS((int errorcode)); + + + + +/* --- SOURCE COMPATIBILITY WITH OLD LIBLTDL --- */ + + +#ifdef LT_NON_POSIX_NAMESPACE +# define lt_ptr_t lt_ptr +# define lt_module_t lt_module +# define lt_module_open_t lt_module_open +# define lt_module_close_t lt_module_close +# define lt_find_sym_t lt_find_sym +# define lt_dlloader_exit_t lt_dlloader_exit +# define lt_dlloader_t lt_dlloader +# define lt_dlloader_data_t lt_user_data +#endif + +LT_END_C_DECLS + +#endif /* !LTDL_H */ diff --git a/contrib/platform/win32/opal/mca/backtrace/base/static-components.h b/contrib/platform/win32/opal/mca/backtrace/base/static-components.h new file mode 100644 index 0000000000..3c212954aa --- /dev/null +++ b/contrib/platform/win32/opal/mca/backtrace/base/static-components.h @@ -0,0 +1,18 @@ +/* + * $HEADER$ + */ +#if defined(c_plusplus) || defined(__cplusplus) +extern "C" { +#endif + +extern const mca_base_component_t mca_backtrace_none_component; + +const mca_base_component_t *mca_backtrace_base_static_components[] = { + &mca_backtrace_none_component, + NULL +}; + +#if defined(c_plusplus) || defined(__cplusplus) +} +#endif + diff --git a/contrib/platform/win32/opal/mca/crs/base/static-components.h b/contrib/platform/win32/opal/mca/crs/base/static-components.h new file mode 100644 index 0000000000..b8691f1f03 --- /dev/null +++ b/contrib/platform/win32/opal/mca/crs/base/static-components.h @@ -0,0 +1,18 @@ +/* + * $HEADER$ + */ +#if defined(c_plusplus) || defined(__cplusplus) +extern "C" { +#endif + + + +const mca_base_component_t *mca_crs_base_static_components[] = { + + NULL +}; + +#if defined(c_plusplus) || defined(__cplusplus) +} +#endif + diff --git a/contrib/platform/win32/opal/mca/installdirs/base/static-components.h b/contrib/platform/win32/opal/mca/installdirs/base/static-components.h new file mode 100644 index 0000000000..dbdbd8c7a9 --- /dev/null +++ b/contrib/platform/win32/opal/mca/installdirs/base/static-components.h @@ -0,0 +1,22 @@ +/* + * $HEADER$ + */ +#if defined(c_plusplus) || defined(__cplusplus) +extern "C" { +#endif + +extern const mca_base_component_t mca_installdirs_env_component; +extern const mca_base_component_t mca_installdirs_config_component; +extern const mca_base_component_t mca_installdirs_windows_component; + +const mca_base_component_t *mca_installdirs_base_static_components[] = { + &mca_installdirs_env_component, + &mca_installdirs_config_component, + &mca_installdirs_windows_component, + NULL +}; + +#if defined(c_plusplus) || defined(__cplusplus) +} +#endif + diff --git a/contrib/platform/win32/opal/mca/maffinity/base/static-components.h b/contrib/platform/win32/opal/mca/maffinity/base/static-components.h new file mode 100644 index 0000000000..7b1f6d2cbe --- /dev/null +++ b/contrib/platform/win32/opal/mca/maffinity/base/static-components.h @@ -0,0 +1,18 @@ +/* + * $HEADER$ + */ +#if defined(c_plusplus) || defined(__cplusplus) +extern "C" { +#endif + +extern const mca_base_component_t mca_maffinity_first_use_component; + +const mca_base_component_t *mca_maffinity_base_static_components[] = { + &mca_maffinity_first_use_component, + NULL +}; + +#if defined(c_plusplus) || defined(__cplusplus) +} +#endif + diff --git a/contrib/platform/win32/opal/mca/memcpy/base/static-components.h b/contrib/platform/win32/opal/mca/memcpy/base/static-components.h new file mode 100644 index 0000000000..9f74bd81f9 --- /dev/null +++ b/contrib/platform/win32/opal/mca/memcpy/base/static-components.h @@ -0,0 +1,18 @@ +/* + * $HEADER$ + */ +#if defined(c_plusplus) || defined(__cplusplus) +extern "C" { +#endif + + + +const mca_base_component_t *mca_memcpy_base_static_components[] = { + + NULL +}; + +#if defined(c_plusplus) || defined(__cplusplus) +} +#endif + diff --git a/contrib/platform/win32/opal/mca/memory/base/static-components.h b/contrib/platform/win32/opal/mca/memory/base/static-components.h new file mode 100644 index 0000000000..cb60822853 --- /dev/null +++ b/contrib/platform/win32/opal/mca/memory/base/static-components.h @@ -0,0 +1,18 @@ +/* + * $HEADER$ + */ +#if defined(c_plusplus) || defined(__cplusplus) +extern "C" { +#endif + + + +const mca_base_component_t *mca_memory_base_static_components[] = { + + NULL +}; + +#if defined(c_plusplus) || defined(__cplusplus) +} +#endif + diff --git a/contrib/platform/win32/opal/mca/paffinity/base/static-components.h b/contrib/platform/win32/opal/mca/paffinity/base/static-components.h new file mode 100644 index 0000000000..d0c537da63 --- /dev/null +++ b/contrib/platform/win32/opal/mca/paffinity/base/static-components.h @@ -0,0 +1,18 @@ +/* + * $HEADER$ + */ +#if defined(c_plusplus) || defined(__cplusplus) +extern "C" { +#endif + +extern const mca_base_component_t mca_paffinity_windows_component; + +const mca_base_component_t *mca_paffinity_base_static_components[] = { + &mca_paffinity_windows_component, + NULL +}; + +#if defined(c_plusplus) || defined(__cplusplus) +} +#endif + diff --git a/contrib/platform/win32/opal/mca/timer/base/static-components.h b/contrib/platform/win32/opal/mca/timer/base/static-components.h new file mode 100644 index 0000000000..25477b1cf6 --- /dev/null +++ b/contrib/platform/win32/opal/mca/timer/base/static-components.h @@ -0,0 +1,18 @@ +/* + * $HEADER$ + */ +#if defined(c_plusplus) || defined(__cplusplus) +extern "C" { +#endif + +extern const mca_base_component_t mca_timer_windows_component; + +const mca_base_component_t *mca_timer_base_static_components[] = { + &mca_timer_windows_component, + NULL +}; + +#if defined(c_plusplus) || defined(__cplusplus) +} +#endif + diff --git a/contrib/platform/win32/opal/version.h b/contrib/platform/win32/opal/version.h new file mode 100644 index 0000000000..996743c17a --- /dev/null +++ b/contrib/platform/win32/opal/version.h @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, + * University of Stuttgart. All rights reserved. + * Copyright (c) 2004-2005 The Regents of the University of California. + * All rights reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + * + * This file should be included by any file that needs full + * version information for the OPAL project + */ + +#ifndef OPAL_VERSIONS_H +#define OPAL_VERSIONS_H + +#define OPAL_MAJOR_VERSION 1 +#define OPAL_MINOR_VERSION 3 +#define OPAL_RELEASE_VERSION 0 +#define OPAL_GREEK_VERSION "a1" +#define OPAL_WANT_SVN 1 +#define OPAL_SVN_R "r14150:14151" +#ifdef OPAL_VERSION +/* If we included version.h, we want the real version, not the + stripped (no-r number) verstion */ +#undef OPAL_VERSION +#endif +#define OPAL_VERSION "1.3a1r14150:14151" + +#endif diff --git a/contrib/platform/win32/opal_config.h b/contrib/platform/win32/opal_config.h new file mode 100644 index 0000000000..04d77bd1c8 --- /dev/null +++ b/contrib/platform/win32/opal_config.h @@ -0,0 +1,1350 @@ +/* opal/include/opal_config.h. Generated from opal_config.h.in by configure. */ +/* opal/include/opal_config.h.in. Generated from configure.ac by autoheader. */ + +/* -*- c -*- + * + * Copyright (c) 2004-2005 The Trustees of Indiana University. + * All rights reserved. + * Copyright (c) 2004-2005 The Trustees of the University of Tennessee. + * All rights reserved. + * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, + * University of Stuttgart. All rights reserved. + * Copyright (c) 2004-2005 The Regents of the University of California. + * All rights reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + * + * Function: - OS, CPU and compiler dependent configuration + */ + +#ifndef OPAL_CONFIG_H +#define OPAL_CONFIG_H +/* flags that needed for windows */ +#define OMPI_BUILDING_CXX_BINDINGS_LIBRARY 1 +#define HAVE_DECL_AF_UNSPEC 1 +#define HAVE_DECL_PF_UNSPEC 1 + + + + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_AIO_H */ + +/* Define to 1 if you have the header file. */ +/*#define HAVE_ALLOCA_H 1*/ + +/* Define to 1 if you have the header file. */ +/*#define HAVE_ARPA_INET_H 1*/ + +/* Define to 1 if you have the `asprintf' function. */ +/*#define HAVE_ASPRINTF 1*/ + +/* Define to 1 if you have the `backtrace' function. */ +/* #undef HAVE_BACKTRACE */ + +/* Define to 1 if you have the `ceil' function. */ +#define HAVE_CEIL 1 + +/* Define to 1 if you have the `cnos_pm_barrier' function. */ +/* #undef HAVE_CNOS_PM_BARRIER */ +/* Define to 1 if you have the header file. */ +/* #undef HAVE_CRT_EXTERNS_H */ + +/* Define to 1 if you have the declaration of `AF_INET6', and to 0 if you + don't. */ +#define HAVE_DECL_AF_INET6 1 + +/* Define to 1 if you have the declaration of `AF_UNSPEC', and to 0 if you + don't. */ +#define HAVE_DECL_AF_UNSPEC 1 + +/* Define to 1 if you have the declaration of `IBV_EVENT_CLIENT_REREGISTER', + and to 0 if you don't. */ +/* #undef HAVE_DECL_IBV_EVENT_CLIENT_REREGISTER */ + +/* Define to 1 if you have the declaration of `PF_INET6', and to 0 if you + don't. */ +#define HAVE_DECL_PF_INET6 1 + +/* Define to 1 if you have the declaration of `PF_UNSPEC', and to 0 if you + don't. */ +#define HAVE_DECL_PF_UNSPEC 1 + +/* Define to 1 if you have the declaration of `RLIMIT_NPROC', and to 0 if you + don't. */ +#define HAVE_DECL_RLIMIT_NPROC 0 + +/* Define to 1 if the system has the type `cpu_set_t'. */ +/* #undef HAVE_CPU_SET_T */ + +/* Whether we have a functional CPU_ZERO macro or not */ +/* #undef HAVE_CPU_ZERO */ + +/* Define to 1 if you have the declaration of `sbrk', and to 0 if you don't. + */ +#define HAVE_DECL_SBRK 1 + +/* Define to 1 if you have the declaration of `__func__', and to 0 if you + don't. */ +#define HAVE_DECL___FUNC__ 0 + +/* Define if /dev/poll is available */ +/* #undef HAVE_DEVPOLL */ + +/* Define to 1 if you have the header file. */ +/*#define HAVE_DIRENT_H 1*/ + +/* Define to 1 if you have the `dirname' function. */ +/*#define HAVE_DIRNAME 1*/ + +/* Define to 1 if you have the header file. */ +/*#define HAVE_DLFCN_H 1*/ + +/* Define to 1 if you have the `dlsym' function. */ +/* #undef HAVE_DLSYM */ + +/* Define if your system supports the epoll system calls */ +/* #undef HAVE_EPOLL */ + +/* Define to 1 if you have the `epoll_ctl' function. */ +/* #undef HAVE_EPOLL_CTL */ + +/* Define to 1 if you have the header file. */ +/*#define HAVE_ERR_H 1*/ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_EXECINFO_H */ + +/* Define to 1 if you have the `execve' function. */ +#define HAVE_EXECVE 1 + +/* Define to 1 if you have the `fcntl' function. */ +#define HAVE_FCNTL 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_FCNTL_H 1 + +/* Define to 1 if you have the `fork' function. */ +/*#define HAVE_FORK 0*/ + +/* Define to 1 if you have the `getpwuid' function. */ +#define HAVE_GETPWUID 1 + +/* Define to 1 if you have the `gettimeofday' function. */ +#define HAVE_GETTIMEOFDAY 1 + +/* Define to 1 if you have the header file. */ +/*#define HAVE_GRP_H 1*/ + +/* Define to 1 if you have the `htonl' function. */ +#define HAVE_HTONL 1 + +/* Define to 1 if you have the `htons' function. */ +#define HAVE_HTONS 1 + +/* Define to 1 if you have the `ibv_create_srq' function. */ +/* #undef HAVE_IBV_CREATE_SRQ */ + +/* Define to 1 if you have the `ibv_get_device_list' function. */ +/* #undef HAVE_IBV_GET_DEVICE_LIST */ + +/* Define to 1 if you have the `ibv_resize_cq' function. */ +/* #undef HAVE_IBV_RESIZE_CQ */ + +/* Define to 1 if the system has the type `int16_t'. */ +/*#define HAVE_INT16_T 1*/ + +/* Define to 1 if the system has the type `int32_t'. */ +/*#define HAVE_INT32_T 1*/ + +/* Define to 1 if the system has the type `int64_t'. */ +/*#define HAVE_INT64_T 1*/ + +/* Define to 1 if the system has the type `int8_t'. */ +/*#define HAVE_INT8_T 1*/ + +/* Define to 1 if the system has the type `intptr_t'. */ +#define HAVE_INTPTR_T 1 + +/* Define to 1 if you have the header file. */ +/*#define HAVE_INTTYPES_H 0*/ + +/* Define to 1 if you have the `isatty' function. */ +#define HAVE_ISATTY 1 + +/* Define to 1 if you have the `killrank' function. */ +/* #undef HAVE_KILLRANK */ + +/* Define to 1 if you have the `kqueue' function. */ +/* #undef HAVE_KQUEUE */ + +/* Define to 1 if you have the header file. */ +/*#define HAVE_LIBGEN_H 1*/ + +/* Define to 1 if you have the `nsl' library (-lnsl). */ +/* #undef HAVE_LIBNSL */ + +/* Define to 1 if you have the `socket' library (-lsocket). */ +/* #undef HAVE_LIBSOCKET */ + +/* Define to 1 if you have the `util' library (-lutil). */ +#define HAVE_LIBUTIL 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_LIBUTIL_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_LIBXCPU_H */ + +/* Define to 1 if the system has the type `long double'. */ +#define HAVE_LONG_DOUBLE 1 + +/* Define to 1 if the system has the type `long long'. */ +#define HAVE_LONG_LONG 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_MACH_MACH_TIME_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_MACH_MACH_VM_H */ + +/* Define to 1 if you have the `mach_vm_read' function. */ +/* #undef HAVE_MACH_VM_READ */ + +/* Define to 1 if you have the `mach_vm_region' function. */ +/* #undef HAVE_MACH_VM_REGION */ + +/* Define to 1 if you have the header file. */ +#define HAVE_MALLOC_H 1 + +/* Define to 1 if you have the `mallopt' function. */ +#define HAVE_MALLOPT 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_MEMORY_H 1 + +/* Define to 1 if you have the `mmap' function. */ +#define HAVE_MMAP 1 + +/* Define to 1 if the system has the type `mode_t'. */ +#define HAVE_MODE_T 1 + +/* Define to 1 if you have the header file. */ +/*#define HAVE_NETDB_H 1*/ + +/* Define to 1 if you have the header file. */ +/*#define HAVE_NETINET_IN_H 1*/ + +/* Define to 1 if you have the header file. */ +/*#define HAVE_NETINET_TCP_H 1*/ + +/* Define to 1 if you have the header file. */ +/*#define HAVE_NET_IF_H 1*/ + +/* Define to 1 if you have the `ntohl' function. */ +#define HAVE_NTOHL 1 + +/* Define to 1 if you have the `ntohs' function. */ +#define HAVE_NTOHS 1 + +/* Define to 1 if you have the `openpty' function. */ +#define HAVE_OPENPTY 1 + +/* Define to 1 if you have the `pipe' function. */ +#define HAVE_PIPE 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_PMAPI_H */ + +/* Define to 1 if you have the `pm_cycles' function. */ +/* #undef HAVE_PM_CYCLES */ + +/* Define to 1 if you have the `poll' function. */ +/*#define HAVE_POLL 0*/ + +/* Define to 1 if you have the header file. */ +#define HAVE_POLL_H 1 + +/* Define to 1 if you have the `posix_memalign' function. */ +/* #undef HAVE_POSIX_MEMALIGN */ + +/* Define to 1 if `srr0' is member of `ppc_thread_state_t'. */ +/* #undef HAVE_PPC_THREAD_STATE_T_SRR0 */ + +/* Define to 1 if you have the `printstack' function. */ +/* #undef HAVE_PRINTSTACK */ + +/* Define to 1 if you have the header file. */ +/*#define HAVE_PTHREAD_H 1*/ + +/* Define to 1 if the system has the type `ptrdiff_t'. */ +#define HAVE_PTRDIFF_T 1 + +/* Define to 1 if you have the `ptsname' function. */ +#define HAVE_PTSNAME 1 + +/* Define to 1 if you have the header file. */ +/*#define HAVE_PTY_H 1*/ + +/* Define to 1 if you have the header file. */ +/*#define HAVE_PWD_H 1*/ + +/* Define if your system supports POSIX realtime signals */ +/* #undef HAVE_RTSIG */ + +/* Define to 1 if you have the header file. */ +/*#define HAVE_SCHED_H 1*/ + +/* Define to 1 if you have the `sched_yield' function. */ +/*#define HAVE_SCHED_YIELD 0*/ + +/* Define to 1 if you have the `select' function. */ +/*#define HAVE_SELECT 0*/ + +/* Define if F_SETFD is defined in */ +#define HAVE_SETFD 1 + +/* Define to 1 if you have the `setsid' function. */ +/*#define HAVE_SETSID 0*/ + +/* Define to 1 if `si_band' is member of `siginfo_t'. */ +/* #undef HAVE_SIGINFO_T_SI_BAND */ + +/* Define to 1 if `si_fd' is member of `siginfo_t'. */ +/* #undef HAVE_SIGINFO_T_SI_FD */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SIGNAL_H 1 + +/* Define to 1 if you have the `sigtimedwait' function. */ +/* #undef HAVE_SIGTIMEDWAIT */ + +/* Define to 1 if you have the `snprintf' function. */ +/*#define HAVE_SNPRINTF 0*/ + +/* Whether we have socklen_t or not */ +/*#define HAVE_SOCKLEN_T 0*/ + +/* Define to 1 if the system has the type `ssize_t'. */ +#define HAVE_SSIZE_T 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDARG_H 1 + +/* Define to 1 if you have the header file. */ +/*#define HAVE_STDBOOL_H 0*/ + +/* Define to 1 if you have the header file. */ +/*#define HAVE_STDINT_H 0*/ + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the header file. */ +/*#define HAVE_STRINGS_H 0*/ + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_STROPTS_H */ + +/* Define to 1 if you have the `strsignal' function. */ +/*#define HAVE_STRSIGNAL 0*/ + +/* Define to 1 if `d_type' is member of `struct dirent'. */ +/* #undef HAVE_STRUCT_DIRENT_D_TYPE */ + +/* Define to 1 if the system has the type `struct sockaddr_in'. */ +#define HAVE_STRUCT_SOCKADDR_IN 1 + +/* Define to 1 if the system has the type `struct sockaddr_in6'. */ +/* #undef HAVE_STRUCT_SOCKADDR_IN6 */ + +/* Define to 1 if you have the `syscall' function. */ +/* #undef HAVE_SYSCALL */ + +/* Define to 1 if you have the `sysconf' function. */ +#define HAVE_SYSCONF 1 + +/* Define to 1 if you have the header file. */ +/*#define HAVE_SYSLOG_H 1*/ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_BPROC_COMMON_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_BPROC_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_DEVPOLL_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_EPOLL_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_EVENT_H */ + +/* Define to 1 if you have the header file. */ +/*#define HAVE_SYS_FCNTL_H 0*/ + +/* Define to 1 if you have the header file. */ +/*#define HAVE_SYS_IOCTL_H 0*/ + +/* Define to 1 if you have the header file. */ +/*#define HAVE_SYS_IPC_H 0*/ + +/* Define to 1 if you have the header file. */ +/*#define HAVE_SYS_MMAN_H 0*/ + +/* Define to 1 if you have the header file. */ +/*#define HAVE_SYS_PARAM_H 0*/ + +/* Define to 1 if you have the header file. */ +/*#define HAVE_SYS_QUEUE_H 0*/ + +/* Define to 1 if you have the header file. */ +/*#define HAVE_SYS_RESOURCE_H 0*/ + +/* Define to 1 if you have the header file. */ +/*#define HAVE_SYS_SELECT_H 0*/ + +/* Define to 1 if you have the header file. */ +/*#define HAVE_SYS_SOCKET_H 0*/ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_SOCKIO_H */ + +/* Define to 1 if you have the header file. */ +/*#define HAVE_SYS_STATVFS_H 0*/ + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_SYSCTL_H */ + +/* Define to 1 if you have the header file. */ +/*#define HAVE_SYS_TIME_H 0 */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_TREE_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the header file. */ +/*#define HAVE_SYS_UIO_H 1/* + +/* Define to 1 if you have the header file. */ +/*#define HAVE_SYS_UTSNAME_H 1*/ + +/* Define to 1 if you have the header file. */ +/*#define HAVE_SYS_WAIT_H 0*/ + +/* Define if TAILQ_FOREACH is defined in */ +/*#define HAVE_TAILQFOREACH 0*/ + +/* Define to 1 if you have the `tcgetpgrp' function. */ +#define HAVE_TCGETPGRP 1 + +/* Define to 1 if you have the header file. */ +/*#define HAVE_TERMIOS_H 0*/ + +/* Define if timeradd is defined in */ +/*#define HAVE_TIMERADD 0*/ + +/* Define to 1 if you have the header file. */ +#define HAVE_TIME_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_UCONTEXT_H */ + +/* Define to 1 if the system has the type `uint16_t'. */ +/*#define HAVE_UINT16_T 1*/ + +/* Define to 1 if the system has the type `uint32_t'. */ +/*#define HAVE_UINT32_T 1*/ + +/* Define to 1 if the system has the type `uint64_t'. */ +/*#define HAVE_UINT64_T 1*/ + +/* Define to 1 if the system has the type `uint8_t'. */ +/*#define HAVE_UINT8_T 1*/ + +/* Define to 1 if the system has the type `uintptr_t'. */ +#define HAVE_UINTPTR_T 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_ULIMIT_H */ + +/* Define to 1 if you have the header file. */ +/*#define HAVE_UNISTD_H 1*/ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_UTIL_H */ + +/* Define to 1 if you have the header file. */ +/*#define HAVE_UTMP_H 1*/ + +/* Define to 1 if you have the `vasprintf' function. */ +/*#define HAVE_VASPRINTF 1*/ + +/* Define to 1 if you have the `vm_read_overwrite' function. */ +/* #undef HAVE_VM_READ_OVERWRITE */ + +/* Define to 1 if you have the `vsnprintf' function. */ +/*#define HAVE_VSNPRINTF 1*/ + +/* Define to 1 if you have the `waitpid' function. */ +/*#define HAVE_WAITPID 0*/ + +/* Define if kqueue works correctly with pipes */ +/* #undef HAVE_WORKING_KQUEUE */ + +/* Whether poll works for file descriptors and devices */ +/*#define HAVE_WORKING_POLL 1*/ + +/* Define if realtime signals work on pipes */ +/* #undef HAVE_WORKING_RTSIG */ + +/* Define to 1 if you have the `__mmap' function. */ +/* #undef HAVE___MMAP */ + +/* Define to 1 if you have the `__munmap' function. */ +/* #undef HAVE___MUNMAP */ + +/* Whether we have the cpu_set_t type or not */ +/* #undef HAVE_cpu_set_t */ + +/* Header to include for memcpy implementation */ +#define MCA_memcpy_IMPLEMENTATION_HEADER "../mca/memcpy/base/memcpy_base_default.h" + +/* Defined to 1 if mtl should use direct calls instead of components */ +#define MCA_mtl_DIRECT_CALL 0 + +/* name of component to use for direct calls, if MCA_mtl_DIRECT_CALL is 1 */ +#define MCA_mtl_DIRECT_CALL_COMPONENT + +/* Header mtl includes to be direct called */ +#define MCA_mtl_DIRECT_CALL_HEADER "" + +/* Defined if we are using Scyld bproc or pre 3.2.0 LANL bproc */ +/* #undef MCA_pls_bproc_scyld */ + +/* Defined to 1 if pml should use direct calls instead of components */ +#define MCA_pml_DIRECT_CALL 0 + +/* name of component to use for direct calls, if MCA_pml_DIRECT_CALL is 1 */ +#define MCA_pml_DIRECT_CALL_COMPONENT + +/* Header pml includes to be direct called */ +#define MCA_pml_DIRECT_CALL_HEADER "" + +/* Header to include for timer implementation */ +#define MCA_timer_IMPLEMENTATION_HEADER "../mca/timer/windows/timer_windows.h" + +/* Whether we want to check MPI parameters always, never, or decide at + run-time */ +#define MPI_PARAM_CHECK ompi_mpi_param_check + +/* The MX library have support for the mx_extensions.h */ +/* #undef MX_HAVE_EXTENSIONS_H */ + +/* MX allow to forget the completion event for mx_requests */ +/* #undef MX_HAVE_FORGET */ + +/* MX allow registration of an unexpected handler */ +/* #undef MX_HAVE_UNEXPECTED_HANDLER */ + +/* Define to 1 if your C compiler doesn't accept -c and -o together. */ +/* #undef NO_MINUS_C_MINUS_O */ + +/* Alignment of type char */ +#define OMPI_ALIGNMENT_CHAR 1 + +/* Alignment of type bool */ +#define OMPI_ALIGNMENT_CXX_BOOL 1 + +/* Alignment of type double */ +#define OMPI_ALIGNMENT_DOUBLE 8 + +/* Alignment of type float */ +#define OMPI_ALIGNMENT_FLOAT 4 + +/* Alignment of Fortran 77 COMPLEX */ +#define OMPI_ALIGNMENT_FORTRAN_COMPLEX 4 + +/* Alignment of Fortran 77 COMPLEX*16 */ +#define OMPI_ALIGNMENT_FORTRAN_COMPLEX16 8 + +/* Alignment of Fortran 77 COMPLEX*32 */ +#define OMPI_ALIGNMENT_FORTRAN_COMPLEX32 4 + +/* Alignment of Fortran 77 COMPLEX*8 */ +#define OMPI_ALIGNMENT_FORTRAN_COMPLEX8 4 + +/* Alignment of Fortran 77 DOUBLE PRECISION */ +#define OMPI_ALIGNMENT_FORTRAN_DOUBLE_PRECISION 8 + +/* Alignment of Fortran 77 INTEGER */ +#define OMPI_ALIGNMENT_FORTRAN_INTEGER 4 + +/* Alignment of Fortran 77 INTEGER*1 */ +#define OMPI_ALIGNMENT_FORTRAN_INTEGER1 1 + +/* Alignment of Fortran 77 INTEGER*16 */ +#define OMPI_ALIGNMENT_FORTRAN_INTEGER16 4 + +/* Alignment of Fortran 77 INTEGER*2 */ +#define OMPI_ALIGNMENT_FORTRAN_INTEGER2 2 + +/* Alignment of Fortran 77 INTEGER*4 */ +#define OMPI_ALIGNMENT_FORTRAN_INTEGER4 4 + +/* Alignment of Fortran 77 INTEGER*8 */ +#define OMPI_ALIGNMENT_FORTRAN_INTEGER8 8 + +/* Alignment of Fortran 77 LOGICAL */ +#define OMPI_ALIGNMENT_FORTRAN_LOGICAL 4 + +/* Alignment of Fortran 77 REAL */ +#define OMPI_ALIGNMENT_FORTRAN_REAL 4 + +/* Alignment of Fortran 77 REAL*16 */ +#define OMPI_ALIGNMENT_FORTRAN_REAL16 4 + +/* Alignment of Fortran 77 REAL*4 */ +#define OMPI_ALIGNMENT_FORTRAN_REAL4 4 + +/* Alignment of Fortran 77 REAL*8 */ +#define OMPI_ALIGNMENT_FORTRAN_REAL8 8 + +/* Alignment of type int */ +#define OMPI_ALIGNMENT_INT 4 + +/* Alignment of type long */ +#define OMPI_ALIGNMENT_LONG 4 + +/* Alignment of type long double */ +#define OMPI_ALIGNMENT_LONG_DOUBLE 4 + +/* Alignment of type long long */ +#define OMPI_ALIGNMENT_LONG_LONG 8 + +/* Alignment of type short */ +#define OMPI_ALIGNMENT_SHORT 2 + +/* Alignment of type void * */ +#define OMPI_ALIGNMENT_VOID_P 4 + +/* Alignment of type wchar_t */ +#define OMPI_ALIGNMENT_WCHAR 2 + +/* OMPI architecture string */ +#define OMPI_ARCH "i686-pc-cygwin" + +/* Assembly align directive expects logarithmic value */ +#define OMPI_ASM_ALIGN_LOG + +/* Assembly directive for exporting symbols */ +#define OMPI_ASM_GLOBAL ".globl" + +/* Assembly prefix for gsym labels */ +#define OMPI_ASM_GSYM "_" + +/* Assembly suffix for labels */ +#define OMPI_ASM_LABEL_SUFFIX ":" + +/* Assembly prefix for lsym labels */ +#define OMPI_ASM_LSYM "L" + +/* Do we need to give a .size directive */ +#define OMPI_ASM_SIZE "0" + +/* Whether we can do 64bit assembly operations or not. Should not be used + outside of the assembly header files */ +#define OMPI_ASM_SUPPORT_64BIT 1 + +/* Assembly directive for setting text section */ +#define OMPI_ASM_TEXT ".text" + +/* How to set function type in .type directive */ +#define OMPI_ASM_TYPE "" + +/* Architecture type of assembly to use for atomic operations */ +#define OMPI_ASSEMBLY_ARCH OMPI_WINDOWS + +/* Format of assembly file */ +#define OMPI_ASSEMBLY_FORMAT "default-.text-.globl-:-_-L--0-0-1-1-0" + +/* OMPI underlying C compiler */ +#define OMPI_CC "gcc" + +/* OMPI underlying C++ compiler */ +#define OMPI_CXX "g++" + +/* Whether C++ compiler supports DEC style inline assembly */ +#define OMPI_CXX_DEC_INLINE_ASSEMBLY 0 + +/* Whether C++ compiler supports GCC style inline assembly */ +#define OMPI_CXX_GCC_INLINE_ASSEMBLY 0 + +/* Whether C++ compiler supports __builtin_expect */ +/*#define OMPI_CXX_HAVE_BUILTIN_EXPECT 0*/ + +/* Whether C++ compiler supports __builtin_prefetch */ +#define OMPI_CXX_HAVE_BUILTIN_PREFETCH 0 + +/* Whether a const_cast on a 2-d array will work with the C++ compiler */ +#define OMPI_CXX_SUPPORTS_2D_CONST_CAST 1 + +/* Whether C++ compiler supports XLC style inline assembly */ +#define OMPI_CXX_XLC_INLINE_ASSEMBLY 0 + +/* Whether C compiler supports DEC style inline assembly */ +#define OMPI_C_DEC_INLINE_ASSEMBLY 0 + +/* Whether C compiler supports GCC style inline assembly */ +#define OMPI_C_GCC_INLINE_ASSEMBLY 0 + +/* Whether C compiler supports __builtin_expect */ +/*#define OMPI_C_HAVE_BUILTIN_EXPECT 0*/ + +/* Whether C compiler supports __builtin_prefetch */ +#define OMPI_C_HAVE_BUILTIN_PREFETCH 1 + +/* Whether C compiler supports XLC style inline assembly */ +#define OMPI_C_XLC_INLINE_ASSEMBLY 0 + +/* Whether we want developer-level debugging code or not */ +#define OMPI_ENABLE_DEBUG 0 + +/* Enable features required for heterogeneous support */ +#define OMPI_ENABLE_HETEROGENEOUS_SUPPORT 0 + +/* Whether we want the memory profiling or not */ +#define OMPI_ENABLE_MEM_DEBUG 0 + +/* Whether we want the memory profiling or not */ +#define OMPI_ENABLE_MEM_PROFILE 1 + +/* Whether we want MPI profiling or not */ +#define OMPI_ENABLE_MPI_PROFILING 1 + +/* Whether we should enable support for multiple user threads */ +#define OMPI_ENABLE_MPI_THREADS 0 + +/* Whether we should use progress threads rather than polling */ +#define OMPI_ENABLE_PROGRESS_THREADS 0 + +/* Whether user wants PTY support or not */ +#define OMPI_ENABLE_PTY_SUPPORT 1 + +/* OMPI underlying F77 compiler */ +#define OMPI_F77 "g77" + +/* Whether fortran symbols are all caps or not */ +#define OMPI_F77_CAPS 0 + +/* Whether fortran symbols have a trailing double underscore or not */ +#define OMPI_F77_DOUBLE_UNDERSCORE 1 + +/* Whether fortran symbols have no trailing underscore or not */ +#define OMPI_F77_PLAIN 0 + +/* Whether fortran symbols have a trailing underscore or not */ +#define OMPI_F77_SINGLE_UNDERSCORE 0 + +/* OMPI underlying F90 compiler */ +#define OMPI_F90 "none" + +/* Max handle value for fortran MPI handles, effectively min(INT_MAX, max + fortran INTEGER value) */ +#define OMPI_FORTRAN_HANDLE_MAX ( 0x7fffffff < 2147483647 ? 0x7fffffff : 2147483647 ) + +/* Fortran value for LOGICAL .TRUE. value */ +#define OMPI_FORTRAN_VALUE_TRUE 1 + +/* Greek - alpha, beta, etc - release number of Open MPI */ +#define OMPI_GREEK_VERSION "a1" + +/* Whether there is an atomic assembly file available */ +#define OMPI_HAVE_ASM_FILE 1 + +/* Whether your compiler has __attribute__ or not */ +#define OMPI_HAVE_ATTRIBUTE 1 + +/* Whether your compiler has __attribute__ aligned or not */ +/*#define OMPI_HAVE_ATTRIBUTE_ALIGNED 0*/ + +/* Whether your compiler has __attribute__ always_inline or not */ +/*#define OMPI_HAVE_ATTRIBUTE_ALWAYS_INLINE 1*/ + +/* Whether your compiler has __attribute__ const or not */ +#define OMPI_HAVE_ATTRIBUTE_CONST 0 + +/* Whether your compiler has __attribute__ deprecated or not */ +#define OMPI_HAVE_ATTRIBUTE_DEPRECATED 0 + +/* Whether your compiler has __attribute__ format or not */ +#define OMPI_HAVE_ATTRIBUTE_FORMAT 0 + +/* Whether your compiler has __attribute__ malloc or not */ +#define OMPI_HAVE_ATTRIBUTE_MALLOC 0 + +/* Whether your compiler has __attribute__ may_alias or not */ +#define OMPI_HAVE_ATTRIBUTE_MAY_ALIAS 0 + +/* Whether your compiler has __attribute__ nonnull or not */ +#define OMPI_HAVE_ATTRIBUTE_NONNULL 0 + +/* Whether your compiler has __attribute__ noreturn or not */ +#define OMPI_HAVE_ATTRIBUTE_NORETURN 0 + +/* Whether your compiler has __attribute__ no_instrument_function or not */ +#define OMPI_HAVE_ATTRIBUTE_NO_INSTRUMENT_FUNCTION 0 + +/* Whether your compiler has __attribute__ packed or not */ +#define OMPI_HAVE_ATTRIBUTE_PACKED 0 + +/* Whether your compiler has __attribute__ pure or not */ +#define OMPI_HAVE_ATTRIBUTE_PURE 0 + +/* Whether your compiler has __attribute__ sentinel or not */ +#define OMPI_HAVE_ATTRIBUTE_SENTINEL 0 + +/* Whether your compiler has __attribute__ unused or not */ +#define OMPI_HAVE_ATTRIBUTE_UNUSED 0 + +/* Whether your compiler has __attribute__ visibility or not */ +#define OMPI_HAVE_ATTRIBUTE_VISIBILITY 0 + +/* Whether your compiler has __attribute__ warn unused result or not */ +#define OMPI_HAVE_ATTRIBUTE_WARN_UNUSED_RESULT 0 + +/* Whether your compiler has __attribute__ weak alias or not */ +#define OMPI_HAVE_ATTRIBUTE_WEAK_ALIAS 0 + +/* whether qsort is broken or not */ +#define OMPI_HAVE_BROKEN_QSORT 0 + +/* Whether or not we have compiled with C++ exceptions support */ +#define OMPI_HAVE_CXX_EXCEPTION_SUPPORT 0 + +/* Whether we have Fortran 90 $ofc_fortran_type or not */ +#define OMPI_HAVE_F90_COMPLEX 0 + +/* Whether we have Fortran 90 $ofc_fortran_type or not */ +#define OMPI_HAVE_F90_COMPLEX16 0 + +/* Whether we have Fortran 90 $ofc_fortran_type or not */ +#define OMPI_HAVE_F90_COMPLEX32 0 + +/* Whether we have Fortran 90 $ofc_fortran_type or not */ +#define OMPI_HAVE_F90_COMPLEX8 0 + +/* Whether we have Fortran 90 $ofc_fortran_type or not */ +#define OMPI_HAVE_F90_DOUBLE_COMPLEX 0 + +/* Whether we have Fortran 90 $ofc_fortran_type or not */ +#define OMPI_HAVE_F90_DOUBLE_PRECISION 0 + +/* Whether we have Fortran 90 $ofc_fortran_type or not */ +#define OMPI_HAVE_F90_INTEGER 0 + +/* Whether we have Fortran 90 $ofc_fortran_type or not */ +#define OMPI_HAVE_F90_INTEGER1 0 + +/* Whether we have Fortran 90 $ofc_fortran_type or not */ +#define OMPI_HAVE_F90_INTEGER16 0 + +/* Whether we have Fortran 90 $ofc_fortran_type or not */ +#define OMPI_HAVE_F90_INTEGER2 0 + +/* Whether we have Fortran 90 $ofc_fortran_type or not */ +#define OMPI_HAVE_F90_INTEGER4 0 + +/* Whether we have Fortran 90 $ofc_fortran_type or not */ +#define OMPI_HAVE_F90_INTEGER8 0 + +/* Whether we have Fortran 90 $ofc_fortran_type or not */ +#define OMPI_HAVE_F90_LOGICAL 0 + +/* Whether we have Fortran 90 $ofc_fortran_type or not */ +#define OMPI_HAVE_F90_REAL 0 + +/* Whether we have Fortran 90 $ofc_fortran_type or not */ +#define OMPI_HAVE_F90_REAL16 0 + +/* Whether we have Fortran 90 $ofc_fortran_type or not */ +#define OMPI_HAVE_F90_REAL4 0 + +/* Whether we have Fortran 90 $ofc_fortran_type or not */ +#define OMPI_HAVE_F90_REAL8 0 + +/* Whether we have Fortran 77 COMPLEX or not */ +#define OMPI_HAVE_FORTRAN_COMPLEX 1 + +/* Whether we have Fortran 77 COMPLEX*16 or not */ +#define OMPI_HAVE_FORTRAN_COMPLEX16 1 + +/* Whether we have Fortran 77 COMPLEX*32 or not */ +#define OMPI_HAVE_FORTRAN_COMPLEX32 0 + +/* Whether we have Fortran 77 COMPLEX*8 or not */ +#define OMPI_HAVE_FORTRAN_COMPLEX8 1 + +/* Whether we have Fortran 77 DOUBLE PRECISION or not */ +#define OMPI_HAVE_FORTRAN_DOUBLE_PRECISION 1 + +/* Whether we have Fortran 77 INTEGER or not */ +#define OMPI_HAVE_FORTRAN_INTEGER 1 + +/* Whether we have Fortran 77 INTEGER*1 or not */ +#define OMPI_HAVE_FORTRAN_INTEGER1 1 + +/* Whether we have Fortran 77 INTEGER*16 or not */ +#define OMPI_HAVE_FORTRAN_INTEGER16 0 + +/* Whether we have Fortran 77 INTEGER*2 or not */ +#define OMPI_HAVE_FORTRAN_INTEGER2 1 + +/* Whether we have Fortran 77 INTEGER*4 or not */ +#define OMPI_HAVE_FORTRAN_INTEGER4 1 + +/* Whether we have Fortran 77 INTEGER*8 or not */ +#define OMPI_HAVE_FORTRAN_INTEGER8 1 + +/* Whether we have Fortran 77 LOGICAL or not */ +#define OMPI_HAVE_FORTRAN_LOGICAL 1 + +/* Whether we have Fortran 77 REAL or not */ +#define OMPI_HAVE_FORTRAN_REAL 1 + +/* Whether we have Fortran 77 REAL*16 or not */ +#define OMPI_HAVE_FORTRAN_REAL16 0 + +/* Whether we have Fortran 77 REAL*4 or not */ +#define OMPI_HAVE_FORTRAN_REAL4 1 + +/* Whether we have Fortran 77 REAL*8 or not */ +#define OMPI_HAVE_FORTRAN_REAL8 1 + +/* Do we have POSIX threads */ +#define OMPI_HAVE_POSIX_THREADS 0 + +/* If PTHREADS implementation supports PTHREAD_MUTEX_ERRORCHECK */ +#define OMPI_HAVE_PTHREAD_MUTEX_ERRORCHECK 1 + +/* If PTHREADS implementation supports PTHREAD_MUTEX_ERRORCHECK_NP */ +#define OMPI_HAVE_PTHREAD_MUTEX_ERRORCHECK_NP 0 + +/* Whether we have the sa_len struct in or not */ +#define OMPI_HAVE_SA_LEN 0 + +/* Whether we have SA_RESTART in or not */ +#define OMPI_HAVE_SA_RESTART 1 + +/* Do we have native Solaris threads */ +#define OMPI_HAVE_SOLARIS_THREADS 0 + +/* Whether we have __va_copy or not */ +/*#define OMPI_HAVE_UNDERSCORE_VA_COPY 1*? + +/* Whether we have va_copy or not */ +/*#define OMPI_HAVE_VA_COPY 1*/ + +/* Wehther we have weak symbols or not */ +#define OMPI_HAVE_WEAK_SYMBOLS 0 +#define HAVE_WEAK_SYMBOLS 0 + +/* Major release number of Open MPI */ +#define OMPI_MAJOR_VERSION 1 + +/* Version of the GM API to use */ +/* #undef OMPI_MCA_BTL_GM_API_VERSION */ + +/* The GM build has or not a broker gm_get function */ +/* #undef OMPI_MCA_BTL_GM_GET_BROKEN */ + +/* Whether we have get_get() or not */ +/* #undef OMPI_MCA_BTL_GM_HAVE_RDMA_GET */ + +/* Whether we have gm_put() or gm_directed_send_with_callback() */ +/* #undef OMPI_MCA_BTL_GM_HAVE_RDMA_PUT */ + +/* The OS support or not the virtal page registration */ +/* #undef OMPI_MCA_BTL_GM_SUPPORT_REGISTERING */ + +/* Version of the MX API to use */ +/* #undef OMPI_MCA_BTL_MX_API_VERSION */ + +/* Whether install of OpenIB includes ibv_get_device_list API */ +/*#define OMPI_MCA_BTL_OPENIB_HAVE_DEVICE_LIST 0*/ + +/* Whether install of OpenIB includes resize completion queue support */ +/*#define OMPI_MCA_BTL_OPENIB_HAVE_RESIZE_CQ 0*/ + +/* Whether install of OpenIB includes shared receive queue support */ +/*#define OMPI_MCA_BTL_OPENIB_HAVE_SRQ 0*/ + +/* Number of arguments to ibv_create_cq */ +/* #undef OMPI_MCA_BTL_OPENIB_IBV_CREATE_CQ_ARGS */ + +/* Version of the MX API to use */ +/* #undef OMPI_MCA_COMMON_MX_API_VERSION */ + +/* Version of the MX API to use */ +/* #undef OMPI_MCA_MTL_MX_API_VERSION */ + +/* Whether any opal memory mca components were found */ +#define OMPI_MEMORY_HAVE_COMPONENT 0 + +/* Trigger callbacks on sbrk instead of malloc or free */ +#define OMPI_MEMORY_PTMALLOC2_OPT_SBRK 1 + +/* Minor release number of Open MPI */ +#define OMPI_MINOR_VERSION 3 + +/* Type of MPI_Offset -- has to be defined here and typedef'ed later because + mpi.h does not get AC SUBST's */ +#define OMPI_MPI_OFFSET_TYPE long long + +/* Whether the C compiler supports "bool" without any other help (such as + ) */ +#define OMPI_NEED_C_BOOL 1 + +/* MPI datatype corresponding to MPI_Offset */ +#define OMPI_OFFSET_DATATYPE MPI_LONG_LONG + +/* Use the Cray XT-3 implementation of Portals */ +#define OMPI_PORTALS_CRAYXT3 0 + +/* Does Portals send a PTL_EVENT_UNLINK event */ +#define OMPI_PORTALS_HAVE_EVENT_UNLINK 1 + +/* Use the UTCP reference implementation of Portals */ +/*#define OMPI_PORTALS_UTCP 1*/ + +/* Whether r notation is used for ppc registers */ +/* #undef OMPI_POWERPC_R_REGISTERS */ + +/* type to use for ptrdiff_t */ +#define OMPI_PTRDIFF_TYPE ptrdiff_t + +/* Release release number of Open MPI */ +#define OMPI_RELEASE_VERSION 0 + +/* whether to use cnos_barrier or not */ +#define OMPI_RML_CNOS_HAVE_BARRIER 0 + +/* Size of Fortran 77 COMPLEX */ +#define OMPI_SIZEOF_FORTRAN_COMPLEX 8 + +/* Size of Fortran 77 COMPLEX*16 */ +#define OMPI_SIZEOF_FORTRAN_COMPLEX16 16 + +/* Size of Fortran 77 COMPLEX*32 */ +#define OMPI_SIZEOF_FORTRAN_COMPLEX32 4 + +/* Size of Fortran 77 COMPLEX*8 */ +#define OMPI_SIZEOF_FORTRAN_COMPLEX8 8 + +/* Size of Fortran 77 DOUBLE PRECISION */ +#define OMPI_SIZEOF_FORTRAN_DOUBLE_PRECISION 8 + +/* Size of Fortran 77 INTEGER */ +#define OMPI_SIZEOF_FORTRAN_INTEGER 4 + +/* Size of Fortran 77 INTEGER*1 */ +#define OMPI_SIZEOF_FORTRAN_INTEGER1 1 + +/* Size of Fortran 77 INTEGER*16 */ +#define OMPI_SIZEOF_FORTRAN_INTEGER16 4 + +/* Size of Fortran 77 INTEGER*2 */ +#define OMPI_SIZEOF_FORTRAN_INTEGER2 2 + +/* Size of Fortran 77 INTEGER*4 */ +#define OMPI_SIZEOF_FORTRAN_INTEGER4 4 + +/* Size of Fortran 77 INTEGER*8 */ +#define OMPI_SIZEOF_FORTRAN_INTEGER8 8 + +/* Size of Fortran 77 LOGICAL */ +#define OMPI_SIZEOF_FORTRAN_LOGICAL 4 + +/* Size of Fortran 77 REAL */ +#define OMPI_SIZEOF_FORTRAN_REAL 4 + +/* Size of Fortran 77 REAL*16 */ +#define OMPI_SIZEOF_FORTRAN_REAL16 4 + +/* Size of Fortran 77 REAL*4 */ +#define OMPI_SIZEOF_FORTRAN_REAL4 4 + +/* Size of Fortran 77 REAL*8 */ +#define OMPI_SIZEOF_FORTRAN_REAL8 8 + +/* Do threads have different pids (pthreads on linux) */ +#define OMPI_THREADS_HAVE_DIFFERENT_PIDS 0 + +/* Whether to use or not */ +/*#define OMPI_USE_STDBOOL_H 0*/ /*bool is a built-in type in C++, so need not include this header*/ + +/* Complete release number of Open MPI */ +#define OMPI_VERSION "0" + +/* Whether we want MPI cxx support or not */ +#define OMPI_WANT_CXX_BINDINGS 1 + +/* Whether we want the MPI f77 bindings or not */ +#define OMPI_WANT_F77_BINDINGS 1 + +/* Whether we want the MPI f90 bindings or not */ +#define OMPI_WANT_F90_BINDINGS 0 + +/* Whether to include support for libltdl or not */ +#define OMPI_WANT_LIBLTDL 0 + +/* do we want to try to work around C++ bindings SEEK_* issue? */ +#define OMPI_WANT_MPI_CXX_SEEK 0 + +/* if the peruse interface should be enabled */ +#define OMPI_WANT_PERUSE 0 + +/* if want pretty-print stack trace feature */ +#define OMPI_WANT_PRETTY_PRINT_STACKTRACE 1 + +/* whether we want to have smp locks in atomic ops or not */ +#define OMPI_WANT_SMP_LOCKS 0 + +/* Enable IPv6 support, but only if the underlying system supports it */ +#define OPAL_ENABLE_IPV6 1 + +/* Enable run-time tracing of internal functions */ +#define OPAL_ENABLE_TRACE 0 + +/* Greek - alpha, beta, etc - release number of Open Portable Access Layer */ +#define OPAL_GREEK_VERSION "a1" + +/* Whether we have the _SC_NPROCESSORS_ONLN */ +#define OPAL_HAVE__SC_NPROCESSORS_ONLN 1 + +/* Major release number of Open Portable Access Layer */ +#define OPAL_MAJOR_VERSION 1 + +/* Minor release number of Open Portable Access Layer */ +#define OPAL_MINOR_VERSION 3 + +/* How many parameters sched_setaffinity() takes (!) */ +/* #undef OPAL_PAFFINITY_LINUX_SCHED_SETAFF_NUM_PARAMS */ + +/* Release release number of Open Portable Access Layer */ +#define OPAL_RELEASE_VERSION 0 + +/* Complete release number of Open Portable Access Layer */ +#define OPAL_VERSION "0" + +/* Specific ps command to use in orte-clean */ +#define ORTE_CLEAN_PS_CMD "unknown" + +/* Greek - alpha, beta, etc - release number of Open Run-Time Environment */ +#define ORTE_GREEK_VERSION "a1" + +/* Major release number of Open Run-Time Environment */ +#define ORTE_MAJOR_VERSION 1 + +/* Minor release number of Open Run-Time Environment */ +#define ORTE_MINOR_VERSION 3 + +/* Release release number of Open Run-Time Environment */ +#define ORTE_RELEASE_VERSION 0 + +/* Complete release number of Open Run-Time Environment */ +#define ORTE_VERSION "0" + +/* Whether we want orterun to effect "--prefix $prefix" by default */ +#define ORTE_WANT_ORTERUN_PREFIX_BY_DEFAULT 0 + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "http://www.open-mpi.org/community/help/" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "Open MPI" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "Open MPI 1.3a1" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "openmpi" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "1.3a1" + +/* The size of `bool', as computed by sizeof. */ +#define SIZEOF_BOOL 1 + +/* The size of `char', as computed by sizeof. */ +#define SIZEOF_CHAR 1 + +/* The size of `double', as computed by sizeof. */ +#define SIZEOF_DOUBLE 8 + +/* The size of `float', as computed by sizeof. */ +#define SIZEOF_FLOAT 4 + +/* The size of `int', as computed by sizeof. */ +#define SIZEOF_INT 4 + +/* The size of `long', as computed by sizeof. */ +#define SIZEOF_LONG 4 + +/* The size of `long double', as computed by sizeof. */ +#define SIZEOF_LONG_DOUBLE 12 + +/* The size of `long long', as computed by sizeof. */ +#define SIZEOF_LONG_LONG 8 + +/* The size of `pid_t', as computed by sizeof. */ +#define SIZEOF_PID_T 4 + +/* The size of `ptrdiff_t', as computed by sizeof. */ +#define SIZEOF_PTRDIFF_T 4 + +/* The size of `short', as computed by sizeof. */ +#define SIZEOF_SHORT 2 + +/* The size of `size_t', as computed by sizeof. */ +#define SIZEOF_SIZE_T 4 + +/* The size of `ssize_t', as computed by sizeof. */ +#define SIZEOF_SSIZE_T 4 + +/* The size of `void *', as computed by sizeof. */ +#define SIZEOF_VOID_P 4 + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Define to 1 if you can safely include both and . */ +#define TIME_WITH_SYS_TIME 1 + +/* Define to 1 if your processor stores words with the most significant byte + first (like Motorola and SPARC, unlike Intel and VAX). */ +/* #undef WORDS_BIGENDIAN */ + +/* Additional CFLAGS to pass through the wrapper compilers */ +#define WRAPPER_EXTRA_CFLAGS " " + +/* Additional CXXFLAGS to pass through the wrapper compilers */ +#define WRAPPER_EXTRA_CXXFLAGS " " + +/* Additional FCFLAGS to pass through the wrapper compilers */ +#define WRAPPER_EXTRA_FCFLAGS " " + +/* Additional FFLAGS to pass through the wrapper compilers */ +#define WRAPPER_EXTRA_FFLAGS " " + +/* Additional LDFLAGS to pass through the wrapper compilers */ +#define WRAPPER_EXTRA_LDFLAGS " " + +/* Additional LIBS to pass through the wrapper compilers */ +#define WRAPPER_EXTRA_LIBS " -Wl,--export-dynamic -lutil -ldl " + +/* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a + `char[]'. */ +#define YYTEXT_POINTER 1 + +/* Enable GNU extensions on systems that have them. */ +#ifndef _GNU_SOURCE +# define _GNU_SOURCE 1 +#endif + +/* Define to `__inline__' or `__inline' if that's what the C compiler + calls it, or to nothing if 'inline' is not supported under any name. */ +#define inline + + +/* A bogus type that allows us to have sentinel type values that are still + valid */ +#define ompi_fortran_bogus_type_t int + +/* C type corresponding to Fortran 77 COMPLEX*16 */ +/* #undef ompi_fortran_complex16_t */ + +/* C type corresponding to Fortran 77 COMPLEX*32 */ +/* #undef ompi_fortran_complex32_t */ + +/* C type corresponding to Fortran 77 COMPLEX*8 */ +/* #undef ompi_fortran_complex8_t */ + +/* C type corresponding to Fortran 77 COMPLEX */ +/* #undef ompi_fortran_complex_t */ + +/* C type corresponding to Fortran 77 DOUBLE PRECISION */ +#define ompi_fortran_double_precision_t double + +/* C type corresponding to Fortran 77 INTEGER*16 */ +#define ompi_fortran_integer16_t ompi_fortran_bogus_type_t + +/* C type corresponding to Fortran 77 INTEGER*1 */ +#define ompi_fortran_integer1_t char + +/* C type corresponding to Fortran 77 INTEGER*2 */ +#define ompi_fortran_integer2_t short + +/* C type corresponding to Fortran 77 INTEGER*4 */ +#define ompi_fortran_integer4_t int + +/* C type corresponding to Fortran 77 INTEGER*8 */ +#define ompi_fortran_integer8_t long long + +/* C type corresponding to Fortran 77 INTEGER */ +#define ompi_fortran_integer_t int + +/* C type corresponding to Fortran 77 LOGICAL */ +#define ompi_fortran_logical_t int + +/* C type corresponding to Fortran 77 REAL*16 */ +#define ompi_fortran_real16_t ompi_fortran_bogus_type_t + +/* C type corresponding to Fortran 77 REAL*4 */ +#define ompi_fortran_real4_t float + +/* C type corresponding to Fortran 77 REAL*8 */ +#define ompi_fortran_real8_t double + +/* C type corresponding to Fortran 77 REAL */ +#define ompi_fortran_real_t float + +/* Define to `int' if does not define. */ +#define pid_t int + +/* Define to equivalent of C99 restrict keyword, or to nothing if this is not + supported. Do not define if restrict is supported directly. */ +/*#define restrict __restrict*/ + +/* Define to `unsigned int' if does not define. */ +/* #undef size_t */ + +/* Define to `unsigned short' if does not define. */ +/* #undef u_int16_t */ + +/* Define to `unsigned int' if does not define. */ +/* #undef u_int32_t */ + +/* Define to `unsigned long long' if does not define. */ +/* #undef u_int64_t */ + +/* Define to `unsigned char' if does not define. */ +/* #undef u_int8_t */ + + +#include "opal_config_bottom.h" +#endif /* OPAL_CONFIG_H */ + diff --git a/contrib/platform/win32/orte/mca/errmgr/base/static-components.h b/contrib/platform/win32/orte/mca/errmgr/base/static-components.h new file mode 100644 index 0000000000..a32a00bc69 --- /dev/null +++ b/contrib/platform/win32/orte/mca/errmgr/base/static-components.h @@ -0,0 +1,22 @@ +/* + * $HEADER$ + */ +#if defined(c_plusplus) || defined(__cplusplus) +extern "C" { +#endif + +extern const mca_base_component_t mca_errmgr_hnp_component; +extern const mca_base_component_t mca_errmgr_orted_component; +extern const mca_base_component_t mca_errmgr_proxy_component; + +const mca_base_component_t *mca_errmgr_base_static_components[] = { + &mca_errmgr_hnp_component, + &mca_errmgr_orted_component, + &mca_errmgr_proxy_component, + NULL +}; + +#if defined(c_plusplus) || defined(__cplusplus) +} +#endif + diff --git a/contrib/platform/win32/orte/mca/filem/base/static-components.h b/contrib/platform/win32/orte/mca/filem/base/static-components.h new file mode 100644 index 0000000000..a41f9448f0 --- /dev/null +++ b/contrib/platform/win32/orte/mca/filem/base/static-components.h @@ -0,0 +1,16 @@ +/* + * $HEADER$ + */ +#if defined(c_plusplus) || defined(__cplusplus) +extern "C" { +#endif + + +const mca_base_component_t *mca_filem_base_static_components[] = { + NULL +}; + +#if defined(c_plusplus) || defined(__cplusplus) +} +#endif + diff --git a/contrib/platform/win32/orte/mca/filem/static_components.h b/contrib/platform/win32/orte/mca/filem/static_components.h new file mode 100644 index 0000000000..0ab085f14e --- /dev/null +++ b/contrib/platform/win32/orte/mca/filem/static_components.h @@ -0,0 +1,17 @@ +/* + * $HEADER$ + */ +#if defined(c_plusplus) || defined(__cplusplus) +extern "C" { +#endif + +extern const mca_base_component_t mca_filem_rsh_component; + +const mca_base_component_t *mca_filem_base_static_components[] = { + &mca_filem_rsh_component, + NULL +}; + +#if defined(c_plusplus) || defined(__cplusplus) +} +#endif diff --git a/contrib/platform/win32/orte/mca/gpr/base/static-components.h b/contrib/platform/win32/orte/mca/gpr/base/static-components.h new file mode 100644 index 0000000000..6fa22e54bb --- /dev/null +++ b/contrib/platform/win32/orte/mca/gpr/base/static-components.h @@ -0,0 +1,22 @@ +/* + * $HEADER$ + */ +#if defined(c_plusplus) || defined(__cplusplus) +extern "C" { +#endif + +extern const mca_base_component_t mca_gpr_null_component; +extern const mca_base_component_t mca_gpr_proxy_component; +extern const mca_base_component_t mca_gpr_replica_component; + +const mca_base_component_t *mca_gpr_base_static_components[] = { + &mca_gpr_null_component, + &mca_gpr_proxy_component, + &mca_gpr_replica_component, + NULL +}; + +#if defined(c_plusplus) || defined(__cplusplus) +} +#endif + diff --git a/contrib/platform/win32/orte/mca/grpcomm/base/static-components.h b/contrib/platform/win32/orte/mca/grpcomm/base/static-components.h new file mode 100644 index 0000000000..4e1cea9f9d --- /dev/null +++ b/contrib/platform/win32/orte/mca/grpcomm/base/static-components.h @@ -0,0 +1,18 @@ +/* + * $HEADER$ + */ +#if defined(c_plusplus) || defined(__cplusplus) +extern "C" { +#endif + + + +const mca_base_component_t *mca_grpcomm_base_static_components[] = { + + NULL +}; + +#if defined(c_plusplus) || defined(__cplusplus) +} +#endif + diff --git a/contrib/platform/win32/orte/mca/iof/base/static-components.h b/contrib/platform/win32/orte/mca/iof/base/static-components.h new file mode 100644 index 0000000000..66bad57f28 --- /dev/null +++ b/contrib/platform/win32/orte/mca/iof/base/static-components.h @@ -0,0 +1,20 @@ +/* + * $HEADER$ + */ +#if defined(c_plusplus) || defined(__cplusplus) +extern "C" { +#endif + +extern const mca_base_component_t mca_iof_proxy_component; +extern const mca_base_component_t mca_iof_svc_component; + +const mca_base_component_t *mca_iof_base_static_components[] = { + &mca_iof_proxy_component, + &mca_iof_svc_component, + NULL +}; + +#if defined(c_plusplus) || defined(__cplusplus) +} +#endif + diff --git a/contrib/platform/win32/orte/mca/ns/base/static-components.h b/contrib/platform/win32/orte/mca/ns/base/static-components.h new file mode 100644 index 0000000000..ba4f6afcee --- /dev/null +++ b/contrib/platform/win32/orte/mca/ns/base/static-components.h @@ -0,0 +1,20 @@ +/* + * $HEADER$ + */ +#if defined(c_plusplus) || defined(__cplusplus) +extern "C" { +#endif + +extern const mca_base_component_t mca_ns_proxy_component; +extern const mca_base_component_t mca_ns_replica_component; + +const mca_base_component_t *mca_ns_base_static_components[] = { + &mca_ns_proxy_component, + &mca_ns_replica_component, + NULL +}; + +#if defined(c_plusplus) || defined(__cplusplus) +} +#endif + diff --git a/contrib/platform/win32/orte/mca/odls/base/static-components.h b/contrib/platform/win32/orte/mca/odls/base/static-components.h new file mode 100644 index 0000000000..0821987d04 --- /dev/null +++ b/contrib/platform/win32/orte/mca/odls/base/static-components.h @@ -0,0 +1,18 @@ +/* + * $HEADER$ + */ +#if defined(c_plusplus) || defined(__cplusplus) +extern "C" { +#endif + +extern const mca_base_component_t mca_odls_process_component; + +const mca_base_component_t *mca_odls_base_static_components[] = { + &mca_odls_process_component, + NULL +}; + +#if defined(c_plusplus) || defined(__cplusplus) +} +#endif + diff --git a/contrib/platform/win32/orte/mca/oob/base/static-components.h b/contrib/platform/win32/orte/mca/oob/base/static-components.h new file mode 100644 index 0000000000..380e797e65 --- /dev/null +++ b/contrib/platform/win32/orte/mca/oob/base/static-components.h @@ -0,0 +1,18 @@ +/* + * $HEADER$ + */ +#if defined(c_plusplus) || defined(__cplusplus) +extern "C" { +#endif + +extern const mca_base_component_t mca_oob_tcp_component; + +const mca_base_component_t *mca_oob_base_static_components[] = { + &mca_oob_tcp_component, + NULL +}; + +#if defined(c_plusplus) || defined(__cplusplus) +} +#endif + diff --git a/contrib/platform/win32/orte/mca/pls/base/static-components.h b/contrib/platform/win32/orte/mca/pls/base/static-components.h new file mode 100644 index 0000000000..22242a3c7e --- /dev/null +++ b/contrib/platform/win32/orte/mca/pls/base/static-components.h @@ -0,0 +1,20 @@ +/* + * $HEADER$ + */ +#if defined(c_plusplus) || defined(__cplusplus) +extern "C" { +#endif + +extern const mca_base_component_t mca_pls_proxy_component; +extern const mca_base_component_t mca_pls_process_component; + +const mca_base_component_t *mca_pls_base_static_components[] = { + &mca_pls_proxy_component, + &mca_pls_process_component, + NULL +}; + +#if defined(c_plusplus) || defined(__cplusplus) +} +#endif + diff --git a/contrib/platform/win32/orte/mca/ras/base/static-components.h b/contrib/platform/win32/orte/mca/ras/base/static-components.h new file mode 100644 index 0000000000..9ea2b36a22 --- /dev/null +++ b/contrib/platform/win32/orte/mca/ras/base/static-components.h @@ -0,0 +1,20 @@ +/* + * $HEADER$ + */ +#if defined(c_plusplus) || defined(__cplusplus) +extern "C" { +#endif + +extern const mca_base_component_t mca_ras_dash_host_component; +extern const mca_base_component_t mca_ras_localhost_component; + +const mca_base_component_t *mca_ras_base_static_components[] = { + &mca_ras_dash_host_component, + &mca_ras_localhost_component, + NULL +}; + +#if defined(c_plusplus) || defined(__cplusplus) +} +#endif + diff --git a/contrib/platform/win32/orte/mca/rds/base/static-components.h b/contrib/platform/win32/orte/mca/rds/base/static-components.h new file mode 100644 index 0000000000..6007b5c19b --- /dev/null +++ b/contrib/platform/win32/orte/mca/rds/base/static-components.h @@ -0,0 +1,20 @@ +/* + * $HEADER$ + */ +#if defined(c_plusplus) || defined(__cplusplus) +extern "C" { +#endif + +extern const mca_base_component_t mca_rds_hostfile_component; +extern const mca_base_component_t mca_rds_proxy_component; + +const mca_base_component_t *mca_rds_base_static_components[] = { + &mca_rds_hostfile_component, + &mca_rds_proxy_component, + NULL +}; + +#if defined(c_plusplus) || defined(__cplusplus) +} +#endif + diff --git a/contrib/platform/win32/orte/mca/rds/rds_hostfile_lex.c b/contrib/platform/win32/orte/mca/rds/rds_hostfile_lex.c new file mode 100644 index 0000000000..a28c7ecc06 --- /dev/null +++ b/contrib/platform/win32/orte/mca/rds/rds_hostfile_lex.c @@ -0,0 +1,1927 @@ +#define yy_create_buffer orte_rds_hostfile__create_buffer +#define yy_delete_buffer orte_rds_hostfile__delete_buffer +#define yy_scan_buffer orte_rds_hostfile__scan_buffer +#define yy_scan_string orte_rds_hostfile__scan_string +#define yy_scan_bytes orte_rds_hostfile__scan_bytes +#define yy_flex_debug orte_rds_hostfile__flex_debug +#define yy_init_buffer orte_rds_hostfile__init_buffer +#define yy_flush_buffer orte_rds_hostfile__flush_buffer +#define yy_load_buffer_state orte_rds_hostfile__load_buffer_state +#define yy_switch_to_buffer orte_rds_hostfile__switch_to_buffer +#define yyin orte_rds_hostfile_in +#define yyleng orte_rds_hostfile_leng +#define yylex orte_rds_hostfile_lex +#define yyout orte_rds_hostfile_out +#define yyrestart orte_rds_hostfile_restart +#define yytext orte_rds_hostfile_text +#define yywrap orte_rds_hostfile_wrap + +/* A lexical scanner generated by flex */ + +/* Scanner skeleton version: + * $Header: /home/daffy/u0/vern/flex/RCS/flex.skl,v 2.91 96/09/10 16:58:48 vern Exp $ + */ + +#define FLEX_SCANNER +#define YY_FLEX_MAJOR_VERSION 2 +#define YY_FLEX_MINOR_VERSION 5 + +#include +#include + +/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */ +#ifdef c_plusplus +#ifndef __cplusplus +#define __cplusplus +#endif +#endif + + +#ifdef __cplusplus + +#include +#ifndef _WIN32 +#include +#endif + +/* Use prototypes in function declarations. */ +#define YY_USE_PROTOS + +/* The "const" storage-class-modifier is valid. */ +#define YY_USE_CONST + +#else /* ! __cplusplus */ + +#if __STDC__ + +#define YY_USE_PROTOS +#define YY_USE_CONST + +#endif /* __STDC__ */ +#endif /* ! __cplusplus */ + +#ifdef __TURBOC__ + #pragma warn -rch + #pragma warn -use +#include +#include +#define YY_USE_CONST +#define YY_USE_PROTOS +#endif + +#ifdef YY_USE_CONST +#define yyconst const +#else +#define yyconst +#endif + + +#ifdef YY_USE_PROTOS +#define YY_PROTO(proto) proto +#else +#define YY_PROTO(proto) () +#endif + + +/* Returned upon end-of-file. */ +#define YY_NULL 0 + +/* Promotes a possibly negative, possibly signed char to an unsigned + * integer for use as an array index. If the signed char is negative, + * we want to instead treat it as an 8-bit unsigned char, hence the + * double cast. + */ +#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) + +/* Enter a start condition. This macro really ought to take a parameter, + * but we do it the disgusting crufty way forced on us by the ()-less + * definition of BEGIN. + */ +#define BEGIN yy_start = 1 + 2 * + +/* Translate the current start state into a value that can be later handed + * to BEGIN to return to the state. The YYSTATE alias is for lex + * compatibility. + */ +#define YY_START ((yy_start - 1) / 2) +#define YYSTATE YY_START + +/* Action number for EOF rule of a given start state. */ +#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) + +/* Special action meaning "start processing a new file". */ +#define YY_NEW_FILE yyrestart( yyin ) + +#define YY_END_OF_BUFFER_CHAR 0 + +/* Size of default input buffer. */ +#define YY_BUF_SIZE 16384 + +typedef struct yy_buffer_state *YY_BUFFER_STATE; + +extern int yyleng; +extern FILE *yyin, *yyout; + +#define EOB_ACT_CONTINUE_SCAN 0 +#define EOB_ACT_END_OF_FILE 1 +#define EOB_ACT_LAST_MATCH 2 + +/* The funky do-while in the following #define is used to turn the definition + * int a single C statement (which needs a semi-colon terminator). This + * avoids problems with code like: + * + * if ( condition_holds ) + * yyless( 5 ); + * else + * do_something_else(); + * + * Prior to using the do-while the compiler would get upset at the + * "else" because it interpreted the "if" statement as being all + * done when it reached the ';' after the yyless() call. + */ + +/* Return all but the first 'n' matched characters back to the input stream. */ + +#define yyless(n) \ + do \ + { \ + /* Undo effects of setting up yytext. */ \ + *yy_cp = yy_hold_char; \ + YY_RESTORE_YY_MORE_OFFSET \ + yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \ + YY_DO_BEFORE_ACTION; /* set up yytext again */ \ + } \ + while ( 0 ) + +#define unput(c) yyunput( c, yytext_ptr ) + +/* The following is because we cannot portably get our hands on size_t + * (without autoconf's help, which isn't available because we want + * flex-generated scanners to compile on their own). + */ +typedef unsigned int yy_size_t; + + +struct yy_buffer_state + { + FILE *yy_input_file; + + char *yy_ch_buf; /* input buffer */ + char *yy_buf_pos; /* current position in input buffer */ + + /* Size of input buffer in bytes, not including room for EOB + * characters. + */ + yy_size_t yy_buf_size; + + /* Number of characters read into yy_ch_buf, not including EOB + * characters. + */ + int yy_n_chars; + + /* Whether we "own" the buffer - i.e., we know we created it, + * and can realloc() it to grow it, and should free() it to + * delete it. + */ + int yy_is_our_buffer; + + /* Whether this is an "interactive" input source; if so, and + * if we're using stdio for input, then we want to use getc() + * instead of fread(), to make sure we stop fetching input after + * each newline. + */ + int yy_is_interactive; + + /* Whether we're considered to be at the beginning of a line. + * If so, '^' rules will be active on the next match, otherwise + * not. + */ + int yy_at_bol; + + /* Whether to try to fill the input buffer when we reach the + * end of it. + */ + int yy_fill_buffer; + + int yy_buffer_status; +#define YY_BUFFER_NEW 0 +#define YY_BUFFER_NORMAL 1 + /* When an EOF's been seen but there's still some text to process + * then we mark the buffer as YY_EOF_PENDING, to indicate that we + * shouldn't try reading from the input source any more. We might + * still have a bunch of tokens to match, though, because of + * possible backing-up. + * + * When we actually see the EOF, we change the status to "new" + * (via yyrestart()), so that the user can continue scanning by + * just pointing yyin at a new input file. + */ +#define YY_BUFFER_EOF_PENDING 2 + }; + +static YY_BUFFER_STATE yy_current_buffer = 0; + +/* We provide macros for accessing buffer states in case in the + * future we want to put the buffer states in a more general + * "scanner state". + */ +#define YY_CURRENT_BUFFER yy_current_buffer + + +/* yy_hold_char holds the character lost when yytext is formed. */ +static char yy_hold_char; + +static int yy_n_chars; /* number of characters read into yy_ch_buf */ + + +int yyleng; + +/* Points to current character in buffer. */ +static char *yy_c_buf_p = (char *) 0; +static int yy_init = 1; /* whether we need to initialize */ +static int yy_start = 0; /* start state number */ + +/* Flag which is used to allow yywrap()'s to do buffer switches + * instead of setting up a fresh yyin. A bit of a hack ... + */ +static int yy_did_buffer_switch_on_eof; + +void yyrestart YY_PROTO(( FILE *input_file )); + +void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer )); +void yy_load_buffer_state YY_PROTO(( void )); +YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size )); +void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b )); +void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file )); +void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b )); +#define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer ) + +YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size )); +YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str )); +YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len )); + +static void *yy_flex_alloc YY_PROTO(( yy_size_t )); +static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t )); +static void yy_flex_free YY_PROTO(( void * )); + +#define yy_new_buffer yy_create_buffer + +#define yy_set_interactive(is_interactive) \ + { \ + if ( ! yy_current_buffer ) \ + yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ + yy_current_buffer->yy_is_interactive = is_interactive; \ + } + +#define yy_set_bol(at_bol) \ + { \ + if ( ! yy_current_buffer ) \ + yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ + yy_current_buffer->yy_at_bol = at_bol; \ + } + +#define YY_AT_BOL() (yy_current_buffer->yy_at_bol) + +typedef unsigned char YY_CHAR; +FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; +typedef int yy_state_type; +extern char *yytext; +#define yytext_ptr yytext + +static yy_state_type yy_get_previous_state YY_PROTO(( void )); +static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state )); +static int yy_get_next_buffer YY_PROTO(( void )); +static void yy_fatal_error YY_PROTO(( yyconst char msg[] )); + +/* Done after the current pattern has been matched and before the + * corresponding action - sets up yytext. + */ +#define YY_DO_BEFORE_ACTION \ + yytext_ptr = yy_bp; \ + yyleng = (int) (yy_cp - yy_bp); \ + yy_hold_char = *yy_cp; \ + *yy_cp = '\0'; \ + yy_c_buf_p = yy_cp; + +#define YY_NUM_RULES 35 +#define YY_END_OF_BUFFER 36 +static yyconst short int yy_accept[141] = + { 0, + 31, 31, 5, 5, 36, 34, 10, 1, 34, 34, + 31, 34, 30, 11, 31, 31, 31, 31, 31, 5, + 7, 6, 10, 1, 0, 9, 0, 2, 31, 4, + 0, 31, 0, 30, 0, 31, 33, 31, 31, 31, + 31, 31, 5, 6, 6, 8, 0, 3, 0, 30, + 0, 33, 31, 12, 31, 31, 31, 0, 0, 30, + 0, 31, 31, 31, 31, 31, 31, 31, 0, 0, + 0, 13, 31, 31, 31, 31, 31, 31, 14, 31, + 31, 31, 0, 0, 31, 31, 31, 31, 31, 31, + 31, 31, 31, 31, 31, 31, 31, 31, 31, 32, + + 0, 31, 31, 19, 20, 31, 21, 31, 31, 22, + 31, 31, 31, 31, 31, 31, 32, 31, 31, 31, + 31, 31, 31, 31, 31, 31, 31, 27, 32, 23, + 24, 25, 17, 26, 18, 15, 16, 28, 29, 0 + } ; + +static yyconst int yy_ec[256] = + { 0, + 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, + 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 2, 1, 4, 5, 1, 1, 1, 1, 1, + 1, 6, 1, 1, 7, 8, 9, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 1, 1, 1, + 11, 1, 1, 12, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 14, 14, 14, 14, 15, 14, 16, 13, 17, 13, + + 18, 13, 13, 13, 13, 13, 13, 19, 20, 21, + 22, 23, 13, 24, 25, 26, 27, 13, 13, 28, + 13, 13, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1 + } ; + +static yyconst int yy_meta[29] = + { 0, + 1, 1, 2, 1, 1, 3, 4, 5, 1, 6, + 1, 7, 6, 8, 4, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6 + } ; + +static yyconst short int yy_base[152] = + { 0, + 0, 0, 26, 27, 287, 390, 32, 390, 279, 260, + 0, 30, 30, 390, 29, 37, 30, 35, 25, 0, + 390, 55, 53, 390, 248, 390, 230, 390, 0, 390, + 218, 54, 199, 55, 193, 48, 0, 50, 52, 58, + 60, 66, 0, 81, 85, 390, 185, 390, 68, 162, + 85, 0, 75, 85, 94, 95, 96, 159, 96, 104, + 105, 109, 110, 111, 112, 111, 115, 126, 134, 142, + 131, 131, 136, 138, 100, 136, 126, 138, 149, 155, + 156, 158, 124, 158, 160, 171, 172, 174, 177, 178, + 160, 172, 174, 184, 188, 192, 197, 200, 204, 95, + + 91, 209, 212, 195, 207, 215, 217, 219, 225, 221, + 227, 235, 238, 242, 246, 249, 75, 251, 253, 233, + 173, 260, 253, 263, 265, 277, 279, 267, 390, 281, + 282, 283, 284, 286, 288, 293, 295, 297, 298, 390, + 323, 331, 339, 344, 349, 354, 362, 370, 378, 25, + 383 + } ; + +static yyconst short int yy_def[152] = + { 0, + 140, 1, 141, 141, 140, 140, 140, 140, 142, 143, + 144, 140, 145, 140, 146, 146, 16, 16, 16, 147, + 140, 148, 140, 140, 142, 140, 143, 140, 144, 140, + 149, 145, 140, 145, 150, 16, 151, 16, 16, 16, + 16, 16, 147, 148, 148, 140, 149, 140, 140, 34, + 140, 151, 16, 16, 54, 54, 54, 140, 140, 34, + 140, 54, 54, 54, 54, 65, 65, 54, 140, 140, + 140, 54, 54, 54, 16, 16, 16, 16, 54, 54, + 54, 54, 140, 140, 54, 54, 54, 54, 54, 54, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 140, + + 140, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 140, 16, 16, 16, + 65, 65, 65, 65, 65, 65, 65, 65, 140, 65, + 65, 65, 65, 65, 65, 65, 65, 65, 65, 0, + 140, 140, 140, 140, 140, 140, 140, 140, 140, 140, + 140 + } ; + +static yyconst short int yy_nxt[419] = + { 0, + 6, 7, 8, 9, 10, 6, 11, 6, 12, 13, + 14, 6, 15, 11, 11, 15, 16, 15, 15, 17, + 15, 15, 15, 15, 18, 15, 19, 15, 21, 21, + 52, 22, 22, 23, 24, 30, 37, 33, 31, 34, + 35, 35, 29, 29, 37, 40, 36, 36, 35, 42, + 29, 36, 36, 41, 23, 24, 36, 36, 38, 39, + 45, 140, 33, 46, 50, 35, 35, 29, 29, 36, + 36, 36, 36, 36, 36, 58, 53, 59, 54, 36, + 36, 56, 36, 57, 129, 55, 140, 36, 36, 140, + 45, 63, 33, 46, 61, 62, 36, 36, 83, 64, + + 65, 36, 36, 58, 117, 70, 36, 36, 66, 36, + 36, 140, 33, 60, 71, 36, 36, 36, 36, 68, + 67, 89, 90, 36, 36, 36, 36, 77, 75, 73, + 74, 36, 80, 100, 72, 78, 76, 85, 33, 79, + 81, 83, 36, 84, 36, 86, 82, 92, 93, 58, + 36, 87, 36, 88, 91, 95, 94, 36, 36, 36, + 36, 36, 36, 96, 36, 83, 36, 101, 69, 36, + 36, 60, 36, 99, 36, 97, 98, 36, 36, 102, + 36, 108, 36, 36, 36, 36, 36, 48, 36, 36, + 103, 36, 36, 36, 36, 36, 36, 133, 109, 104, + + 110, 105, 51, 106, 107, 111, 36, 112, 49, 36, + 36, 113, 114, 36, 36, 115, 36, 36, 36, 36, + 48, 36, 36, 116, 118, 36, 36, 119, 36, 36, + 36, 36, 28, 36, 36, 120, 36, 36, 36, 36, + 36, 36, 36, 36, 121, 122, 36, 36, 36, 36, + 124, 26, 123, 125, 36, 36, 36, 36, 132, 36, + 36, 126, 28, 36, 36, 127, 128, 36, 36, 36, + 36, 36, 36, 36, 36, 36, 36, 135, 130, 36, + 131, 36, 26, 36, 36, 134, 140, 36, 140, 36, + 136, 36, 137, 36, 138, 36, 139, 36, 36, 36, + + 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, + 36, 36, 36, 36, 36, 140, 140, 36, 140, 36, + 140, 36, 36, 20, 20, 20, 20, 20, 20, 20, + 20, 25, 25, 25, 25, 25, 25, 25, 25, 27, + 27, 27, 27, 27, 27, 27, 27, 29, 140, 29, + 140, 29, 32, 32, 32, 32, 32, 36, 36, 36, + 36, 36, 43, 140, 140, 43, 43, 43, 43, 43, + 44, 140, 44, 44, 44, 44, 44, 44, 47, 47, + 47, 47, 47, 47, 47, 47, 37, 37, 37, 5, + 140, 140, 140, 140, 140, 140, 140, 140, 140, 140, + + 140, 140, 140, 140, 140, 140, 140, 140, 140, 140, + 140, 140, 140, 140, 140, 140, 140, 140 + } ; + +static yyconst short int yy_chk[419] = + { 0, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 3, 4, + 150, 3, 4, 7, 7, 12, 15, 13, 12, 13, + 15, 13, 15, 13, 16, 17, 19, 19, 16, 19, + 16, 17, 17, 18, 23, 23, 18, 18, 16, 16, + 22, 32, 34, 22, 34, 32, 34, 32, 34, 36, + 36, 38, 38, 39, 39, 49, 38, 49, 39, 40, + 40, 41, 41, 42, 117, 40, 44, 42, 42, 44, + 45, 54, 51, 45, 51, 53, 53, 53, 101, 54, + + 55, 56, 57, 59, 100, 59, 54, 54, 55, 56, + 57, 60, 61, 60, 61, 62, 63, 64, 65, 57, + 56, 75, 75, 62, 63, 64, 65, 66, 65, 63, + 64, 67, 68, 83, 62, 66, 65, 72, 71, 67, + 68, 69, 73, 69, 74, 72, 68, 77, 77, 70, + 73, 73, 74, 74, 76, 79, 78, 76, 76, 78, + 78, 80, 81, 79, 82, 84, 85, 84, 58, 80, + 81, 50, 82, 82, 85, 80, 81, 86, 87, 85, + 88, 91, 91, 89, 90, 86, 87, 47, 88, 121, + 86, 89, 90, 92, 92, 93, 93, 121, 92, 87, + + 93, 88, 35, 89, 90, 94, 94, 95, 33, 95, + 95, 96, 97, 96, 96, 98, 104, 104, 97, 97, + 31, 98, 98, 99, 102, 99, 99, 103, 105, 105, + 102, 102, 27, 103, 103, 106, 106, 106, 107, 107, + 108, 108, 110, 110, 108, 109, 109, 109, 111, 111, + 112, 25, 111, 113, 120, 120, 112, 112, 120, 113, + 113, 114, 10, 114, 114, 115, 116, 115, 115, 123, + 116, 116, 118, 118, 119, 119, 122, 123, 118, 124, + 119, 125, 9, 128, 122, 122, 5, 124, 0, 125, + 124, 128, 125, 126, 126, 127, 127, 130, 131, 132, + + 133, 126, 134, 127, 135, 130, 131, 132, 133, 136, + 134, 137, 135, 138, 139, 0, 0, 136, 0, 137, + 0, 138, 139, 141, 141, 141, 141, 141, 141, 141, + 141, 142, 142, 142, 142, 142, 142, 142, 142, 143, + 143, 143, 143, 143, 143, 143, 143, 144, 0, 144, + 0, 144, 145, 145, 145, 145, 145, 146, 146, 146, + 146, 146, 147, 0, 0, 147, 147, 147, 147, 147, + 148, 0, 148, 148, 148, 148, 148, 148, 149, 149, + 149, 149, 149, 149, 149, 149, 151, 151, 151, 140, + 140, 140, 140, 140, 140, 140, 140, 140, 140, 140, + + 140, 140, 140, 140, 140, 140, 140, 140, 140, 140, + 140, 140, 140, 140, 140, 140, 140, 140 + } ; + +static yy_state_type yy_last_accepting_state; +static char *yy_last_accepting_cpos; + +/* The intent behind this definition is that it'll catch + * any uses of REJECT which flex missed. + */ +#define REJECT reject_used_but_not_detected +#define yymore() yymore_used_but_not_detected +#define YY_MORE_ADJ 0 +#define YY_RESTORE_YY_MORE_OFFSET +char *yytext; +#line 1 "rds_hostfile_lex.l" +#define INITIAL 0 +#line 2 "rds_hostfile_lex.l" +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2006 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, + * University of Stuttgart. All rights reserved. + * Copyright (c) 2004-2005 The Regents of the University of California. + * All rights reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ +#include "orte_config.h" + +#include +#if HAVE_UNISTD_H +#include +#endif + +#include "orte/mca/rds/hostfile/rds_hostfile_lex.h" + +/* + * local functions + */ +#if defined(c_plusplus) || defined(__cplusplus) +extern "C" { +#endif /* defined(c_plusplus) || defined(__cplusplus) */ + +int orte_rds_hostfile_wrap(void); + +#if defined(c_plusplus) || defined(__cplusplus) +} +#endif /* defined(c_plusplus) || defined(__cplusplus) */ + +int orte_rds_hostfile_wrap(void) +{ + orte_rds_hostfile_done = true; + return 1; +} + +/* + * global variables + */ +int orte_rds_hostfile_line=1; +orte_rds_value_t orte_rds_hostfile_value; +bool orte_rds_hostfile_done = false; + +#define comment 1 + +#line 577 "rds_hostfile_lex.c" + +/* Macros after this point can all be overridden by user definitions in + * section 1. + */ + +#ifndef YY_SKIP_YYWRAP +#ifdef __cplusplus +extern "C" int yywrap YY_PROTO(( void )); +#else +extern int yywrap YY_PROTO(( void )); +#endif +#endif + +#ifndef YY_NO_UNPUT +static void yyunput YY_PROTO(( int c, char *buf_ptr )); +#endif + +#ifndef yytext_ptr +static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int )); +#endif + +#ifdef YY_NEED_STRLEN +static int yy_flex_strlen YY_PROTO(( yyconst char * )); +#endif + +#ifndef YY_NO_INPUT +#ifdef __cplusplus +static int yyinput YY_PROTO(( void )); +#else +static int input YY_PROTO(( void )); +#endif +#endif + +#if YY_STACK_USED +static int yy_start_stack_ptr = 0; +static int yy_start_stack_depth = 0; +static int *yy_start_stack = 0; +#ifndef YY_NO_PUSH_STATE +static void yy_push_state YY_PROTO(( int new_state )); +#endif +#ifndef YY_NO_POP_STATE +static void yy_pop_state YY_PROTO(( void )); +#endif +#ifndef YY_NO_TOP_STATE +static int yy_top_state YY_PROTO(( void )); +#endif + +#else +#define YY_NO_PUSH_STATE 1 +#define YY_NO_POP_STATE 1 +#define YY_NO_TOP_STATE 1 +#endif + +#ifdef YY_MALLOC_DECL +YY_MALLOC_DECL +#else +#if __STDC__ +#ifndef __cplusplus +#include +#endif +#else +/* Just try to get by without declaring the routines. This will fail + * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int) + * or sizeof(void*) != sizeof(int). + */ +#endif +#endif + +/* Amount of stuff to slurp up with each read. */ +#ifndef YY_READ_BUF_SIZE +#define YY_READ_BUF_SIZE 8192 +#endif + +/* Copy whatever the last rule matched to the standard output. */ + +#ifndef ECHO +/* This used to be an fputs(), but since the string might contain NUL's, + * we now use fwrite(). + */ +#define ECHO (void) fwrite( yytext, yyleng, 1, yyout ) +#endif + +/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, + * is returned in "result". + */ +#ifndef YY_INPUT +#define YY_INPUT(buf,result,max_size) \ + if ( yy_current_buffer->yy_is_interactive ) \ + { \ + int c = '*', n; \ + for ( n = 0; n < max_size && \ + (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ + buf[n] = (char) c; \ + if ( c == '\n' ) \ + buf[n++] = (char) c; \ + if ( c == EOF && ferror( yyin ) ) \ + YY_FATAL_ERROR( "input in flex scanner failed" ); \ + result = n; \ + } \ + else \ + { \ + errno=0; \ + while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \ + { \ + if( errno != EINTR) \ + { \ + YY_FATAL_ERROR( "input in flex scanner failed" ); \ + break; \ + } \ + errno=0; \ + clearerr(yyin); \ + } \ + } +#endif + +/* No semi-colon after return; correct usage is to write "yyterminate();" - + * we don't want an extra ';' after the "return" because that will cause + * some compilers to complain about unreachable statements. + */ +#ifndef yyterminate +#define yyterminate() return YY_NULL +#endif + +/* Number of entries by which start-condition stack grows. */ +#ifndef YY_START_STACK_INCR +#define YY_START_STACK_INCR 25 +#endif + +/* Report a fatal error. */ +#ifndef YY_FATAL_ERROR +#define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) +#endif + +/* Default declaration of generated scanner - a define so the user can + * easily add parameters. + */ +#ifndef YY_DECL +#define YY_DECL int yylex YY_PROTO(( void )) +#endif + +/* Code executed at the beginning of each rule, after yytext and yyleng + * have been set up. + */ +#ifndef YY_USER_ACTION +#define YY_USER_ACTION +#endif + +/* Code executed at the end of each rule. */ +#ifndef YY_BREAK +#define YY_BREAK break; +#endif + +#define YY_RULE_SETUP \ + YY_USER_ACTION + +YY_DECL + { + register yy_state_type yy_current_state; + register char *yy_cp, *yy_bp; + register int yy_act; + +#line 60 "rds_hostfile_lex.l" + + +#line 742 "rds_hostfile_lex.c" + + if ( yy_init ) + { + yy_init = 0; + +#ifdef YY_USER_INIT + YY_USER_INIT; +#endif + + if ( ! yy_start ) + yy_start = 1; /* first start state */ + + if ( ! yyin ) + yyin = stdin; + + if ( ! yyout ) + yyout = stdout; + + if ( ! yy_current_buffer ) + yy_current_buffer = + yy_create_buffer( yyin, YY_BUF_SIZE ); + + yy_load_buffer_state(); + } + + while ( 1 ) /* loops until end-of-file is reached */ + { + yy_cp = yy_c_buf_p; + + /* Support of yytext. */ + *yy_cp = yy_hold_char; + + /* yy_bp points to the position in yy_ch_buf of the start of + * the current run. + */ + yy_bp = yy_cp; + + yy_current_state = yy_start; +yy_match: + do + { + register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; + if ( yy_accept[yy_current_state] ) + { + yy_last_accepting_state = yy_current_state; + yy_last_accepting_cpos = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 141 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + ++yy_cp; + } + while ( yy_base[yy_current_state] != 390 ); + +yy_find_action: + yy_act = yy_accept[yy_current_state]; + if ( yy_act == 0 ) + { /* have to back up */ + yy_cp = yy_last_accepting_cpos; + yy_current_state = yy_last_accepting_state; + yy_act = yy_accept[yy_current_state]; + } + + YY_DO_BEFORE_ACTION; + + +do_action: /* This label is used only to access EOF actions. */ + + + switch ( yy_act ) + { /* beginning of action switch */ + case 0: /* must back up */ + /* undo the effects of YY_DO_BEFORE_ACTION */ + *yy_cp = yy_hold_char; + yy_cp = yy_last_accepting_cpos; + yy_current_state = yy_last_accepting_state; + goto yy_find_action; + +case 1: +YY_RULE_SETUP +#line 62 "rds_hostfile_lex.l" +{ orte_rds_hostfile_line++; + return ORTE_RDS_HOSTFILE_NEWLINE; } + YY_BREAK +case 2: +YY_RULE_SETUP +#line 64 "rds_hostfile_lex.l" +{ orte_rds_hostfile_line++; + return ORTE_RDS_HOSTFILE_NEWLINE; } + YY_BREAK +case 3: +YY_RULE_SETUP +#line 66 "rds_hostfile_lex.l" +{ orte_rds_hostfile_line++; + return ORTE_RDS_HOSTFILE_NEWLINE; } + YY_BREAK +case 4: +YY_RULE_SETUP +#line 69 "rds_hostfile_lex.l" +{ BEGIN(comment); + return ORTE_RDS_HOSTFILE_NEWLINE; } + YY_BREAK +case 5: +YY_RULE_SETUP +#line 71 "rds_hostfile_lex.l" +; /* Eat up non '*'s */ + YY_BREAK +case 6: +YY_RULE_SETUP +#line 72 "rds_hostfile_lex.l" +; /* Eat '*'s not followed by a '/' */ + YY_BREAK +case 7: +YY_RULE_SETUP +#line 73 "rds_hostfile_lex.l" +{ orte_rds_hostfile_line++; + return ORTE_RDS_HOSTFILE_NEWLINE; } + YY_BREAK +case 8: +YY_RULE_SETUP +#line 75 "rds_hostfile_lex.l" +{ BEGIN(INITIAL); /* Done with Block Comment */ + return ORTE_RDS_HOSTFILE_NEWLINE; } + YY_BREAK +case 9: +YY_RULE_SETUP +#line 78 "rds_hostfile_lex.l" +{ orte_rds_hostfile_value.sval = yytext; + return ORTE_RDS_HOSTFILE_QUOTED_STRING; } + YY_BREAK +case 10: +YY_RULE_SETUP +#line 81 "rds_hostfile_lex.l" +; /* whitespace */ + YY_BREAK +case 11: +YY_RULE_SETUP +#line 83 "rds_hostfile_lex.l" +{ return ORTE_RDS_HOSTFILE_EQUAL; } + YY_BREAK +case 12: +YY_RULE_SETUP +#line 85 "rds_hostfile_lex.l" +{ orte_rds_hostfile_value.sval = yytext; + return ORTE_RDS_HOSTFILE_CPU; } + YY_BREAK +case 13: +YY_RULE_SETUP +#line 87 "rds_hostfile_lex.l" +{ orte_rds_hostfile_value.sval = yytext; + return ORTE_RDS_HOSTFILE_COUNT; } + YY_BREAK +case 14: +YY_RULE_SETUP +#line 89 "rds_hostfile_lex.l" +{ orte_rds_hostfile_value.sval = yytext; + return ORTE_RDS_HOSTFILE_SLOTS; } + YY_BREAK +case 15: +YY_RULE_SETUP +#line 92 "rds_hostfile_lex.l" +{ orte_rds_hostfile_value.sval = yytext; + return ORTE_RDS_HOSTFILE_SLOTS_MAX; } + YY_BREAK +case 16: +YY_RULE_SETUP +#line 94 "rds_hostfile_lex.l" +{ orte_rds_hostfile_value.sval = yytext; + return ORTE_RDS_HOSTFILE_SLOTS_MAX; } + YY_BREAK +case 17: +YY_RULE_SETUP +#line 96 "rds_hostfile_lex.l" +{ orte_rds_hostfile_value.sval = yytext; + return ORTE_RDS_HOSTFILE_SLOTS_MAX; } + YY_BREAK +case 18: +YY_RULE_SETUP +#line 98 "rds_hostfile_lex.l" +{ orte_rds_hostfile_value.sval = yytext; + return ORTE_RDS_HOSTFILE_SLOTS_MAX; } + YY_BREAK +case 19: +YY_RULE_SETUP +#line 100 "rds_hostfile_lex.l" +{ orte_rds_hostfile_value.sval = yytext; + return ORTE_RDS_HOSTFILE_SLOTS_MAX; } + YY_BREAK +case 20: +YY_RULE_SETUP +#line 102 "rds_hostfile_lex.l" +{ orte_rds_hostfile_value.sval = yytext; + return ORTE_RDS_HOSTFILE_SLOTS_MAX; } + YY_BREAK +case 21: +YY_RULE_SETUP +#line 104 "rds_hostfile_lex.l" +{ orte_rds_hostfile_value.sval = yytext; + return ORTE_RDS_HOSTFILE_SLOTS_MAX; } + YY_BREAK +case 22: +YY_RULE_SETUP +#line 106 "rds_hostfile_lex.l" +{ orte_rds_hostfile_value.sval = yytext; + return ORTE_RDS_HOSTFILE_SLOTS_MAX; } + YY_BREAK +case 23: +YY_RULE_SETUP +#line 108 "rds_hostfile_lex.l" +{ orte_rds_hostfile_value.sval = yytext; + return ORTE_RDS_HOSTFILE_SLOTS_MAX; } + YY_BREAK +case 24: +YY_RULE_SETUP +#line 110 "rds_hostfile_lex.l" +{ orte_rds_hostfile_value.sval = yytext; + return ORTE_RDS_HOSTFILE_SLOTS_MAX; } + YY_BREAK +case 25: +YY_RULE_SETUP +#line 112 "rds_hostfile_lex.l" +{ orte_rds_hostfile_value.sval = yytext; + return ORTE_RDS_HOSTFILE_SLOTS_MAX; } + YY_BREAK +case 26: +YY_RULE_SETUP +#line 114 "rds_hostfile_lex.l" +{ orte_rds_hostfile_value.sval = yytext; + return ORTE_RDS_HOSTFILE_SLOTS_MAX; } + YY_BREAK +case 27: +YY_RULE_SETUP +#line 117 "rds_hostfile_lex.l" +{ orte_rds_hostfile_value.sval = yytext; + return ORTE_RDS_HOSTFILE_USERNAME; } + YY_BREAK +case 28: +YY_RULE_SETUP +#line 119 "rds_hostfile_lex.l" +{ orte_rds_hostfile_value.sval = yytext; + return ORTE_RDS_HOSTFILE_USERNAME; } + YY_BREAK +case 29: +YY_RULE_SETUP +#line 121 "rds_hostfile_lex.l" +{ orte_rds_hostfile_value.sval = yytext; + return ORTE_RDS_HOSTFILE_USERNAME; } + YY_BREAK +case 30: +YY_RULE_SETUP +#line 124 "rds_hostfile_lex.l" +{ orte_rds_hostfile_value.ival = atol(yytext); + return ORTE_RDS_HOSTFILE_INT; } + YY_BREAK + /* First detect hosts as standard Strings (but without ".") + * then username@IPv4 or IPV4, then username@hostname or hostname + */ + +case 31: +YY_RULE_SETUP +#line 131 "rds_hostfile_lex.l" +{ orte_rds_hostfile_value.sval = yytext; + return ORTE_RDS_HOSTFILE_STRING; } + YY_BREAK +case 32: +YY_RULE_SETUP +#line 134 "rds_hostfile_lex.l" +{ + orte_rds_hostfile_value.sval = yytext; + return ORTE_RDS_HOSTFILE_IPV4; } + YY_BREAK +case 33: +YY_RULE_SETUP +#line 138 "rds_hostfile_lex.l" +{ + orte_rds_hostfile_value.sval = yytext; + return ORTE_RDS_HOSTFILE_HOSTNAME; } + YY_BREAK +case 34: +YY_RULE_SETUP +#line 142 "rds_hostfile_lex.l" +{ orte_rds_hostfile_value.sval = yytext; + return ORTE_RDS_HOSTFILE_ERROR; } + YY_BREAK +case 35: +YY_RULE_SETUP +#line 145 "rds_hostfile_lex.l" +ECHO; + YY_BREAK +#line 1036 "rds_hostfile_lex.c" +case YY_STATE_EOF(INITIAL): +case YY_STATE_EOF(comment): + yyterminate(); + + case YY_END_OF_BUFFER: + { + /* Amount of text matched not including the EOB char. */ + int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1; + + /* Undo the effects of YY_DO_BEFORE_ACTION. */ + *yy_cp = yy_hold_char; + YY_RESTORE_YY_MORE_OFFSET + + if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW ) + { + /* We're scanning a new file or input source. It's + * possible that this happened because the user + * just pointed yyin at a new source and called + * yylex(). If so, then we have to assure + * consistency between yy_current_buffer and our + * globals. Here is the right place to do so, because + * this is the first action (other than possibly a + * back-up) that will match for the new input source. + */ + yy_n_chars = yy_current_buffer->yy_n_chars; + yy_current_buffer->yy_input_file = yyin; + yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL; + } + + /* Note that here we test for yy_c_buf_p "<=" to the position + * of the first EOB in the buffer, since yy_c_buf_p will + * already have been incremented past the NUL character + * (since all states make transitions on EOB to the + * end-of-buffer state). Contrast this with the test + * in input(). + */ + if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] ) + { /* This was really a NUL. */ + yy_state_type yy_next_state; + + yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text; + + yy_current_state = yy_get_previous_state(); + + /* Okay, we're now positioned to make the NUL + * transition. We couldn't have + * yy_get_previous_state() go ahead and do it + * for us because it doesn't know how to deal + * with the possibility of jamming (and we don't + * want to build jamming into it because then it + * will run more slowly). + */ + + yy_next_state = yy_try_NUL_trans( yy_current_state ); + + yy_bp = yytext_ptr + YY_MORE_ADJ; + + if ( yy_next_state ) + { + /* Consume the NUL. */ + yy_cp = ++yy_c_buf_p; + yy_current_state = yy_next_state; + goto yy_match; + } + + else + { + yy_cp = yy_c_buf_p; + goto yy_find_action; + } + } + + else switch ( yy_get_next_buffer() ) + { + case EOB_ACT_END_OF_FILE: + { + yy_did_buffer_switch_on_eof = 0; + + if ( yywrap() ) + { + /* Note: because we've taken care in + * yy_get_next_buffer() to have set up + * yytext, we can now set up + * yy_c_buf_p so that if some total + * hoser (like flex itself) wants to + * call the scanner after we return the + * YY_NULL, it'll still work - another + * YY_NULL will get returned. + */ + yy_c_buf_p = yytext_ptr + YY_MORE_ADJ; + + yy_act = YY_STATE_EOF(YY_START); + goto do_action; + } + + else + { + if ( ! yy_did_buffer_switch_on_eof ) + YY_NEW_FILE; + } + break; + } + + case EOB_ACT_CONTINUE_SCAN: + yy_c_buf_p = + yytext_ptr + yy_amount_of_matched_text; + + yy_current_state = yy_get_previous_state(); + + yy_cp = yy_c_buf_p; + yy_bp = yytext_ptr + YY_MORE_ADJ; + goto yy_match; + + case EOB_ACT_LAST_MATCH: + yy_c_buf_p = + &yy_current_buffer->yy_ch_buf[yy_n_chars]; + + yy_current_state = yy_get_previous_state(); + + yy_cp = yy_c_buf_p; + yy_bp = yytext_ptr + YY_MORE_ADJ; + goto yy_find_action; + } + break; + } + + default: + YY_FATAL_ERROR( + "fatal flex scanner internal error--no action found" ); + } /* end of action switch */ + } /* end of scanning one token */ + } /* end of yylex */ + + +/* yy_get_next_buffer - try to read in a new buffer + * + * Returns a code representing an action: + * EOB_ACT_LAST_MATCH - + * EOB_ACT_CONTINUE_SCAN - continue scanning from current position + * EOB_ACT_END_OF_FILE - end of file + */ + +static int yy_get_next_buffer() + { + register char *dest = yy_current_buffer->yy_ch_buf; + register char *source = yytext_ptr; + register int number_to_move, i; + int ret_val; + + if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] ) + YY_FATAL_ERROR( + "fatal flex scanner internal error--end of buffer missed" ); + + if ( yy_current_buffer->yy_fill_buffer == 0 ) + { /* Don't try to fill the buffer, so this is an EOF. */ + if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 ) + { + /* We matched a single character, the EOB, so + * treat this as a final EOF. + */ + return EOB_ACT_END_OF_FILE; + } + + else + { + /* We matched some text prior to the EOB, first + * process it. + */ + return EOB_ACT_LAST_MATCH; + } + } + + /* Try to read more data. */ + + /* First move last chars to start of buffer. */ + number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1; + + for ( i = 0; i < number_to_move; ++i ) + *(dest++) = *(source++); + + if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING ) + /* don't do the read, it's not guaranteed to return an EOF, + * just force an EOF + */ + yy_current_buffer->yy_n_chars = yy_n_chars = 0; + + else + { + int num_to_read = + yy_current_buffer->yy_buf_size - number_to_move - 1; + + while ( num_to_read <= 0 ) + { /* Not enough room in the buffer - grow it. */ +#ifdef YY_USES_REJECT + YY_FATAL_ERROR( +"input buffer overflow, can't enlarge buffer because scanner uses REJECT" ); +#else + + /* just a shorter name for the current buffer */ + YY_BUFFER_STATE b = yy_current_buffer; + + int yy_c_buf_p_offset = + (int) (yy_c_buf_p - b->yy_ch_buf); + + if ( b->yy_is_our_buffer ) + { + int new_size = b->yy_buf_size * 2; + + if ( new_size <= 0 ) + b->yy_buf_size += b->yy_buf_size / 8; + else + b->yy_buf_size *= 2; + + b->yy_ch_buf = (char *) + /* Include room in for 2 EOB chars. */ + yy_flex_realloc( (void *) b->yy_ch_buf, + b->yy_buf_size + 2 ); + } + else + /* Can't grow it, we don't own it. */ + b->yy_ch_buf = 0; + + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( + "fatal error - scanner input buffer overflow" ); + + yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; + + num_to_read = yy_current_buffer->yy_buf_size - + number_to_move - 1; +#endif + } + + if ( num_to_read > YY_READ_BUF_SIZE ) + num_to_read = YY_READ_BUF_SIZE; + + /* Read in more data. */ + YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]), + yy_n_chars, num_to_read ); + + yy_current_buffer->yy_n_chars = yy_n_chars; + } + + if ( yy_n_chars == 0 ) + { + if ( number_to_move == YY_MORE_ADJ ) + { + ret_val = EOB_ACT_END_OF_FILE; + yyrestart( yyin ); + } + + else + { + ret_val = EOB_ACT_LAST_MATCH; + yy_current_buffer->yy_buffer_status = + YY_BUFFER_EOF_PENDING; + } + } + + else + ret_val = EOB_ACT_CONTINUE_SCAN; + + yy_n_chars += number_to_move; + yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR; + yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; + + yytext_ptr = &yy_current_buffer->yy_ch_buf[0]; + + return ret_val; + } + + +/* yy_get_previous_state - get the state just before the EOB char was reached */ + +static yy_state_type yy_get_previous_state() + { + register yy_state_type yy_current_state; + register char *yy_cp; + + yy_current_state = yy_start; + + for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp ) + { + register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); + if ( yy_accept[yy_current_state] ) + { + yy_last_accepting_state = yy_current_state; + yy_last_accepting_cpos = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 141 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + } + + return yy_current_state; + } + + +/* yy_try_NUL_trans - try to make a transition on the NUL character + * + * synopsis + * next_state = yy_try_NUL_trans( current_state ); + */ + +#ifdef YY_USE_PROTOS +static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state ) +#else +static yy_state_type yy_try_NUL_trans( yy_current_state ) +yy_state_type yy_current_state; +#endif + { + register int yy_is_jam; + register char *yy_cp = yy_c_buf_p; + + register YY_CHAR yy_c = 1; + if ( yy_accept[yy_current_state] ) + { + yy_last_accepting_state = yy_current_state; + yy_last_accepting_cpos = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 141 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + yy_is_jam = (yy_current_state == 140); + + return yy_is_jam ? 0 : yy_current_state; + } + + +#ifndef YY_NO_UNPUT +#ifdef YY_USE_PROTOS +static void yyunput( int c, register char *yy_bp ) +#else +static void yyunput( c, yy_bp ) +int c; +register char *yy_bp; +#endif + { + register char *yy_cp = yy_c_buf_p; + + /* undo effects of setting up yytext */ + *yy_cp = yy_hold_char; + + if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) + { /* need to shift things up to make room */ + /* +2 for EOB chars. */ + register int number_to_move = yy_n_chars + 2; + register char *dest = &yy_current_buffer->yy_ch_buf[ + yy_current_buffer->yy_buf_size + 2]; + register char *source = + &yy_current_buffer->yy_ch_buf[number_to_move]; + + while ( source > yy_current_buffer->yy_ch_buf ) + *--dest = *--source; + + yy_cp += (int) (dest - source); + yy_bp += (int) (dest - source); + yy_current_buffer->yy_n_chars = + yy_n_chars = yy_current_buffer->yy_buf_size; + + if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) + YY_FATAL_ERROR( "flex scanner push-back overflow" ); + } + + *--yy_cp = (char) c; + + + yytext_ptr = yy_bp; + yy_hold_char = *yy_cp; + yy_c_buf_p = yy_cp; + } +#endif /* ifndef YY_NO_UNPUT */ + + +#ifdef __cplusplus +static int yyinput() +#else +static int input() +#endif + { + int c; + + *yy_c_buf_p = yy_hold_char; + + if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR ) + { + /* yy_c_buf_p now points to the character we want to return. + * If this occurs *before* the EOB characters, then it's a + * valid NUL; if not, then we've hit the end of the buffer. + */ + if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] ) + /* This was really a NUL. */ + *yy_c_buf_p = '\0'; + + else + { /* need more input */ + int offset = yy_c_buf_p - yytext_ptr; + ++yy_c_buf_p; + + switch ( yy_get_next_buffer() ) + { + case EOB_ACT_LAST_MATCH: + /* This happens because yy_g_n_b() + * sees that we've accumulated a + * token and flags that we need to + * try matching the token before + * proceeding. But for input(), + * there's no matching to consider. + * So convert the EOB_ACT_LAST_MATCH + * to EOB_ACT_END_OF_FILE. + */ + + /* Reset buffer status. */ + yyrestart( yyin ); + + /* fall through */ + + case EOB_ACT_END_OF_FILE: + { + if ( yywrap() ) + return EOF; + + if ( ! yy_did_buffer_switch_on_eof ) + YY_NEW_FILE; +#ifdef __cplusplus + return yyinput(); +#else + return input(); +#endif + } + + case EOB_ACT_CONTINUE_SCAN: + yy_c_buf_p = yytext_ptr + offset; + break; + } + } + } + + c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */ + *yy_c_buf_p = '\0'; /* preserve yytext */ + yy_hold_char = *++yy_c_buf_p; + + + return c; + } + + +#ifdef YY_USE_PROTOS +void yyrestart( FILE *input_file ) +#else +void yyrestart( input_file ) +FILE *input_file; +#endif + { + if ( ! yy_current_buffer ) + yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); + + yy_init_buffer( yy_current_buffer, input_file ); + yy_load_buffer_state(); + } + + +#ifdef YY_USE_PROTOS +void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer ) +#else +void yy_switch_to_buffer( new_buffer ) +YY_BUFFER_STATE new_buffer; +#endif + { + if ( yy_current_buffer == new_buffer ) + return; + + if ( yy_current_buffer ) + { + /* Flush out information for old buffer. */ + *yy_c_buf_p = yy_hold_char; + yy_current_buffer->yy_buf_pos = yy_c_buf_p; + yy_current_buffer->yy_n_chars = yy_n_chars; + } + + yy_current_buffer = new_buffer; + yy_load_buffer_state(); + + /* We don't actually know whether we did this switch during + * EOF (yywrap()) processing, but the only time this flag + * is looked at is after yywrap() is called, so it's safe + * to go ahead and always set it. + */ + yy_did_buffer_switch_on_eof = 1; + } + + +#ifdef YY_USE_PROTOS +void yy_load_buffer_state( void ) +#else +void yy_load_buffer_state() +#endif + { + yy_n_chars = yy_current_buffer->yy_n_chars; + yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos; + yyin = yy_current_buffer->yy_input_file; + yy_hold_char = *yy_c_buf_p; + } + + +#ifdef YY_USE_PROTOS +YY_BUFFER_STATE yy_create_buffer( FILE *file, int size ) +#else +YY_BUFFER_STATE yy_create_buffer( file, size ) +FILE *file; +int size; +#endif + { + YY_BUFFER_STATE b; + + b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); + + b->yy_buf_size = size; + + /* yy_ch_buf has to be 2 characters longer than the size given because + * we need to put in 2 end-of-buffer characters. + */ + b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 ); + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); + + b->yy_is_our_buffer = 1; + + yy_init_buffer( b, file ); + + return b; + } + + +#ifdef YY_USE_PROTOS +void yy_delete_buffer( YY_BUFFER_STATE b ) +#else +void yy_delete_buffer( b ) +YY_BUFFER_STATE b; +#endif + { + if ( ! b ) + return; + + if ( b == yy_current_buffer ) + yy_current_buffer = (YY_BUFFER_STATE) 0; + + if ( b->yy_is_our_buffer ) + yy_flex_free( (void *) b->yy_ch_buf ); + + yy_flex_free( (void *) b ); + } + + +#ifndef _WIN32 +#include +#else +#ifndef YY_ALWAYS_INTERACTIVE +#ifndef YY_NEVER_INTERACTIVE +extern int isatty YY_PROTO(( int )); +#endif +#endif +#endif + +#ifdef YY_USE_PROTOS +void yy_init_buffer( YY_BUFFER_STATE b, FILE *file ) +#else +void yy_init_buffer( b, file ) +YY_BUFFER_STATE b; +FILE *file; +#endif + + + { + yy_flush_buffer( b ); + + b->yy_input_file = file; + b->yy_fill_buffer = 1; + +#if YY_ALWAYS_INTERACTIVE + b->yy_is_interactive = 1; +#else +#if YY_NEVER_INTERACTIVE + b->yy_is_interactive = 0; +#else + b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; +#endif +#endif + } + + +#ifdef YY_USE_PROTOS +void yy_flush_buffer( YY_BUFFER_STATE b ) +#else +void yy_flush_buffer( b ) +YY_BUFFER_STATE b; +#endif + + { + if ( ! b ) + return; + + b->yy_n_chars = 0; + + /* We always need two end-of-buffer characters. The first causes + * a transition to the end-of-buffer state. The second causes + * a jam in that state. + */ + b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; + b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; + + b->yy_buf_pos = &b->yy_ch_buf[0]; + + b->yy_at_bol = 1; + b->yy_buffer_status = YY_BUFFER_NEW; + + if ( b == yy_current_buffer ) + yy_load_buffer_state(); + } + + +#ifndef YY_NO_SCAN_BUFFER +#ifdef YY_USE_PROTOS +YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size ) +#else +YY_BUFFER_STATE yy_scan_buffer( base, size ) +char *base; +yy_size_t size; +#endif + { + YY_BUFFER_STATE b; + + if ( size < 2 || + base[size-2] != YY_END_OF_BUFFER_CHAR || + base[size-1] != YY_END_OF_BUFFER_CHAR ) + /* They forgot to leave room for the EOB's. */ + return 0; + + b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); + + b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ + b->yy_buf_pos = b->yy_ch_buf = base; + b->yy_is_our_buffer = 0; + b->yy_input_file = 0; + b->yy_n_chars = b->yy_buf_size; + b->yy_is_interactive = 0; + b->yy_at_bol = 1; + b->yy_fill_buffer = 0; + b->yy_buffer_status = YY_BUFFER_NEW; + + yy_switch_to_buffer( b ); + + return b; + } +#endif + + +#ifndef YY_NO_SCAN_STRING +#ifdef YY_USE_PROTOS +YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str ) +#else +YY_BUFFER_STATE yy_scan_string( yy_str ) +yyconst char *yy_str; +#endif + { + int len; + for ( len = 0; yy_str[len]; ++len ) + ; + + return yy_scan_bytes( yy_str, len ); + } +#endif + + +#ifndef YY_NO_SCAN_BYTES +#ifdef YY_USE_PROTOS +YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len ) +#else +YY_BUFFER_STATE yy_scan_bytes( bytes, len ) +yyconst char *bytes; +int len; +#endif + { + YY_BUFFER_STATE b; + char *buf; + yy_size_t n; + int i; + + /* Get memory for full buffer, including space for trailing EOB's. */ + n = len + 2; + buf = (char *) yy_flex_alloc( n ); + if ( ! buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); + + for ( i = 0; i < len; ++i ) + buf[i] = bytes[i]; + + buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR; + + b = yy_scan_buffer( buf, n ); + if ( ! b ) + YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); + + /* It's okay to grow etc. this buffer, and we should throw it + * away when we're done. + */ + b->yy_is_our_buffer = 1; + + return b; + } +#endif + + +#ifndef YY_NO_PUSH_STATE +#ifdef YY_USE_PROTOS +static void yy_push_state( int new_state ) +#else +static void yy_push_state( new_state ) +int new_state; +#endif + { + if ( yy_start_stack_ptr >= yy_start_stack_depth ) + { + yy_size_t new_size; + + yy_start_stack_depth += YY_START_STACK_INCR; + new_size = yy_start_stack_depth * sizeof( int ); + + if ( ! yy_start_stack ) + yy_start_stack = (int *) yy_flex_alloc( new_size ); + + else + yy_start_stack = (int *) yy_flex_realloc( + (void *) yy_start_stack, new_size ); + + if ( ! yy_start_stack ) + YY_FATAL_ERROR( + "out of memory expanding start-condition stack" ); + } + + yy_start_stack[yy_start_stack_ptr++] = YY_START; + + BEGIN(new_state); + } +#endif + + +#ifndef YY_NO_POP_STATE +static void yy_pop_state() + { + if ( --yy_start_stack_ptr < 0 ) + YY_FATAL_ERROR( "start-condition stack underflow" ); + + BEGIN(yy_start_stack[yy_start_stack_ptr]); + } +#endif + + +#ifndef YY_NO_TOP_STATE +static int yy_top_state() + { + return yy_start_stack[yy_start_stack_ptr - 1]; + } +#endif + +#ifndef YY_EXIT_FAILURE +#define YY_EXIT_FAILURE 2 +#endif + +#ifdef YY_USE_PROTOS +static void yy_fatal_error( yyconst char msg[] ) +#else +static void yy_fatal_error( msg ) +char msg[]; +#endif + { + (void) fprintf( stderr, "%s\n", msg ); + exit( YY_EXIT_FAILURE ); + } + + + +/* Redefine yyless() so it works in section 3 code. */ + +#undef yyless +#define yyless(n) \ + do \ + { \ + /* Undo effects of setting up yytext. */ \ + yytext[yyleng] = yy_hold_char; \ + yy_c_buf_p = yytext + n; \ + yy_hold_char = *yy_c_buf_p; \ + *yy_c_buf_p = '\0'; \ + yyleng = n; \ + } \ + while ( 0 ) + + +/* Internal utility routines. */ + +#ifndef yytext_ptr +#ifdef YY_USE_PROTOS +static void yy_flex_strncpy( char *s1, yyconst char *s2, int n ) +#else +static void yy_flex_strncpy( s1, s2, n ) +char *s1; +yyconst char *s2; +int n; +#endif + { + register int i; + for ( i = 0; i < n; ++i ) + s1[i] = s2[i]; + } +#endif + +#ifdef YY_NEED_STRLEN +#ifdef YY_USE_PROTOS +static int yy_flex_strlen( yyconst char *s ) +#else +static int yy_flex_strlen( s ) +yyconst char *s; +#endif + { + register int n; + for ( n = 0; s[n]; ++n ) + ; + + return n; + } +#endif + + +#ifdef YY_USE_PROTOS +static void *yy_flex_alloc( yy_size_t size ) +#else +static void *yy_flex_alloc( size ) +yy_size_t size; +#endif + { + return (void *) malloc( size ); + } + +#ifdef YY_USE_PROTOS +static void *yy_flex_realloc( void *ptr, yy_size_t size ) +#else +static void *yy_flex_realloc( ptr, size ) +void *ptr; +yy_size_t size; +#endif + { + /* The cast to (char *) in the following accommodates both + * implementations that use char* generic pointers, and those + * that use void* generic pointers. It works with the latter + * because both ANSI C and C++ allow castless assignment from + * any pointer type to void*, and deal with argument conversions + * as though doing an assignment. + */ + return (void *) realloc( (char *) ptr, size ); + } + +#ifdef YY_USE_PROTOS +static void yy_flex_free( void *ptr ) +#else +static void yy_flex_free( ptr ) +void *ptr; +#endif + { + free( ptr ); + } + +#if YY_MAIN +int main() + { + yylex(); + return 0; + } +#endif +#line 145 "rds_hostfile_lex.l" + diff --git a/contrib/platform/win32/orte/mca/rmaps/base/static-components.h b/contrib/platform/win32/orte/mca/rmaps/base/static-components.h new file mode 100644 index 0000000000..7718a59a0d --- /dev/null +++ b/contrib/platform/win32/orte/mca/rmaps/base/static-components.h @@ -0,0 +1,18 @@ +/* + * $HEADER$ + */ +#if defined(c_plusplus) || defined(__cplusplus) +extern "C" { +#endif + +extern const mca_base_component_t mca_rmaps_round_robin_component; + +const mca_base_component_t *mca_rmaps_base_static_components[] = { + &mca_rmaps_round_robin_component, + NULL +}; + +#if defined(c_plusplus) || defined(__cplusplus) +} +#endif + diff --git a/contrib/platform/win32/orte/mca/rmgr/base/static-components.h b/contrib/platform/win32/orte/mca/rmgr/base/static-components.h new file mode 100644 index 0000000000..4abeccd88f --- /dev/null +++ b/contrib/platform/win32/orte/mca/rmgr/base/static-components.h @@ -0,0 +1,20 @@ +/* + * $HEADER$ + */ +#if defined(c_plusplus) || defined(__cplusplus) +extern "C" { +#endif + +extern const mca_base_component_t mca_rmgr_proxy_component; +extern const mca_base_component_t mca_rmgr_urm_component; + +const mca_base_component_t *mca_rmgr_base_static_components[] = { + &mca_rmgr_proxy_component, + &mca_rmgr_urm_component, + NULL +}; + +#if defined(c_plusplus) || defined(__cplusplus) +} +#endif + diff --git a/contrib/platform/win32/orte/mca/rml/base/static-components.h b/contrib/platform/win32/orte/mca/rml/base/static-components.h new file mode 100644 index 0000000000..46343a4c49 --- /dev/null +++ b/contrib/platform/win32/orte/mca/rml/base/static-components.h @@ -0,0 +1,18 @@ +/* + * $HEADER$ + */ +#if defined(c_plusplus) || defined(__cplusplus) +extern "C" { +#endif + +extern const mca_base_component_t mca_rml_oob_component; + +const mca_base_component_t *mca_rml_base_static_components[] = { + &mca_rml_oob_component, + NULL +}; + +#if defined(c_plusplus) || defined(__cplusplus) +} +#endif + diff --git a/contrib/platform/win32/orte/mca/routed/base/static-components.h b/contrib/platform/win32/orte/mca/routed/base/static-components.h new file mode 100644 index 0000000000..0886c89aed --- /dev/null +++ b/contrib/platform/win32/orte/mca/routed/base/static-components.h @@ -0,0 +1,18 @@ +/* + * $HEADER$ + */ +#if defined(c_plusplus) || defined(__cplusplus) +extern "C" { +#endif + + + +const mca_base_component_t *mca_routed_base_static_components[] = { + + NULL +}; + +#if defined(c_plusplus) || defined(__cplusplus) +} +#endif + diff --git a/contrib/platform/win32/orte/mca/schema/base/static-components.h b/contrib/platform/win32/orte/mca/schema/base/static-components.h new file mode 100644 index 0000000000..6bb6d5c640 --- /dev/null +++ b/contrib/platform/win32/orte/mca/schema/base/static-components.h @@ -0,0 +1,18 @@ +/* + * $HEADER$ + */ +#if defined(c_plusplus) || defined(__cplusplus) +extern "C" { +#endif + + + +const mca_base_component_t *mca_schema_base_static_components[] = { + + NULL +}; + +#if defined(c_plusplus) || defined(__cplusplus) +} +#endif + diff --git a/contrib/platform/win32/orte/mca/sds/base/static-components.h b/contrib/platform/win32/orte/mca/sds/base/static-components.h new file mode 100644 index 0000000000..0d0b3d223f --- /dev/null +++ b/contrib/platform/win32/orte/mca/sds/base/static-components.h @@ -0,0 +1,24 @@ +/* + * $HEADER$ + */ +#if defined(c_plusplus) || defined(__cplusplus) +extern "C" { +#endif + +extern const mca_base_component_t mca_sds_env_component; +extern const mca_base_component_t mca_sds_seed_component; +extern const mca_base_component_t mca_sds_singleton_component; +extern const mca_base_component_t mca_sds_pipe_component; + +const mca_base_component_t *mca_sds_base_static_components[] = { + &mca_sds_env_component, + &mca_sds_seed_component, + &mca_sds_singleton_component, + &mca_sds_pipe_component, + NULL +}; + +#if defined(c_plusplus) || defined(__cplusplus) +} +#endif + diff --git a/contrib/platform/win32/orte/mca/smr/base/static-components.h b/contrib/platform/win32/orte/mca/smr/base/static-components.h new file mode 100644 index 0000000000..921976d2b1 --- /dev/null +++ b/contrib/platform/win32/orte/mca/smr/base/static-components.h @@ -0,0 +1,18 @@ +/* + * $HEADER$ + */ +#if defined(c_plusplus) || defined(__cplusplus) +extern "C" { +#endif + + + +const mca_base_component_t *mca_smr_base_static_components[] = { + + NULL +}; + +#if defined(c_plusplus) || defined(__cplusplus) +} +#endif + diff --git a/contrib/platform/win32/orte/mca/snapc/base/static-components.h b/contrib/platform/win32/orte/mca/snapc/base/static-components.h new file mode 100644 index 0000000000..4e9eb1685c --- /dev/null +++ b/contrib/platform/win32/orte/mca/snapc/base/static-components.h @@ -0,0 +1,18 @@ +/* + * $HEADER$ + */ +#if defined(c_plusplus) || defined(__cplusplus) +extern "C" { +#endif + + + +const mca_base_component_t *mca_snapc_base_static_components[] = { + + NULL +}; + +#if defined(c_plusplus) || defined(__cplusplus) +} +#endif + diff --git a/contrib/platform/win32/orte/version.h b/contrib/platform/win32/orte/version.h new file mode 100644 index 0000000000..6320e250fb --- /dev/null +++ b/contrib/platform/win32/orte/version.h @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, + * University of Stuttgart. All rights reserved. + * Copyright (c) 2004-2005 The Regents of the University of California. + * All rights reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + * + * This file should be included by any file that needs full + * version information for the ORTE project + */ + +#ifndef ORTE_VERSIONS_H +#define ORTE_VERSIONS_H + +#define ORTE_MAJOR_VERSION 1 +#define ORTE_MINOR_VERSION 3 +#define ORTE_RELEASE_VERSION 0 +#define ORTE_GREEK_VERSION "a1" +#define ORTE_WANT_SVN 1 +#define ORTE_SVN_R "r14150:14151" +#ifdef ORTE_VERSION +/* If we included version.h, we want the real version, not the + stripped (no-r number) verstion */ +#undef ORTE_VERSION +#endif +#define ORTE_VERSION "1.3a1r14150:14151" + +#endif diff --git a/contrib/platform/win32/orte_config.h b/contrib/platform/win32/orte_config.h new file mode 100644 index 0000000000..2a051ef29c --- /dev/null +++ b/contrib/platform/win32/orte_config.h @@ -0,0 +1,55 @@ +/* orte/include/orte_config.h. Generated from orte_config.h.in by configure. */ +/* -*- c -*- + * + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2006 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, + * University of Stuttgart. All rights reserved. + * Copyright (c) 2004-2005 The Regents of the University of California. + * All rights reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + * + * Function: - OS, CPU and compiler dependent configuration + */ + +#ifndef ORTE_CONFIG_H +#define ORTE_CONFIG_H + +#include "opal_config.h" + +#if defined(__WINDOWS__) + +# if defined(_USRDLL) /* building shared libraries (.DLL) */ +# if defined(ORTE_EXPORTS) +# define ORTE_DECLSPEC __declspec(dllexport) +# define ORTE_MODULE_DECLSPEC +# else +# define ORTE_DECLSPEC __declspec(dllimport) +# if defined(ORTE_MODULE_EXPORTS) +# define ORTE_MODULE_DECLSPEC __declspec(dllexport) +# else +# define ORTE_MODULE_DECLSPEC __declspec(dllimport) +# endif /* defined(ORTE_MODULE_EXPORTS) */ +# endif /* defined(ORTE_EXPORTS) */ +# else /* building static library or external includes */ +# if defined(ORTE_IMPORTS) +# define ORTE_DECLSPEC __declspec(dllimport) +# else +# define ORTE_DECLSPEC +# endif /* defined(ORTE_IMPORTS) */ +# define ORTE_MODULE_DECLSPEC +# endif +#else +# define ORTE_DECLSPEC +# define ORTE_MODULE_DECLSPEC +#endif /* defined(__WINDOWS__) */ + +#endif diff --git a/contrib/platform/win32/romioconf.h b/contrib/platform/win32/romioconf.h new file mode 100644 index 0000000000..10f85716cd --- /dev/null +++ b/contrib/platform/win32/romioconf.h @@ -0,0 +1,328 @@ +/* adio/include/romioconf.h. Generated from romioconf.h.in by configure. */ +/* adio/include/romioconf.h.in. Generated from configure.in by autoheader. */ + +#include "romioconf-undefs.h" + +/* Define if no signotify */ +/* #undef AIO_SIGNOTIFY_NONE */ + +/* Define for AIX */ +/* #undef AIX */ + +/* Define if Cray */ +/* #undef CRAY */ + +/* Define if aio.h exists and can be compiled */ +/*#define HAVE_AIO_H 0*/ + +/* Define to 1 if you have the header file. */ +#define HAVE_DLFCN_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_FCNTL_H 1 + +/* Define to 1 if you have the `fsync' function. */ +#define HAVE_FSYNC 1 + +/* Define to 1 if you have the `ftruncate' function. */ +#define HAVE_FTRUNCATE 1 + +/* Define if GNU __attribute__ is supported */ +/* #define HAVE_GCC_ATTRIBUTE 1 */ + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* Define if long long is 64 bits */ +#define HAVE_LONG_LONG_64 1 + +/* Define to 1 if you have the `lstat' function. */ +#define HAVE_LSTAT 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_MALLOC_H 1 + +/* Define to 1 if you have the `memalign' function. */ +#define HAVE_MEMALIGN 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_MEMORY_H 1 + +/* Define if MPI combiners available */ +/* #undef HAVE_MPI_COMBINERS */ + +/* Define if Darray is available */ +#define HAVE_MPI_DARRAY_SUBARRAY 1 + +/* Define if generalized requests avaliable */ +/* #undef HAVE_MPI_GREQUEST */ + +/* Define if MPI Info is available */ +#define HAVE_MPI_INFO 1 + +/* Define if supports long long int */ +/* #undef HAVE_MPI_LONG_LONG_INT */ + +/* Will always be 1 - OMPI has MPI_OFFSET */ +#define HAVE_MPI_OFFSET 1 + +/* Define for CRAY weak dup */ +/* #undef HAVE_PRAGMA_CRI_DUP */ + +/* Define for HP weak pragma */ +/* #undef HAVE_PRAGMA_HP_SEC_DEF */ + +/* Define if pragma weak available */ +/* #undef HAVE_PRAGMA_WEAK */ + +/* Define if pread64 available */ +/* #undef HAVE_PREAD64 */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_PVFS2_H */ + +/* Define if PVFS2_SUPER_MAGIC defined. */ +/* #undef HAVE_PVFS2_SUPER_MAGIC */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_PVFS_H */ + +/* Define if PVFS_SUPER_MAGIC defined. */ +/* #undef HAVE_PVFS_SUPER_MAGIC */ + +/* Define to 1 if you have the `readlink' function. */ +#define HAVE_READLINK 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SIGNAL_H 1 + +/* Define to 1 if you have the `snprintf' function. */ +/*#define HAVE_SNPRINTF 0*/ + +/* Define if stat function is present */ +#define HAVE_STAT 1 + +/* Define if status set bytes available */ +#define HAVE_STATUS_SET_BYTES 1 + +/* Define if statvfs function is present */ +#define HAVE_STATVFS 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDDEF_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the `strdup' function. */ +#define HAVE_STRDUP 1 + +/* Define to 1 if you have the `strerror' function. */ +#define HAVE_STRERROR 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define if struct statfs can be compiled */ +#define HAVE_STRUCT_STATFS 1 + +/* Define if sys/aio.h exists and can be compiled */ +/* #undef HAVE_SYS_AIO_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_MOUNT_H 1 + +/* Define to 1 if you have the header file. */ +/*#define HAVE_SYS_PARAM_H 1*/ + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STATVFS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_VFS_H 1 + +/* Define to 1 if you have the header file. */ +/*#define HAVE_UNISTD_H 1*/ + +/* Define if weak symbols available */ +/* #undef HAVE_WEAK_SYMBOLS */ + +/* Define for HPUX */ +/* #undef HPUX */ + +/* Define if int smaller than pointer */ +/*#define INT_LT_POINTER 1*/ + +/* Define if IRIX */ +/* #undef IRIX */ + +/* Define if compiling within MPICH */ +/* #undef MPICH */ + +/* Define if using HP MPI */ +/* #undef MPIHP */ + +/* Define if compiling within LAM/MPI */ +/* #undef MPILAM */ + +/* hack to make ROMIO build without profiling */ +#define MPIO_BUILD_PROFILING 1 + +/* Define if SGI MPI */ +/* #undef MPISGI */ + +/* Define if MPI_Offset is int */ +/* #undef MPI_OFFSET_IS_INT */ + +/* Define if fsync needs a declaration */ +/* #undef NEEDS_FSYNC_DECL */ + +/* Define if ftruncate needs a declaration */ +/* #undef NEEDS_FTRUNCATE_DECL */ + +/* Define if l_start and l_len data should be cast as int */ +/* #undef NEEDS_INT_CAST_WITH_FLOCK */ + +/* Define if lstat needs a declaration */ +#define NEEDS_LSTAT_DECL 1 + +/* Define if mpi_test needed */ +/* #undef NEEDS_MPI_TEST */ + +/* Define if readlink needs a declaration */ +/* #undef NEEDS_READLINK_DECL */ + +/* Define if snprintf needs a declaration */ +/* #undef NEEDS_SNPRINTF_DECL */ + +/* Define if strdup needs a declaration */ +/* #undef NEEDS_STRDUP_DECL */ + +/* Define if no MPI type is contig */ +/* #undef NO_MPI_SGI_type_is_contig */ + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "" + +/* Define for printing error messages */ +/* #undef PRINT_ERR_MSG */ + +/* Define for ROMIO with gridftp */ +/* #undef ROMIO_GRIDFTP */ + +/* Define if AIO calls need file descriptor */ +/* #undef ROMIO_HAVE_AIO_CALLS_NEED_FILEDES */ + +/* Define if aio_suspend needs two arguments */ +/* #undef ROMIO_HAVE_AIO_SUSPEND_TWO_ARGS */ + +/* Define if aiocb has aio_fildes member */ +#define ROMIO_HAVE_STRUCT_AIOCB_WITH_AIO_FILDES 1 + +/* Define if aiocb has aio_handle member */ +/* #undef ROMIO_HAVE_STRUCT_AIOCB_WITH_AIO_HANDLE */ + +/* Define if aiocb has aio_reqprio member */ +#define ROMIO_HAVE_STRUCT_AIOCB_WITH_AIO_REQPRIO 1 + +/* Define if aiocb has aio_sigevent member */ +#define ROMIO_HAVE_STRUCT_AIOCB_WITH_AIO_SIGEVENT 1 + +/* Define if aiocb has aio_whence member */ +/* #undef ROMIO_HAVE_STRUCT_AIOCB_WITH_AIO_WHENCE */ + +/* Define if statfs has f_fstypename */ +/* #undef ROMIO_HAVE_STRUCT_STATFS_WITH_F_FSTYPENAME */ + +/* defined if struct statvfs has a f_basetype member */ +/* #undef ROMIO_HAVE_STRUCT_STATVFS_WITH_F_BASETYPE */ + +/* Define if struct stat has a st_fstype member */ +/* #undef ROMIO_HAVE_STRUCT_STAT_WITH_ST_FSTYPE */ + +/* Define if AIO calls seem to work */ +#define ROMIO_HAVE_WORKING_AIO 1 + +/* Define for ROMIO with HFS */ +/* #undef ROMIO_HFS */ + +/* Define if compiling within MPICH2 */ +/* #undef ROMIO_INSIDE_MPICH2 */ + +/* Define for ROMIO with NFS */ +#define ROMIO_NFS 1 + +/* Define for ROMIO with NTFS */ +#define ROMIO_NTFS 1 + +/* Define for ROMIO with PANFS */ +/* #undef ROMIO_PANFS */ + +/* Define for ROMIO with PFS */ +/* #undef ROMIO_PFS */ + +/* Define for ROMIO with PVFS */ +/* #undef ROMIO_PVFS */ + +/* Define for ROMIO with PVFS2 */ +/* #undef ROMIO_PVFS2 */ + +/* Define if int64_t must be defined for PVFS */ +/* #undef ROMIO_PVFS_NEEDS_INT64_DEFINITION */ + +/* Define for ROMIO with SFS */ +/* #undef ROMIO_SFS */ + +/* Define for ROMIO with TESTFS */ +#define ROMIO_TESTFS 1 + +/* Define for ROMIO with UFS */ +#define ROMIO_UFS 1 + +/* Define for ROMIO with XFS */ +/* #undef ROMIO_XFS */ + +/* The size of `int', as computed by sizeof. */ +#define SIZEOF_INT 4 + +/* The size of `long long', as computed by sizeof. */ +#define SIZEOF_LONG_LONG 8 + +/* The size of `void *', as computed by sizeof. */ +#define SIZEOF_VOID_P 8 + +/* Define for SPPUX (Convex) */ +/* #undef SPPUX */ + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Define for NEC SX4 */ +/* #undef SX4 */ + +/* if C does not support restrict */ + #define restrict diff --git a/contrib/platform/win32/show_help_lex.c b/contrib/platform/win32/show_help_lex.c new file mode 100644 index 0000000000..03284bb5b8 --- /dev/null +++ b/contrib/platform/win32/show_help_lex.c @@ -0,0 +1,1704 @@ +#define yy_create_buffer opal_show_help_yy_create_buffer +#define yy_delete_buffer opal_show_help_yy_delete_buffer +#define yy_scan_buffer opal_show_help_yy_scan_buffer +#define yy_scan_string opal_show_help_yy_scan_string +#define yy_scan_bytes opal_show_help_yy_scan_bytes +#define yy_flex_debug opal_show_help_yy_flex_debug +#define yy_init_buffer opal_show_help_yy_init_buffer +#define yy_flush_buffer opal_show_help_yy_flush_buffer +#define yy_load_buffer_state opal_show_help_yy_load_buffer_state +#define yy_switch_to_buffer opal_show_help_yy_switch_to_buffer +#define yyin opal_show_help_yyin +#define yyleng opal_show_help_yyleng +#define yylex opal_show_help_yylex +#define yyout opal_show_help_yyout +#define yyrestart opal_show_help_yyrestart +#define yytext opal_show_help_yytext +#define yywrap opal_show_help_yywrap + +/* A lexical scanner generated by flex */ + +/* Scanner skeleton version: + * $Header: /home/daffy/u0/vern/flex/RCS/flex.skl,v 2.91 96/09/10 16:58:48 vern Exp $ + */ + +#define FLEX_SCANNER +#define YY_FLEX_MAJOR_VERSION 2 +#define YY_FLEX_MINOR_VERSION 5 + +#include +#include + +/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */ +#ifdef c_plusplus +#ifndef __cplusplus +#define __cplusplus +#endif +#endif + + +#ifdef __cplusplus + +#include +#ifndef _WIN32 +#include +#endif + +/* Use prototypes in function declarations. */ +#define YY_USE_PROTOS + +/* The "const" storage-class-modifier is valid. */ +#define YY_USE_CONST + +#else /* ! __cplusplus */ + +#if __STDC__ + +#define YY_USE_PROTOS +#define YY_USE_CONST + +#endif /* __STDC__ */ +#endif /* ! __cplusplus */ + +#ifdef __TURBOC__ + #pragma warn -rch + #pragma warn -use +#include +#include +#define YY_USE_CONST +#define YY_USE_PROTOS +#endif + +#ifdef YY_USE_CONST +#define yyconst const +#else +#define yyconst +#endif + + +#ifdef YY_USE_PROTOS +#define YY_PROTO(proto) proto +#else +#define YY_PROTO(proto) () +#endif + + +/* Returned upon end-of-file. */ +#define YY_NULL 0 + +/* Promotes a possibly negative, possibly signed char to an unsigned + * integer for use as an array index. If the signed char is negative, + * we want to instead treat it as an 8-bit unsigned char, hence the + * double cast. + */ +#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) + +/* Enter a start condition. This macro really ought to take a parameter, + * but we do it the disgusting crufty way forced on us by the ()-less + * definition of BEGIN. + */ +#define BEGIN yy_start = 1 + 2 * + +/* Translate the current start state into a value that can be later handed + * to BEGIN to return to the state. The YYSTATE alias is for lex + * compatibility. + */ +#define YY_START ((yy_start - 1) / 2) +#define YYSTATE YY_START + +/* Action number for EOF rule of a given start state. */ +#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) + +/* Special action meaning "start processing a new file". */ +#define YY_NEW_FILE yyrestart( yyin ) + +#define YY_END_OF_BUFFER_CHAR 0 + +/* Size of default input buffer. */ +#define YY_BUF_SIZE 16384 + +typedef struct yy_buffer_state *YY_BUFFER_STATE; + +extern int yyleng; +extern FILE *yyin, *yyout; + +#define EOB_ACT_CONTINUE_SCAN 0 +#define EOB_ACT_END_OF_FILE 1 +#define EOB_ACT_LAST_MATCH 2 + +/* The funky do-while in the following #define is used to turn the definition + * int a single C statement (which needs a semi-colon terminator). This + * avoids problems with code like: + * + * if ( condition_holds ) + * yyless( 5 ); + * else + * do_something_else(); + * + * Prior to using the do-while the compiler would get upset at the + * "else" because it interpreted the "if" statement as being all + * done when it reached the ';' after the yyless() call. + */ + +/* Return all but the first 'n' matched characters back to the input stream. */ + +#define yyless(n) \ + do \ + { \ + /* Undo effects of setting up yytext. */ \ + *yy_cp = yy_hold_char; \ + YY_RESTORE_YY_MORE_OFFSET \ + yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \ + YY_DO_BEFORE_ACTION; /* set up yytext again */ \ + } \ + while ( 0 ) + +#define unput(c) yyunput( c, yytext_ptr ) + +/* The following is because we cannot portably get our hands on size_t + * (without autoconf's help, which isn't available because we want + * flex-generated scanners to compile on their own). + */ +typedef unsigned int yy_size_t; + + +struct yy_buffer_state + { + FILE *yy_input_file; + + char *yy_ch_buf; /* input buffer */ + char *yy_buf_pos; /* current position in input buffer */ + + /* Size of input buffer in bytes, not including room for EOB + * characters. + */ + yy_size_t yy_buf_size; + + /* Number of characters read into yy_ch_buf, not including EOB + * characters. + */ + int yy_n_chars; + + /* Whether we "own" the buffer - i.e., we know we created it, + * and can realloc() it to grow it, and should free() it to + * delete it. + */ + int yy_is_our_buffer; + + /* Whether this is an "interactive" input source; if so, and + * if we're using stdio for input, then we want to use getc() + * instead of fread(), to make sure we stop fetching input after + * each newline. + */ + int yy_is_interactive; + + /* Whether we're considered to be at the beginning of a line. + * If so, '^' rules will be active on the next match, otherwise + * not. + */ + int yy_at_bol; + + /* Whether to try to fill the input buffer when we reach the + * end of it. + */ + int yy_fill_buffer; + + int yy_buffer_status; +#define YY_BUFFER_NEW 0 +#define YY_BUFFER_NORMAL 1 + /* When an EOF's been seen but there's still some text to process + * then we mark the buffer as YY_EOF_PENDING, to indicate that we + * shouldn't try reading from the input source any more. We might + * still have a bunch of tokens to match, though, because of + * possible backing-up. + * + * When we actually see the EOF, we change the status to "new" + * (via yyrestart()), so that the user can continue scanning by + * just pointing yyin at a new input file. + */ +#define YY_BUFFER_EOF_PENDING 2 + }; + +static YY_BUFFER_STATE yy_current_buffer = 0; + +/* We provide macros for accessing buffer states in case in the + * future we want to put the buffer states in a more general + * "scanner state". + */ +#define YY_CURRENT_BUFFER yy_current_buffer + + +/* yy_hold_char holds the character lost when yytext is formed. */ +static char yy_hold_char; + +static int yy_n_chars; /* number of characters read into yy_ch_buf */ + + +int yyleng; + +/* Points to current character in buffer. */ +static char *yy_c_buf_p = (char *) 0; +static int yy_init = 1; /* whether we need to initialize */ +static int yy_start = 0; /* start state number */ + +/* Flag which is used to allow yywrap()'s to do buffer switches + * instead of setting up a fresh yyin. A bit of a hack ... + */ +static int yy_did_buffer_switch_on_eof; + +void yyrestart YY_PROTO(( FILE *input_file )); + +void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer )); +void yy_load_buffer_state YY_PROTO(( void )); +YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size )); +void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b )); +void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file )); +void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b )); +#define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer ) + +YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size )); +YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str )); +YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len )); + +static void *yy_flex_alloc YY_PROTO(( yy_size_t )); +static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t )); +static void yy_flex_free YY_PROTO(( void * )); + +#define yy_new_buffer yy_create_buffer + +#define yy_set_interactive(is_interactive) \ + { \ + if ( ! yy_current_buffer ) \ + yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ + yy_current_buffer->yy_is_interactive = is_interactive; \ + } + +#define yy_set_bol(at_bol) \ + { \ + if ( ! yy_current_buffer ) \ + yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ + yy_current_buffer->yy_at_bol = at_bol; \ + } + +#define YY_AT_BOL() (yy_current_buffer->yy_at_bol) + + +#define YY_USES_REJECT +typedef unsigned char YY_CHAR; +FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; +typedef int yy_state_type; +extern char *yytext; +#define yytext_ptr yytext + +static yy_state_type yy_get_previous_state YY_PROTO(( void )); +static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state )); +static int yy_get_next_buffer YY_PROTO(( void )); +static void yy_fatal_error YY_PROTO(( yyconst char msg[] )); + +/* Done after the current pattern has been matched and before the + * corresponding action - sets up yytext. + */ +#define YY_DO_BEFORE_ACTION \ + yytext_ptr = yy_bp; \ + yyleng = (int) (yy_cp - yy_bp); \ + yy_hold_char = *yy_cp; \ + *yy_cp = '\0'; \ + yy_c_buf_p = yy_cp; + +#define YY_NUM_RULES 5 +#define YY_END_OF_BUFFER 6 +static yyconst short int yy_acclist[18] = + { 0, + 6, 5, 4, 5, 5, 5, 5, 3, 5, 4, + 1, 4, 3,16386, 8194, 4,16386 + } ; + +static yyconst short int yy_accept[25] = + { 0, + 1, 1, 1, 1, 1, 2, 3, 5, 6, 7, + 8, 10, 10, 11, 11, 13, 13, 13, 14, 15, + 15, 17, 18, 18 + } ; + +static yyconst int yy_ec[256] = + { 0, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 4, 1, 5, 1, 1, 1, 1, 1, 1, 1, + + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1 + } ; + +static yyconst int yy_meta[6] = + { 0, + 1, 1, 1, 1, 1 + } ; + +static yyconst short int yy_base[31] = + { 0, + 0, 3, 28, 27, 28, 25, 31, 24, 23, 22, + 31, 21, 31, 20, 31, 7, 19, 31, 11, 15, + 31, 0, 31, 18, 17, 14, 13, 10, 9, 0 + } ; + +static yyconst short int yy_def[31] = + { 0, + 24, 23, 25, 25, 23, 26, 23, 27, 28, 29, + 23, 26, 23, 27, 23, 28, 29, 23, 30, 30, + 23, 20, 0, 23, 23, 23, 23, 23, 23, 23 + } ; + +static yyconst short int yy_nxt[37] = + { 0, + 20, 7, 8, 6, 7, 8, 9, 6, 13, 17, + 16, 19, 21, 14, 12, 22, 21, 10, 6, 22, + 18, 15, 13, 18, 13, 15, 13, 23, 11, 11, + 5, 23, 23, 23, 23, 23 + } ; + +static yyconst short int yy_chk[37] = + { 0, + 30, 1, 1, 2, 2, 2, 2, 2, 16, 29, + 28, 16, 19, 27, 26, 19, 20, 25, 24, 20, + 17, 14, 12, 10, 9, 8, 6, 5, 4, 3, + 23, 23, 23, 23, 23, 23 + } ; + +static yy_state_type yy_state_buf[YY_BUF_SIZE + 2], *yy_state_ptr; +static char *yy_full_match; +static int yy_lp; +static int yy_looking_for_trail_begin = 0; +static int yy_full_lp; +static int *yy_full_state; +#define YY_TRAILING_MASK 0x2000 +#define YY_TRAILING_HEAD_MASK 0x4000 +#define REJECT \ +{ \ +*yy_cp = yy_hold_char; /* undo effects of setting up yytext */ \ +yy_cp = yy_full_match; /* restore poss. backed-over text */ \ +yy_lp = yy_full_lp; /* restore orig. accepting pos. */ \ +yy_state_ptr = yy_full_state; /* restore orig. state */ \ +yy_current_state = *yy_state_ptr; /* restore curr. state */ \ +++yy_lp; \ +goto find_rule; \ +} +#define yymore() yymore_used_but_not_detected +#define YY_MORE_ADJ 0 +#define YY_RESTORE_YY_MORE_OFFSET +char *yytext; +#line 1 "show_help_lex.l" +#define INITIAL 0 +#line 2 "show_help_lex.l" +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2006 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, + * University of Stuttgart. All rights reserved. + * Copyright (c) 2004-2005 The Regents of the University of California. + * All rights reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +#include "opal_config.h" + +#include +#if HAVE_UNISTD_H +#include +#endif + +#include "opal/util/show_help_lex.h" + +#if defined(c_plusplus) || defined(__cplusplus) +extern "C" { +#endif + +/* + * public functions + */ +extern int opal_show_help_finish_parsing(void); + +/* + * local functions + */ +static int opal_show_help_yywrap(void); + +#if defined(c_plusplus) || defined(__cplusplus) +} +#endif + +/* + * global variables + */ +int opal_show_help_yynewlines = 1; +bool opal_show_help_parse_done = false; +char *opal_show_help_string = NULL; + +#define yyterminate() \ + return opal_show_help_finish_parsing() + +#define CHOMP 1 + +#line 473 "show_help_lex.c" + +/* Macros after this point can all be overridden by user definitions in + * section 1. + */ + +#ifndef YY_SKIP_YYWRAP +#ifdef __cplusplus +extern "C" int yywrap YY_PROTO(( void )); +#else +extern int yywrap YY_PROTO(( void )); +#endif +#endif + +#ifndef YY_NO_UNPUT +static void yyunput YY_PROTO(( int c, char *buf_ptr )); +#endif + +#ifndef yytext_ptr +static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int )); +#endif + +#ifdef YY_NEED_STRLEN +static int yy_flex_strlen YY_PROTO(( yyconst char * )); +#endif + +#ifndef YY_NO_INPUT +#ifdef __cplusplus +static int yyinput YY_PROTO(( void )); +#else +static int input YY_PROTO(( void )); +#endif +#endif + +#if YY_STACK_USED +static int yy_start_stack_ptr = 0; +static int yy_start_stack_depth = 0; +static int *yy_start_stack = 0; +#ifndef YY_NO_PUSH_STATE +static void yy_push_state YY_PROTO(( int new_state )); +#endif +#ifndef YY_NO_POP_STATE +static void yy_pop_state YY_PROTO(( void )); +#endif +#ifndef YY_NO_TOP_STATE +static int yy_top_state YY_PROTO(( void )); +#endif + +#else +#define YY_NO_PUSH_STATE 1 +#define YY_NO_POP_STATE 1 +#define YY_NO_TOP_STATE 1 +#endif + +#ifdef YY_MALLOC_DECL +YY_MALLOC_DECL +#else +#if __STDC__ +#ifndef __cplusplus +#include +#endif +#else +/* Just try to get by without declaring the routines. This will fail + * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int) + * or sizeof(void*) != sizeof(int). + */ +#endif +#endif + +/* Amount of stuff to slurp up with each read. */ +#ifndef YY_READ_BUF_SIZE +#define YY_READ_BUF_SIZE 8192 +#endif + +/* Copy whatever the last rule matched to the standard output. */ + +#ifndef ECHO +/* This used to be an fputs(), but since the string might contain NUL's, + * we now use fwrite(). + */ +#define ECHO (void) fwrite( yytext, yyleng, 1, yyout ) +#endif + +/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, + * is returned in "result". + */ +#ifndef YY_INPUT +#define YY_INPUT(buf,result,max_size) \ + if ( yy_current_buffer->yy_is_interactive ) \ + { \ + int c = '*', n; \ + for ( n = 0; n < max_size && \ + (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ + buf[n] = (char) c; \ + if ( c == '\n' ) \ + buf[n++] = (char) c; \ + if ( c == EOF && ferror( yyin ) ) \ + YY_FATAL_ERROR( "input in flex scanner failed" ); \ + result = n; \ + } \ + else \ + { \ + errno=0; \ + while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \ + { \ + if( errno != EINTR) \ + { \ + YY_FATAL_ERROR( "input in flex scanner failed" ); \ + break; \ + } \ + errno=0; \ + clearerr(yyin); \ + } \ + } +#endif + +/* No semi-colon after return; correct usage is to write "yyterminate();" - + * we don't want an extra ';' after the "return" because that will cause + * some compilers to complain about unreachable statements. + */ +#ifndef yyterminate +#define yyterminate() return YY_NULL +#endif + +/* Number of entries by which start-condition stack grows. */ +#ifndef YY_START_STACK_INCR +#define YY_START_STACK_INCR 25 +#endif + +/* Report a fatal error. */ +#ifndef YY_FATAL_ERROR +#define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) +#endif + +/* Default declaration of generated scanner - a define so the user can + * easily add parameters. + */ +#ifndef YY_DECL +#define YY_DECL int yylex YY_PROTO(( void )) +#endif + +/* Code executed at the beginning of each rule, after yytext and yyleng + * have been set up. + */ +#ifndef YY_USER_ACTION +#define YY_USER_ACTION +#endif + +/* Code executed at the end of each rule. */ +#ifndef YY_BREAK +#define YY_BREAK break; +#endif + +#define YY_RULE_SETUP \ + if ( yyleng > 0 ) \ + yy_current_buffer->yy_at_bol = \ + (yytext[yyleng - 1] == '\n'); \ + YY_USER_ACTION + +YY_DECL + { + register yy_state_type yy_current_state; + register char *yy_cp, *yy_bp; + register int yy_act; + +#line 64 "show_help_lex.l" + + +#line 641 "show_help_lex.c" + + if ( yy_init ) + { + yy_init = 0; + +#ifdef YY_USER_INIT + YY_USER_INIT; +#endif + + if ( ! yy_start ) + yy_start = 1; /* first start state */ + + if ( ! yyin ) + yyin = stdin; + + if ( ! yyout ) + yyout = stdout; + + if ( ! yy_current_buffer ) + yy_current_buffer = + yy_create_buffer( yyin, YY_BUF_SIZE ); + + yy_load_buffer_state(); + } + + while ( 1 ) /* loops until end-of-file is reached */ + { + yy_cp = yy_c_buf_p; + + /* Support of yytext. */ + *yy_cp = yy_hold_char; + + /* yy_bp points to the position in yy_ch_buf of the start of + * the current run. + */ + yy_bp = yy_cp; + + yy_current_state = yy_start; + yy_current_state += YY_AT_BOL(); + yy_state_ptr = yy_state_buf; + *yy_state_ptr++ = yy_current_state; +yy_match: + do + { + register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 24 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + *yy_state_ptr++ = yy_current_state; + ++yy_cp; + } + while ( yy_base[yy_current_state] != 31 ); + +yy_find_action: + yy_current_state = *--yy_state_ptr; + yy_lp = yy_accept[yy_current_state]; +find_rule: /* we branch to this label when backing up */ + for ( ; ; ) /* until we find what rule we matched */ + { + if ( yy_lp && yy_lp < yy_accept[yy_current_state + 1] ) + { + yy_act = yy_acclist[yy_lp]; + if ( yy_act & YY_TRAILING_HEAD_MASK || + yy_looking_for_trail_begin ) + { + if ( yy_act == yy_looking_for_trail_begin ) + { + yy_looking_for_trail_begin = 0; + yy_act &= ~YY_TRAILING_HEAD_MASK; + break; + } + } + else if ( yy_act & YY_TRAILING_MASK ) + { + yy_looking_for_trail_begin = yy_act & ~YY_TRAILING_MASK; + yy_looking_for_trail_begin |= YY_TRAILING_HEAD_MASK; + } + else + { + yy_full_match = yy_cp; + yy_full_state = yy_state_ptr; + yy_full_lp = yy_lp; + break; + } + ++yy_lp; + goto find_rule; + } + --yy_cp; + yy_current_state = *--yy_state_ptr; + yy_lp = yy_accept[yy_current_state]; + } + + YY_DO_BEFORE_ACTION; + + +do_action: /* This label is used only to access EOF actions. */ + + + switch ( yy_act ) + { /* beginning of action switch */ +case 1: +YY_RULE_SETUP +#line 66 "show_help_lex.l" +; /* comment line */ + YY_BREAK +case 2: +YY_RULE_SETUP +#line 68 "show_help_lex.l" +{ BEGIN(CHOMP); return OPAL_SHOW_HELP_PARSE_TOPIC; } + YY_BREAK +case 3: +YY_RULE_SETUP +#line 70 "show_help_lex.l" +{ BEGIN(INITIAL); } + YY_BREAK +case 4: +*yy_cp = yy_hold_char; /* undo effects of setting up yytext */ +yy_c_buf_p = yy_cp -= 1; +YY_DO_BEFORE_ACTION; /* set up yytext again */ +YY_RULE_SETUP +#line 72 "show_help_lex.l" +{ BEGIN(CHOMP); return OPAL_SHOW_HELP_PARSE_MESSAGE; } + YY_BREAK +case 5: +YY_RULE_SETUP +#line 74 "show_help_lex.l" +ECHO; + YY_BREAK +#line 774 "show_help_lex.c" + case YY_STATE_EOF(INITIAL): + case YY_STATE_EOF(CHOMP): + yyterminate(); + + case YY_END_OF_BUFFER: + { + /* Amount of text matched not including the EOB char. */ + int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1; + + /* Undo the effects of YY_DO_BEFORE_ACTION. */ + *yy_cp = yy_hold_char; + YY_RESTORE_YY_MORE_OFFSET + + if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW ) + { + /* We're scanning a new file or input source. It's + * possible that this happened because the user + * just pointed yyin at a new source and called + * yylex(). If so, then we have to assure + * consistency between yy_current_buffer and our + * globals. Here is the right place to do so, because + * this is the first action (other than possibly a + * back-up) that will match for the new input source. + */ + yy_n_chars = yy_current_buffer->yy_n_chars; + yy_current_buffer->yy_input_file = yyin; + yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL; + } + + /* Note that here we test for yy_c_buf_p "<=" to the position + * of the first EOB in the buffer, since yy_c_buf_p will + * already have been incremented past the NUL character + * (since all states make transitions on EOB to the + * end-of-buffer state). Contrast this with the test + * in input(). + */ + if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] ) + { /* This was really a NUL. */ + yy_state_type yy_next_state; + + yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text; + + yy_current_state = yy_get_previous_state(); + + /* Okay, we're now positioned to make the NUL + * transition. We couldn't have + * yy_get_previous_state() go ahead and do it + * for us because it doesn't know how to deal + * with the possibility of jamming (and we don't + * want to build jamming into it because then it + * will run more slowly). + */ + + yy_next_state = yy_try_NUL_trans( yy_current_state ); + + yy_bp = yytext_ptr + YY_MORE_ADJ; + + if ( yy_next_state ) + { + /* Consume the NUL. */ + yy_cp = ++yy_c_buf_p; + yy_current_state = yy_next_state; + goto yy_match; + } + + else + { + yy_cp = yy_c_buf_p; + goto yy_find_action; + } + } + + else switch ( yy_get_next_buffer() ) + { + case EOB_ACT_END_OF_FILE: + { + yy_did_buffer_switch_on_eof = 0; + + if ( yywrap() ) + { + /* Note: because we've taken care in + * yy_get_next_buffer() to have set up + * yytext, we can now set up + * yy_c_buf_p so that if some total + * hoser (like flex itself) wants to + * call the scanner after we return the + * YY_NULL, it'll still work - another + * YY_NULL will get returned. + */ + yy_c_buf_p = yytext_ptr + YY_MORE_ADJ; + + yy_act = YY_STATE_EOF(YY_START); + goto do_action; + } + + else + { + if ( ! yy_did_buffer_switch_on_eof ) + YY_NEW_FILE; + } + break; + } + + case EOB_ACT_CONTINUE_SCAN: + yy_c_buf_p = + yytext_ptr + yy_amount_of_matched_text; + + yy_current_state = yy_get_previous_state(); + + yy_cp = yy_c_buf_p; + yy_bp = yytext_ptr + YY_MORE_ADJ; + goto yy_match; + + case EOB_ACT_LAST_MATCH: + yy_c_buf_p = + &yy_current_buffer->yy_ch_buf[yy_n_chars]; + + yy_current_state = yy_get_previous_state(); + + yy_cp = yy_c_buf_p; + yy_bp = yytext_ptr + YY_MORE_ADJ; + goto yy_find_action; + } + break; + } + + default: + YY_FATAL_ERROR( + "fatal flex scanner internal error--no action found" ); + } /* end of action switch */ + } /* end of scanning one token */ + } /* end of yylex */ + + +/* yy_get_next_buffer - try to read in a new buffer + * + * Returns a code representing an action: + * EOB_ACT_LAST_MATCH - + * EOB_ACT_CONTINUE_SCAN - continue scanning from current position + * EOB_ACT_END_OF_FILE - end of file + */ + +static int yy_get_next_buffer() + { + register char *dest = yy_current_buffer->yy_ch_buf; + register char *source = yytext_ptr; + register int number_to_move, i; + int ret_val; + + if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] ) + YY_FATAL_ERROR( + "fatal flex scanner internal error--end of buffer missed" ); + + if ( yy_current_buffer->yy_fill_buffer == 0 ) + { /* Don't try to fill the buffer, so this is an EOF. */ + if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 ) + { + /* We matched a single character, the EOB, so + * treat this as a final EOF. + */ + return EOB_ACT_END_OF_FILE; + } + + else + { + /* We matched some text prior to the EOB, first + * process it. + */ + return EOB_ACT_LAST_MATCH; + } + } + + /* Try to read more data. */ + + /* First move last chars to start of buffer. */ + number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1; + + for ( i = 0; i < number_to_move; ++i ) + *(dest++) = *(source++); + + if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING ) + /* don't do the read, it's not guaranteed to return an EOF, + * just force an EOF + */ + yy_current_buffer->yy_n_chars = yy_n_chars = 0; + + else + { + int num_to_read = + yy_current_buffer->yy_buf_size - number_to_move - 1; + + while ( num_to_read <= 0 ) + { /* Not enough room in the buffer - grow it. */ +#ifdef YY_USES_REJECT + YY_FATAL_ERROR( +"input buffer overflow, can't enlarge buffer because scanner uses REJECT" ); +#else + + /* just a shorter name for the current buffer */ + YY_BUFFER_STATE b = yy_current_buffer; + + int yy_c_buf_p_offset = + (int) (yy_c_buf_p - b->yy_ch_buf); + + if ( b->yy_is_our_buffer ) + { + int new_size = b->yy_buf_size * 2; + + if ( new_size <= 0 ) + b->yy_buf_size += b->yy_buf_size / 8; + else + b->yy_buf_size *= 2; + + b->yy_ch_buf = (char *) + /* Include room in for 2 EOB chars. */ + yy_flex_realloc( (void *) b->yy_ch_buf, + b->yy_buf_size + 2 ); + } + else + /* Can't grow it, we don't own it. */ + b->yy_ch_buf = 0; + + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( + "fatal error - scanner input buffer overflow" ); + + yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; + + num_to_read = yy_current_buffer->yy_buf_size - + number_to_move - 1; +#endif + } + + if ( num_to_read > YY_READ_BUF_SIZE ) + num_to_read = YY_READ_BUF_SIZE; + + /* Read in more data. */ + YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]), + yy_n_chars, num_to_read ); + + yy_current_buffer->yy_n_chars = yy_n_chars; + } + + if ( yy_n_chars == 0 ) + { + if ( number_to_move == YY_MORE_ADJ ) + { + ret_val = EOB_ACT_END_OF_FILE; + yyrestart( yyin ); + } + + else + { + ret_val = EOB_ACT_LAST_MATCH; + yy_current_buffer->yy_buffer_status = + YY_BUFFER_EOF_PENDING; + } + } + + else + ret_val = EOB_ACT_CONTINUE_SCAN; + + yy_n_chars += number_to_move; + yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR; + yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; + + yytext_ptr = &yy_current_buffer->yy_ch_buf[0]; + + return ret_val; + } + + +/* yy_get_previous_state - get the state just before the EOB char was reached */ + +static yy_state_type yy_get_previous_state() + { + register yy_state_type yy_current_state; + register char *yy_cp; + + yy_current_state = yy_start; + yy_current_state += YY_AT_BOL(); + yy_state_ptr = yy_state_buf; + *yy_state_ptr++ = yy_current_state; + + for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp ) + { + register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 24 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + *yy_state_ptr++ = yy_current_state; + } + + return yy_current_state; + } + + +/* yy_try_NUL_trans - try to make a transition on the NUL character + * + * synopsis + * next_state = yy_try_NUL_trans( current_state ); + */ + +#ifdef YY_USE_PROTOS +static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state ) +#else +static yy_state_type yy_try_NUL_trans( yy_current_state ) +yy_state_type yy_current_state; +#endif + { + register int yy_is_jam; + + register YY_CHAR yy_c = 1; + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 24 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + yy_is_jam = (yy_current_state == 23); + if ( ! yy_is_jam ) + *yy_state_ptr++ = yy_current_state; + + return yy_is_jam ? 0 : yy_current_state; + } + + +#ifndef YY_NO_UNPUT +#ifdef YY_USE_PROTOS +static void yyunput( int c, register char *yy_bp ) +#else +static void yyunput( c, yy_bp ) +int c; +register char *yy_bp; +#endif + { + register char *yy_cp = yy_c_buf_p; + + /* undo effects of setting up yytext */ + *yy_cp = yy_hold_char; + + if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) + { /* need to shift things up to make room */ + /* +2 for EOB chars. */ + register int number_to_move = yy_n_chars + 2; + register char *dest = &yy_current_buffer->yy_ch_buf[ + yy_current_buffer->yy_buf_size + 2]; + register char *source = + &yy_current_buffer->yy_ch_buf[number_to_move]; + + while ( source > yy_current_buffer->yy_ch_buf ) + *--dest = *--source; + + yy_cp += (int) (dest - source); + yy_bp += (int) (dest - source); + yy_current_buffer->yy_n_chars = + yy_n_chars = yy_current_buffer->yy_buf_size; + + if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) + YY_FATAL_ERROR( "flex scanner push-back overflow" ); + } + + *--yy_cp = (char) c; + + + yytext_ptr = yy_bp; + yy_hold_char = *yy_cp; + yy_c_buf_p = yy_cp; + } +#endif /* ifndef YY_NO_UNPUT */ + + +#ifdef __cplusplus +static int yyinput() +#else +static int input() +#endif + { + int c; + + *yy_c_buf_p = yy_hold_char; + + if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR ) + { + /* yy_c_buf_p now points to the character we want to return. + * If this occurs *before* the EOB characters, then it's a + * valid NUL; if not, then we've hit the end of the buffer. + */ + if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] ) + /* This was really a NUL. */ + *yy_c_buf_p = '\0'; + + else + { /* need more input */ + int offset = yy_c_buf_p - yytext_ptr; + ++yy_c_buf_p; + + switch ( yy_get_next_buffer() ) + { + case EOB_ACT_LAST_MATCH: + /* This happens because yy_g_n_b() + * sees that we've accumulated a + * token and flags that we need to + * try matching the token before + * proceeding. But for input(), + * there's no matching to consider. + * So convert the EOB_ACT_LAST_MATCH + * to EOB_ACT_END_OF_FILE. + */ + + /* Reset buffer status. */ + yyrestart( yyin ); + + /* fall through */ + + case EOB_ACT_END_OF_FILE: + { + if ( yywrap() ) + return EOF; + + if ( ! yy_did_buffer_switch_on_eof ) + YY_NEW_FILE; +#ifdef __cplusplus + return yyinput(); +#else + return input(); +#endif + } + + case EOB_ACT_CONTINUE_SCAN: + yy_c_buf_p = yytext_ptr + offset; + break; + } + } + } + + c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */ + *yy_c_buf_p = '\0'; /* preserve yytext */ + yy_hold_char = *++yy_c_buf_p; + + yy_current_buffer->yy_at_bol = (c == '\n'); + + return c; + } + + +#ifdef YY_USE_PROTOS +void yyrestart( FILE *input_file ) +#else +void yyrestart( input_file ) +FILE *input_file; +#endif + { + if ( ! yy_current_buffer ) + yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); + + yy_init_buffer( yy_current_buffer, input_file ); + yy_load_buffer_state(); + } + + +#ifdef YY_USE_PROTOS +void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer ) +#else +void yy_switch_to_buffer( new_buffer ) +YY_BUFFER_STATE new_buffer; +#endif + { + if ( yy_current_buffer == new_buffer ) + return; + + if ( yy_current_buffer ) + { + /* Flush out information for old buffer. */ + *yy_c_buf_p = yy_hold_char; + yy_current_buffer->yy_buf_pos = yy_c_buf_p; + yy_current_buffer->yy_n_chars = yy_n_chars; + } + + yy_current_buffer = new_buffer; + yy_load_buffer_state(); + + /* We don't actually know whether we did this switch during + * EOF (yywrap()) processing, but the only time this flag + * is looked at is after yywrap() is called, so it's safe + * to go ahead and always set it. + */ + yy_did_buffer_switch_on_eof = 1; + } + + +#ifdef YY_USE_PROTOS +void yy_load_buffer_state( void ) +#else +void yy_load_buffer_state() +#endif + { + yy_n_chars = yy_current_buffer->yy_n_chars; + yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos; + yyin = yy_current_buffer->yy_input_file; + yy_hold_char = *yy_c_buf_p; + } + + +#ifdef YY_USE_PROTOS +YY_BUFFER_STATE yy_create_buffer( FILE *file, int size ) +#else +YY_BUFFER_STATE yy_create_buffer( file, size ) +FILE *file; +int size; +#endif + { + YY_BUFFER_STATE b; + + b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); + + b->yy_buf_size = size; + + /* yy_ch_buf has to be 2 characters longer than the size given because + * we need to put in 2 end-of-buffer characters. + */ + b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 ); + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); + + b->yy_is_our_buffer = 1; + + yy_init_buffer( b, file ); + + return b; + } + + +#ifdef YY_USE_PROTOS +void yy_delete_buffer( YY_BUFFER_STATE b ) +#else +void yy_delete_buffer( b ) +YY_BUFFER_STATE b; +#endif + { + if ( ! b ) + return; + + if ( b == yy_current_buffer ) + yy_current_buffer = (YY_BUFFER_STATE) 0; + + if ( b->yy_is_our_buffer ) + yy_flex_free( (void *) b->yy_ch_buf ); + + yy_flex_free( (void *) b ); + } + + +#ifndef _WIN32 +#include +#else +#ifndef YY_ALWAYS_INTERACTIVE +#ifndef YY_NEVER_INTERACTIVE +extern int isatty YY_PROTO(( int )); +#endif +#endif +#endif + +#ifdef YY_USE_PROTOS +void yy_init_buffer( YY_BUFFER_STATE b, FILE *file ) +#else +void yy_init_buffer( b, file ) +YY_BUFFER_STATE b; +FILE *file; +#endif + + + { + yy_flush_buffer( b ); + + b->yy_input_file = file; + b->yy_fill_buffer = 1; + +#if YY_ALWAYS_INTERACTIVE + b->yy_is_interactive = 1; +#else +#if YY_NEVER_INTERACTIVE + b->yy_is_interactive = 0; +#else + b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; +#endif +#endif + } + + +#ifdef YY_USE_PROTOS +void yy_flush_buffer( YY_BUFFER_STATE b ) +#else +void yy_flush_buffer( b ) +YY_BUFFER_STATE b; +#endif + + { + if ( ! b ) + return; + + b->yy_n_chars = 0; + + /* We always need two end-of-buffer characters. The first causes + * a transition to the end-of-buffer state. The second causes + * a jam in that state. + */ + b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; + b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; + + b->yy_buf_pos = &b->yy_ch_buf[0]; + + b->yy_at_bol = 1; + b->yy_buffer_status = YY_BUFFER_NEW; + + if ( b == yy_current_buffer ) + yy_load_buffer_state(); + } + + +#ifndef YY_NO_SCAN_BUFFER +#ifdef YY_USE_PROTOS +YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size ) +#else +YY_BUFFER_STATE yy_scan_buffer( base, size ) +char *base; +yy_size_t size; +#endif + { + YY_BUFFER_STATE b; + + if ( size < 2 || + base[size-2] != YY_END_OF_BUFFER_CHAR || + base[size-1] != YY_END_OF_BUFFER_CHAR ) + /* They forgot to leave room for the EOB's. */ + return 0; + + b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); + + b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ + b->yy_buf_pos = b->yy_ch_buf = base; + b->yy_is_our_buffer = 0; + b->yy_input_file = 0; + b->yy_n_chars = b->yy_buf_size; + b->yy_is_interactive = 0; + b->yy_at_bol = 1; + b->yy_fill_buffer = 0; + b->yy_buffer_status = YY_BUFFER_NEW; + + yy_switch_to_buffer( b ); + + return b; + } +#endif + + +#ifndef YY_NO_SCAN_STRING +#ifdef YY_USE_PROTOS +YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str ) +#else +YY_BUFFER_STATE yy_scan_string( yy_str ) +yyconst char *yy_str; +#endif + { + int len; + for ( len = 0; yy_str[len]; ++len ) + ; + + return yy_scan_bytes( yy_str, len ); + } +#endif + + +#ifndef YY_NO_SCAN_BYTES +#ifdef YY_USE_PROTOS +YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len ) +#else +YY_BUFFER_STATE yy_scan_bytes( bytes, len ) +yyconst char *bytes; +int len; +#endif + { + YY_BUFFER_STATE b; + char *buf; + yy_size_t n; + int i; + + /* Get memory for full buffer, including space for trailing EOB's. */ + n = len + 2; + buf = (char *) yy_flex_alloc( n ); + if ( ! buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); + + for ( i = 0; i < len; ++i ) + buf[i] = bytes[i]; + + buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR; + + b = yy_scan_buffer( buf, n ); + if ( ! b ) + YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); + + /* It's okay to grow etc. this buffer, and we should throw it + * away when we're done. + */ + b->yy_is_our_buffer = 1; + + return b; + } +#endif + + +#ifndef YY_NO_PUSH_STATE +#ifdef YY_USE_PROTOS +static void yy_push_state( int new_state ) +#else +static void yy_push_state( new_state ) +int new_state; +#endif + { + if ( yy_start_stack_ptr >= yy_start_stack_depth ) + { + yy_size_t new_size; + + yy_start_stack_depth += YY_START_STACK_INCR; + new_size = yy_start_stack_depth * sizeof( int ); + + if ( ! yy_start_stack ) + yy_start_stack = (int *) yy_flex_alloc( new_size ); + + else + yy_start_stack = (int *) yy_flex_realloc( + (void *) yy_start_stack, new_size ); + + if ( ! yy_start_stack ) + YY_FATAL_ERROR( + "out of memory expanding start-condition stack" ); + } + + yy_start_stack[yy_start_stack_ptr++] = YY_START; + + BEGIN(new_state); + } +#endif + + +#ifndef YY_NO_POP_STATE +static void yy_pop_state() + { + if ( --yy_start_stack_ptr < 0 ) + YY_FATAL_ERROR( "start-condition stack underflow" ); + + BEGIN(yy_start_stack[yy_start_stack_ptr]); + } +#endif + + +#ifndef YY_NO_TOP_STATE +static int yy_top_state() + { + return yy_start_stack[yy_start_stack_ptr - 1]; + } +#endif + +#ifndef YY_EXIT_FAILURE +#define YY_EXIT_FAILURE 2 +#endif + +#ifdef YY_USE_PROTOS +static void yy_fatal_error( yyconst char msg[] ) +#else +static void yy_fatal_error( msg ) +char msg[]; +#endif + { + (void) fprintf( stderr, "%s\n", msg ); + exit( YY_EXIT_FAILURE ); + } + + + +/* Redefine yyless() so it works in section 3 code. */ + +#undef yyless +#define yyless(n) \ + do \ + { \ + /* Undo effects of setting up yytext. */ \ + yytext[yyleng] = yy_hold_char; \ + yy_c_buf_p = yytext + n; \ + yy_hold_char = *yy_c_buf_p; \ + *yy_c_buf_p = '\0'; \ + yyleng = n; \ + } \ + while ( 0 ) + + +/* Internal utility routines. */ + +#ifndef yytext_ptr +#ifdef YY_USE_PROTOS +static void yy_flex_strncpy( char *s1, yyconst char *s2, int n ) +#else +static void yy_flex_strncpy( s1, s2, n ) +char *s1; +yyconst char *s2; +int n; +#endif + { + register int i; + for ( i = 0; i < n; ++i ) + s1[i] = s2[i]; + } +#endif + +#ifdef YY_NEED_STRLEN +#ifdef YY_USE_PROTOS +static int yy_flex_strlen( yyconst char *s ) +#else +static int yy_flex_strlen( s ) +yyconst char *s; +#endif + { + register int n; + for ( n = 0; s[n]; ++n ) + ; + + return n; + } +#endif + + +#ifdef YY_USE_PROTOS +static void *yy_flex_alloc( yy_size_t size ) +#else +static void *yy_flex_alloc( size ) +yy_size_t size; +#endif + { + return (void *) malloc( size ); + } + +#ifdef YY_USE_PROTOS +static void *yy_flex_realloc( void *ptr, yy_size_t size ) +#else +static void *yy_flex_realloc( ptr, size ) +void *ptr; +yy_size_t size; +#endif + { + /* The cast to (char *) in the following accommodates both + * implementations that use char* generic pointers, and those + * that use void* generic pointers. It works with the latter + * because both ANSI C and C++ allow castless assignment from + * any pointer type to void*, and deal with argument conversions + * as though doing an assignment. + */ + return (void *) realloc( (char *) ptr, size ); + } + +#ifdef YY_USE_PROTOS +static void yy_flex_free( void *ptr ) +#else +static void yy_flex_free( ptr ) +void *ptr; +#endif + { + free( ptr ); + } + +#if YY_MAIN +int main() + { + yylex(); + return 0; + } +#endif +#line 74 "show_help_lex.l" + + + +/* + * This cleans up at the end of the parse (since, in this case, we + * always parse the entire file) and prevents a memory leak. + */ +int opal_show_help_finish_parsing(void) +{ + if (NULL != YY_CURRENT_BUFFER) { + yy_delete_buffer(YY_CURRENT_BUFFER); +#if defined(YY_CURRENT_BUFFER_LVALUE) + YY_CURRENT_BUFFER_LVALUE = NULL; +#else + YY_CURRENT_BUFFER = NULL; +#endif /* YY_CURRENT_BUFFER_LVALUE */ + } + return YY_NULL; +} + + +static int opal_show_help_yywrap(void) +{ + opal_show_help_parse_done = true; + return 1; +} + + +/* + * Ensure that we have a valid yybuffer to use. Specifically, if this + * scanner is invoked a second time, finish_parsing() (above) will + * have been executed, and the current buffer will have been freed. + * Flex doesn't recognize this fact because as far as it's concerned, + * its internal state was already initialized, so it thinks it should + * have a valid buffer. Hence, here we ensure to give it a valid + * buffer. + */ +int opal_show_help_init_buffer(FILE *file) +{ + YY_BUFFER_STATE buf = yy_create_buffer(file, YY_BUF_SIZE); + yy_switch_to_buffer(buf); + + return 0; +}