summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2014-04-22 13:56:58 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2014-04-22 13:56:58 (GMT)
commit3bd99b85badc4bdfc7452d90dfab941a994da29b (patch)
tree786b4876a8addc662c0556ef126cc9879e8193f7
parentb59f172c53576794b419d2b081b9cc7853095701 (diff)
downloadhdf5-3bd99b85badc4bdfc7452d90dfab941a994da29b.zip
hdf5-3bd99b85badc4bdfc7452d90dfab941a994da29b.tar.gz
hdf5-3bd99b85badc4bdfc7452d90dfab941a994da29b.tar.bz2
[svn-r25074] HDFFV-8709: Add changes for HDFFV-8676, -8677, -8678
Tested: local linux
-rw-r--r--hl/src/H5LTanalyze.c161
-rw-r--r--hl/src/H5LTanalyze.l4
-rw-r--r--hl/src/H5LTparse.c22
-rw-r--r--hl/src/H5LTparse.y8
4 files changed, 101 insertions, 94 deletions
diff --git a/hl/src/H5LTanalyze.c b/hl/src/H5LTanalyze.c
index b25db7e..31ec84f 100644
--- a/hl/src/H5LTanalyze.c
+++ b/hl/src/H5LTanalyze.c
@@ -14,9 +14,11 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * This file was generated by Lex with the command "lex -PH5LTyy -oH5LTanalyze.c H5LTanalyze.l".
- * Do NOT modify it by hand, but in line 52, "#ifdef H5_HAVE_UNISTD_H" should be added if
- * the platform doesn't have the unistd.h header file.
+ * This file was generated by Lex with the command "lex -PH5LTyy
+ * -oH5LTanalyze.c H5LTanalyze.l". Do NOT modify it by hand, but in
+ * line 52, "#ifdef H5_HAVE_UNISTD_H" should be added if the platform
+ * doesn't have the unistd.h header file. Also hdf5.h should be added
+ * before adding H5_HAVE_UNISTD_H.
*/
#define yy_create_buffer H5LTyy_create_buffer
@@ -37,7 +39,7 @@
#define yytext H5LTyytext
#define yywrap H5LTyywrap
-#line 20 "H5LTanalyze.c"
+#line 43 "H5LTanalyze.c"
/* A lexical scanner generated by flex*/
/* Scanner skeleton version:
@@ -49,6 +51,7 @@
#define YY_FLEX_MINOR_VERSION 5
#include <stdio.h>
+#include <hdf5.h>
#ifdef H5_HAVE_UNISTD_H
#include <unistd.h>
#endif
@@ -806,7 +809,7 @@ char *yytext;
#line 17 "H5LTanalyze.l"
#include <stdlib.h>
#include <string.h>
-#include<hdf5.h>
+#include <hdf5.h>
#include "H5LTparse.h"
int my_yyinput(char *, int);
@@ -820,7 +823,7 @@ int my_yyinput(char *, int);
#define YY_BUF_SIZE 262144 /*Define read buffer to be 256K*/
extern char *myinput;
-extern size_t input_len;
+extern size_t input_len;
#define STACK_SIZE 16
@@ -857,7 +860,7 @@ hbool_t first_quote = 1;
#define TAG_STRING 1
-#line 843 "H5LTanalyze.c"
+#line 864 "H5LTanalyze.c"
/* Macros after this point can all be overridden by user definitions in
* section 1.
@@ -1008,10 +1011,10 @@ YY_DECL
register char *yy_cp = NULL, *yy_bp = NULL;
register int yy_act;
-#line 76 "H5LTanalyze.l"
+#line 72 "H5LTanalyze.l"
-#line 997 "H5LTanalyze.c"
+#line 1018 "H5LTanalyze.c"
if ( yy_init )
{
@@ -1097,277 +1100,277 @@ do_action: /* This label is used only to access EOF actions. */
{ /* beginning of action switch */
case 1:
YY_RULE_SETUP
-#line 78 "H5LTanalyze.l"
+#line 74 "H5LTanalyze.l"
{return token(H5T_STD_I8BE_TOKEN);}
YY_BREAK
case 2:
YY_RULE_SETUP
-#line 79 "H5LTanalyze.l"
+#line 75 "H5LTanalyze.l"
{return token(H5T_STD_I8LE_TOKEN);}
YY_BREAK
case 3:
YY_RULE_SETUP
-#line 80 "H5LTanalyze.l"
+#line 76 "H5LTanalyze.l"
{return token(H5T_STD_I16BE_TOKEN);}
YY_BREAK
case 4:
YY_RULE_SETUP
-#line 81 "H5LTanalyze.l"
+#line 77 "H5LTanalyze.l"
{return token(H5T_STD_I16LE_TOKEN);}
YY_BREAK
case 5:
YY_RULE_SETUP
-#line 82 "H5LTanalyze.l"
+#line 78 "H5LTanalyze.l"
{return token(H5T_STD_I32BE_TOKEN);}
YY_BREAK
case 6:
YY_RULE_SETUP
-#line 83 "H5LTanalyze.l"
+#line 79 "H5LTanalyze.l"
{return token(H5T_STD_I32LE_TOKEN);}
YY_BREAK
case 7:
YY_RULE_SETUP
-#line 84 "H5LTanalyze.l"
+#line 80 "H5LTanalyze.l"
{return token(H5T_STD_I64BE_TOKEN);}
YY_BREAK
case 8:
YY_RULE_SETUP
-#line 85 "H5LTanalyze.l"
+#line 81 "H5LTanalyze.l"
{return token(H5T_STD_I64LE_TOKEN);}
YY_BREAK
case 9:
YY_RULE_SETUP
-#line 87 "H5LTanalyze.l"
+#line 83 "H5LTanalyze.l"
{return token(H5T_STD_U8BE_TOKEN);}
YY_BREAK
case 10:
YY_RULE_SETUP
-#line 88 "H5LTanalyze.l"
+#line 84 "H5LTanalyze.l"
{return token(H5T_STD_U8LE_TOKEN);}
YY_BREAK
case 11:
YY_RULE_SETUP
-#line 89 "H5LTanalyze.l"
+#line 85 "H5LTanalyze.l"
{return token(H5T_STD_U16BE_TOKEN);}
YY_BREAK
case 12:
YY_RULE_SETUP
-#line 90 "H5LTanalyze.l"
+#line 86 "H5LTanalyze.l"
{return token(H5T_STD_U16LE_TOKEN);}
YY_BREAK
case 13:
YY_RULE_SETUP
-#line 91 "H5LTanalyze.l"
+#line 87 "H5LTanalyze.l"
{return token(H5T_STD_U32BE_TOKEN);}
YY_BREAK
case 14:
YY_RULE_SETUP
-#line 92 "H5LTanalyze.l"
+#line 88 "H5LTanalyze.l"
{return token(H5T_STD_U32LE_TOKEN);}
YY_BREAK
case 15:
YY_RULE_SETUP
-#line 93 "H5LTanalyze.l"
+#line 89 "H5LTanalyze.l"
{return token(H5T_STD_U64BE_TOKEN);}
YY_BREAK
case 16:
YY_RULE_SETUP
-#line 94 "H5LTanalyze.l"
+#line 90 "H5LTanalyze.l"
{return token(H5T_STD_U64LE_TOKEN);}
YY_BREAK
case 17:
YY_RULE_SETUP
-#line 96 "H5LTanalyze.l"
+#line 92 "H5LTanalyze.l"
{return token(H5T_NATIVE_CHAR_TOKEN);}
YY_BREAK
case 18:
YY_RULE_SETUP
-#line 97 "H5LTanalyze.l"
+#line 93 "H5LTanalyze.l"
{return token(H5T_NATIVE_SCHAR_TOKEN);}
YY_BREAK
case 19:
YY_RULE_SETUP
-#line 98 "H5LTanalyze.l"
+#line 94 "H5LTanalyze.l"
{return token(H5T_NATIVE_UCHAR_TOKEN);}
YY_BREAK
case 20:
YY_RULE_SETUP
-#line 99 "H5LTanalyze.l"
+#line 95 "H5LTanalyze.l"
{return token(H5T_NATIVE_SHORT_TOKEN);}
YY_BREAK
case 21:
YY_RULE_SETUP
-#line 100 "H5LTanalyze.l"
+#line 96 "H5LTanalyze.l"
{return token(H5T_NATIVE_USHORT_TOKEN);}
YY_BREAK
case 22:
YY_RULE_SETUP
-#line 101 "H5LTanalyze.l"
+#line 97 "H5LTanalyze.l"
{return token(H5T_NATIVE_INT_TOKEN);}
YY_BREAK
case 23:
YY_RULE_SETUP
-#line 102 "H5LTanalyze.l"
+#line 98 "H5LTanalyze.l"
{return token(H5T_NATIVE_UINT_TOKEN);}
YY_BREAK
case 24:
YY_RULE_SETUP
-#line 103 "H5LTanalyze.l"
+#line 99 "H5LTanalyze.l"
{return token(H5T_NATIVE_LONG_TOKEN);}
YY_BREAK
case 25:
YY_RULE_SETUP
-#line 104 "H5LTanalyze.l"
+#line 100 "H5LTanalyze.l"
{return token(H5T_NATIVE_ULONG_TOKEN);}
YY_BREAK
case 26:
YY_RULE_SETUP
-#line 105 "H5LTanalyze.l"
+#line 101 "H5LTanalyze.l"
{return token(H5T_NATIVE_LLONG_TOKEN);}
YY_BREAK
case 27:
YY_RULE_SETUP
-#line 106 "H5LTanalyze.l"
+#line 102 "H5LTanalyze.l"
{return token(H5T_NATIVE_ULLONG_TOKEN);}
YY_BREAK
case 28:
YY_RULE_SETUP
-#line 108 "H5LTanalyze.l"
+#line 104 "H5LTanalyze.l"
{return token(H5T_IEEE_F32BE_TOKEN);}
YY_BREAK
case 29:
YY_RULE_SETUP
-#line 109 "H5LTanalyze.l"
+#line 105 "H5LTanalyze.l"
{return token(H5T_IEEE_F32LE_TOKEN);}
YY_BREAK
case 30:
YY_RULE_SETUP
-#line 110 "H5LTanalyze.l"
+#line 106 "H5LTanalyze.l"
{return token(H5T_IEEE_F64BE_TOKEN);}
YY_BREAK
case 31:
YY_RULE_SETUP
-#line 111 "H5LTanalyze.l"
+#line 107 "H5LTanalyze.l"
{return token(H5T_IEEE_F64LE_TOKEN);}
YY_BREAK
case 32:
YY_RULE_SETUP
-#line 112 "H5LTanalyze.l"
+#line 108 "H5LTanalyze.l"
{return token(H5T_NATIVE_FLOAT_TOKEN);}
YY_BREAK
case 33:
YY_RULE_SETUP
-#line 113 "H5LTanalyze.l"
+#line 109 "H5LTanalyze.l"
{return token(H5T_NATIVE_DOUBLE_TOKEN);}
YY_BREAK
case 34:
YY_RULE_SETUP
-#line 114 "H5LTanalyze.l"
+#line 110 "H5LTanalyze.l"
{return token(H5T_NATIVE_LDOUBLE_TOKEN);}
YY_BREAK
case 35:
YY_RULE_SETUP
-#line 116 "H5LTanalyze.l"
+#line 112 "H5LTanalyze.l"
{return token(H5T_STRING_TOKEN);}
YY_BREAK
case 36:
YY_RULE_SETUP
-#line 117 "H5LTanalyze.l"
+#line 113 "H5LTanalyze.l"
{return token(STRSIZE_TOKEN);}
YY_BREAK
case 37:
YY_RULE_SETUP
-#line 118 "H5LTanalyze.l"
+#line 114 "H5LTanalyze.l"
{return token(STRPAD_TOKEN);}
YY_BREAK
case 38:
YY_RULE_SETUP
-#line 119 "H5LTanalyze.l"
+#line 115 "H5LTanalyze.l"
{return token(CSET_TOKEN);}
YY_BREAK
case 39:
YY_RULE_SETUP
-#line 120 "H5LTanalyze.l"
+#line 116 "H5LTanalyze.l"
{return token(CTYPE_TOKEN);}
YY_BREAK
case 40:
YY_RULE_SETUP
-#line 121 "H5LTanalyze.l"
+#line 117 "H5LTanalyze.l"
{return token(H5T_STR_NULLTERM_TOKEN);}
YY_BREAK
case 41:
YY_RULE_SETUP
-#line 122 "H5LTanalyze.l"
+#line 118 "H5LTanalyze.l"
{return token(H5T_STR_NULLPAD_TOKEN);}
YY_BREAK
case 42:
YY_RULE_SETUP
-#line 123 "H5LTanalyze.l"
+#line 119 "H5LTanalyze.l"
{return token(H5T_STR_SPACEPAD_TOKEN);}
YY_BREAK
case 43:
YY_RULE_SETUP
-#line 124 "H5LTanalyze.l"
+#line 120 "H5LTanalyze.l"
{return token(H5T_CSET_ASCII_TOKEN);}
YY_BREAK
case 44:
YY_RULE_SETUP
-#line 125 "H5LTanalyze.l"
+#line 121 "H5LTanalyze.l"
{return token(H5T_CSET_UTF8_TOKEN);}
YY_BREAK
case 45:
YY_RULE_SETUP
-#line 126 "H5LTanalyze.l"
+#line 122 "H5LTanalyze.l"
{return token(H5T_C_S1_TOKEN);}
YY_BREAK
case 46:
YY_RULE_SETUP
-#line 127 "H5LTanalyze.l"
+#line 123 "H5LTanalyze.l"
{return token(H5T_FORTRAN_S1_TOKEN);}
YY_BREAK
case 47:
YY_RULE_SETUP
-#line 128 "H5LTanalyze.l"
+#line 124 "H5LTanalyze.l"
{return token(H5T_VARIABLE_TOKEN);}
YY_BREAK
case 48:
YY_RULE_SETUP
-#line 130 "H5LTanalyze.l"
+#line 126 "H5LTanalyze.l"
{return token(H5T_COMPOUND_TOKEN);}
YY_BREAK
case 49:
YY_RULE_SETUP
-#line 131 "H5LTanalyze.l"
+#line 127 "H5LTanalyze.l"
{return token(H5T_ENUM_TOKEN);}
YY_BREAK
case 50:
YY_RULE_SETUP
-#line 132 "H5LTanalyze.l"
+#line 128 "H5LTanalyze.l"
{return token(H5T_ARRAY_TOKEN);}
YY_BREAK
case 51:
YY_RULE_SETUP
-#line 133 "H5LTanalyze.l"
+#line 129 "H5LTanalyze.l"
{return token(H5T_VLEN_TOKEN);}
YY_BREAK
case 52:
YY_RULE_SETUP
-#line 135 "H5LTanalyze.l"
+#line 131 "H5LTanalyze.l"
{return token(H5T_OPAQUE_TOKEN);}
YY_BREAK
case 53:
YY_RULE_SETUP
-#line 136 "H5LTanalyze.l"
+#line 132 "H5LTanalyze.l"
{return token(OPQ_SIZE_TOKEN);}
YY_BREAK
case 54:
YY_RULE_SETUP
-#line 137 "H5LTanalyze.l"
+#line 133 "H5LTanalyze.l"
{return token(OPQ_TAG_TOKEN);}
YY_BREAK
case 55:
YY_RULE_SETUP
-#line 139 "H5LTanalyze.l"
+#line 135 "H5LTanalyze.l"
{
if( is_str_size || (is_enum && is_enum_memb) ||
is_opq_size || (asindex>-1 && arr_stack[asindex].is_dim) ||
@@ -1380,7 +1383,7 @@ YY_RULE_SETUP
YY_BREAK
case 56:
YY_RULE_SETUP
-#line 149 "H5LTanalyze.l"
+#line 145 "H5LTanalyze.l"
{
/*if it's first quote, and is a compound field name or an enum symbol*/
if((is_opq_tag || is_enum || (csindex>-1 && cmpd_stack[csindex].is_field))
@@ -1394,7 +1397,7 @@ YY_RULE_SETUP
YY_BREAK
case 57:
YY_RULE_SETUP
-#line 159 "H5LTanalyze.l"
+#line 155 "H5LTanalyze.l"
{
#ifdef H5_HAVE_WIN32_API
H5LTyylval.sval = _strdup(yytext);
@@ -1407,50 +1410,50 @@ YY_RULE_SETUP
YY_BREAK
case 58:
YY_RULE_SETUP
-#line 169 "H5LTanalyze.l"
+#line 165 "H5LTanalyze.l"
{return token('{');}
YY_BREAK
case 59:
YY_RULE_SETUP
-#line 170 "H5LTanalyze.l"
+#line 166 "H5LTanalyze.l"
{return token('}');}
YY_BREAK
case 60:
YY_RULE_SETUP
-#line 171 "H5LTanalyze.l"
+#line 167 "H5LTanalyze.l"
{return token('[');}
YY_BREAK
case 61:
YY_RULE_SETUP
-#line 172 "H5LTanalyze.l"
+#line 168 "H5LTanalyze.l"
{return token(']');}
YY_BREAK
case 62:
YY_RULE_SETUP
-#line 173 "H5LTanalyze.l"
+#line 169 "H5LTanalyze.l"
{return token(':');}
YY_BREAK
case 63:
YY_RULE_SETUP
-#line 174 "H5LTanalyze.l"
+#line 170 "H5LTanalyze.l"
{return token(';');}
YY_BREAK
case 64:
YY_RULE_SETUP
-#line 175 "H5LTanalyze.l"
+#line 171 "H5LTanalyze.l"
;
YY_BREAK
case 65:
YY_RULE_SETUP
-#line 176 "H5LTanalyze.l"
+#line 172 "H5LTanalyze.l"
{ return 0; }
YY_BREAK
case 66:
YY_RULE_SETUP
-#line 178 "H5LTanalyze.l"
+#line 174 "H5LTanalyze.l"
ECHO;
YY_BREAK
-#line 1432 "H5LTanalyze.c"
+#line 1457 "H5LTanalyze.c"
case YY_STATE_EOF(INITIAL):
case YY_STATE_EOF(TAG_STRING):
yyterminate();
@@ -2033,7 +2036,7 @@ FILE *file;
b->yy_is_interactive = 0;
#else
#ifdef H5_HAVE_WIN32_API
- b->yy_is_interactive = file ? (isatty( _fileno(file) ) > 0) : 0;
+ b->yy_is_interactive = file ? (_isatty( _fileno(file) ) > 0) : 0;
#else /* H5_HAVE_WIN32_API */
b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
#endif /* H5_HAVE_WIN32_API */
@@ -2331,7 +2334,7 @@ int main()
return 0;
}
#endif
-#line 178 "H5LTanalyze.l"
+#line 174 "H5LTanalyze.l"
int my_yyinput(char *buf, int max_size)
{
@@ -2342,7 +2345,7 @@ int my_yyinput(char *buf, int max_size)
return ret;
}
-int H5LTyyerror(char *msg)
+int H5LTyyerror(const char *msg)
{
printf("ERROR: %s before \"%s\".\n", msg, yytext);
return 0;
diff --git a/hl/src/H5LTanalyze.l b/hl/src/H5LTanalyze.l
index 7407520..9682f78 100644
--- a/hl/src/H5LTanalyze.l
+++ b/hl/src/H5LTanalyze.l
@@ -16,7 +16,7 @@
%{
#include <stdlib.h>
#include <string.h>
-#include<hdf5.h>
+#include <hdf5.h>
#include "H5LTparse.h"
int my_yyinput(char *, int);
@@ -181,7 +181,7 @@ int my_yyinput(char *buf, int max_size)
return ret;
}
-int H5LTyyerror(char *msg)
+int H5LTyyerror(const char *msg)
{
printf("ERROR: %s before \"%s\".\n", msg, yytext);
return 0;
diff --git a/hl/src/H5LTparse.c b/hl/src/H5LTparse.c
index 41c4cec..4527a5f 100644
--- a/hl/src/H5LTparse.c
+++ b/hl/src/H5LTparse.c
@@ -58,12 +58,12 @@ static int yygrowstack();
#define yystacksize H5LTyystacksize
#define YYPREFIX "H5LTyy"
#line 17 "H5LTparse.y"
-#include<stdio.h>
-#include<string.h>
-#include<hdf5.h>
+#include <stdio.h>
+#include <string.h>
+#include <hdf5.h>
extern int yylex();
-extern int yyerror(char *);
+extern int yyerror(const char *);
#define STACK_SIZE 16
@@ -95,7 +95,7 @@ int asindex = -1; /*pointer to the top of array stack*/
hbool_t is_str_size = 0; /*flag to lexer for string size*/
hbool_t is_str_pad = 0; /*flag to lexer for string padding*/
-H5T_pad_t str_pad; /*variable for string padding*/
+H5T_str_t str_pad; /*variable for string padding*/
H5T_cset_t str_cset; /*variable for string character set*/
hbool_t is_variable = 0; /*variable for variable-length string*/
size_t str_size; /*variable for string size*/
@@ -113,7 +113,7 @@ typedef union {
int ival; /*for integer token*/
char *sval; /*for name string*/
} YYSTYPE;
-#line 99 "H5LTparse.c"
+#line 117 "H5LTparse.c"
#define YYERRCODE 256
#define H5T_STD_I8BE_TOKEN 257
#define H5T_STD_I8LE_TOKEN 258
@@ -1042,11 +1042,15 @@ case 91:
#line 330 "H5LTparse.y"
{
is_enum_memb = 1; /*indicate member of enum*/
- enum_memb_symbol = strdup(yylval.sval);
+#ifdef H5_HAVE_WIN32_API
+ enum_memb_symbol = _strdup(yylval.sval);
+#else /* H5_HAVE_WIN32_API */
+ enum_memb_symbol = strdup(yylval.sval);
+#endif /* H5_HAVE_WIN32_API */
}
break;
case 92:
-#line 335 "H5LTparse.y"
+#line 339 "H5LTparse.y"
{
char char_val=(char)yylval.ival;
short short_val=(short)yylval.ival;
@@ -1090,7 +1094,7 @@ case 92:
H5Tclose(native);
}
break;
-#line 1076 "H5LTparse.c"
+#line 1098 "H5LTparse.c"
}
yyssp -= yym;
yystate = *yyssp;
diff --git a/hl/src/H5LTparse.y b/hl/src/H5LTparse.y
index 973f2cb..d4c786c 100644
--- a/hl/src/H5LTparse.y
+++ b/hl/src/H5LTparse.y
@@ -14,12 +14,12 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
%{
-#include<stdio.h>
-#include<string.h>
-#include<hdf5.h>
+#include <stdio.h>
+#include <string.h>
+#include <hdf5.h>
extern int yylex();
-extern int yyerror(char *);
+extern int yyerror(const char *);
#define STACK_SIZE 16