#include "y_attr.h"
static int16 heapIndex;
-static char heap[2052];
-static char buf[2052];
+static char *heap;
+static char *buf;
static char *_lslp_strdup(const char *s);
void attrerror(const char *, ...);
void attr_close_lexer(size_t handle);
static char *_lslp_strdup(const char *s)
{
char *p = &heap[heapIndex];
- do { heap[heapIndex++] = *s; }
- while ((*s != 0x00) && (heapIndex < 2049) && (++s));
- return(p);
+
+ while ((heap[heapIndex++] = *s++))
+ ;
+
+ return p;
}
void attr_close_lexer(size_t handle)
{
- PEGASUS_ASSERT(handle != 0);
+ PEGASUS_ASSERT(handle);
+ PEGASUS_ASSERT(buf);
+ PEGASUS_ASSERT(heap);
attr_delete_buffer((YY_BUFFER_STATE)handle);
+ free(buf);
+ free(heap);
+ buf = heap = 0;
}
size_t attr_init_lexer(const char *s)
{
- memset(&buf[0], 0x00, 2052);
- memset(&heap[0], 0x00, 2052);
+ size_t len = strlen(s) + 2;
+
+ if (!(heap = (char*)malloc(len)))
+ {
+ return 0;
+ }
+ if (!(buf = (char*)malloc(len)))
+ {
+ free (heap);
+ return 0;
+ }
heapIndex = 0;
- strncpy(&buf[0], s, 2052);
- return((size_t) attr_scan_buffer(&buf[0], strlen(s) + 2));
+ strcpy(buf, s);
+ buf[len - 1] = 0;
+
+ return ((size_t) attr_scan_buffer(buf, len));
}
NULL, 0, (s), __FILE__, __LINE__);
*/
static int16 heapIndex;
-static char heap[2052];
-static char buf[2052];
+static char *heap;
+static char *buf;
static char *_lslp_strdup(const char *s);
void filter_close_lexer(size_t handle);
%%
+static char *_lslp_strdup(const char *s)
+{
+ char *p = &heap[heapIndex];
+
+ while ((heap[heapIndex++] = *s++))
+ ;
+
+ return p;
+}
+
void filter_close_lexer(size_t handle)
{
- PEGASUS_ASSERT(handle != 0);
+ PEGASUS_ASSERT(handle);
+ PEGASUS_ASSERT(buf);
+ PEGASUS_ASSERT(heap);
filter_delete_buffer((YY_BUFFER_STATE)handle);
+ free(buf);
+ free(heap);
+ buf = heap = 0;
}
-
size_t filter_init_lexer(const char *s)
{
- memset(&buf[0], 0x00, 2052);
- memset(&heap[0], 0x00, 2052);
- heapIndex = 0;
- strncpy(&buf[0], s, 2048);
- return((size_t) filter_scan_buffer(&buf[0], strlen(s) + 2));
-}
+ size_t len = strlen(s) + 2;
-
-static char *_lslp_strdup(const char *s)
-{
- char *p = &heap[heapIndex];
- do
+ if (!(heap = (char*)malloc(len)))
{
- heap[heapIndex++] = *s;
+ return 0;
}
- while ((*s != 0x00) && (heapIndex < 2049) && (++s));
- return(p);
+ if (!(buf = (char*)malloc(len)))
+ {
+ free (heap);
+ return 0;
+ }
+
+ heapIndex = 0;
+ strcpy(buf, s);
+ buf[len - 1] = 0;
+
+ return ((size_t) filter_scan_buffer(buf, len));
}
/*****
/* A lexical scanner generated by flex */
/* Scanner skeleton version:
- * $Header: /cvs/MSB/pegasus/src/slp/slp_client/src/cmd-utils/slp_client/l_attr.cpp,v 1.16 2009/09/25 13:32:38 venkat.puvvada Exp $
+ * $Header: /cvs/MSB/pegasus/src/slp/slp_client/src/cmd-utils/slp_client/l_attr.cpp,v 1.17 2009/10/05 15:55:31 venkat.puvvada Exp $
*/
#define FLEX_SCANNER
#include "y_attr.h"
static int16 heapIndex;
-static char heap[2052];
-static char buf[2052];
+static char *heap;
+static char *buf;
static char *_lslp_strdup(const char *s);
void attrerror(const char *, ...);
void attr_close_lexer(size_t handle);
static char *_lslp_strdup(const char *s)
{
char *p = &heap[heapIndex];
- do { heap[heapIndex++] = *s; }
- while ((*s != 0x00) && (heapIndex < 2049) && (++s));
- return(p);
+
+ while ((heap[heapIndex++] = *s++))
+ ;
+
+ return p;
}
void attr_close_lexer(size_t handle)
{
- PEGASUS_ASSERT(handle != 0);
+ PEGASUS_ASSERT(handle);
+ PEGASUS_ASSERT(buf);
+ PEGASUS_ASSERT(heap);
attr_delete_buffer((YY_BUFFER_STATE)handle);
+ free(buf);
+ free(heap);
+ buf = heap = 0;
}
size_t attr_init_lexer(const char *s)
{
- memset(&buf[0], 0x00, 2052);
- memset(&heap[0], 0x00, 2052);
+ size_t len = strlen(s) + 2;
+
+ if (!(heap = (char*)malloc(len)))
+ {
+ return 0;
+ }
+ if (!(buf = (char*)malloc(len)))
+ {
+ free (heap);
+ return 0;
+ }
heapIndex = 0;
- strncpy(&buf[0], s, 2052);
- return((size_t) attr_scan_buffer(&buf[0], strlen(s) + 2));
+ strcpy(buf, s);
+ buf[len - 1] = 0;
+
+ return ((size_t) attr_scan_buffer(buf, len));
}
/* A lexical scanner generated by flex */
/* Scanner skeleton version:
- * $Header: /cvs/MSB/pegasus/src/slp/slp_client/src/cmd-utils/slp_client/l_filter.cpp,v 1.18 2009/09/25 13:32:38 venkat.puvvada Exp $
+ * $Header: /cvs/MSB/pegasus/src/slp/slp_client/src/cmd-utils/slp_client/l_filter.cpp,v 1.19 2009/10/05 15:55:31 venkat.puvvada Exp $
*/
#define FLEX_SCANNER
NULL, 0, (s), __FILE__, __LINE__);
*/
static int16 heapIndex;
-static char heap[2052];
-static char buf[2052];
+static char *heap;
+static char *buf;
static char *_lslp_strdup(const char *s);
void filter_close_lexer(size_t handle);
#line 169 "filter.l"
+static char *_lslp_strdup(const char *s)
+{
+ char *p = &heap[heapIndex];
+
+ while ((heap[heapIndex++] = *s++))
+ ;
+
+ return p;
+}
+
void filter_close_lexer(size_t handle)
{
- PEGASUS_ASSERT(handle != 0);
+ PEGASUS_ASSERT(handle);
+ PEGASUS_ASSERT(buf);
+ PEGASUS_ASSERT(heap);
filter_delete_buffer((YY_BUFFER_STATE)handle);
+ free(buf);
+ free(heap);
+ buf = heap = 0;
}
-
size_t filter_init_lexer(const char *s)
{
- memset(&buf[0], 0x00, 2052);
- memset(&heap[0], 0x00, 2052);
- heapIndex = 0;
- strncpy(&buf[0], s, 2048);
- return((size_t) filter_scan_buffer(&buf[0], strlen(s) + 2));
-}
+ size_t len = strlen(s) + 2;
-
-static char *_lslp_strdup(const char *s)
-{
- char *p = &heap[heapIndex];
- do
+ if (!(heap = (char*)malloc(len)))
{
- heap[heapIndex++] = *s;
+ return 0;
}
- while ((*s != 0x00) && (heapIndex < 2049) && (++s));
- return(p);
+ if (!(buf = (char*)malloc(len)))
+ {
+ free (heap);
+ return 0;
+ }
+
+ heapIndex = 0;
+ strcpy(buf, s);
+ buf[len - 1] = 0;
+
+ return ((size_t) filter_scan_buffer(buf, len));
}
/*****
/* A lexical scanner generated by flex */
/* Scanner skeleton version:
- * $Header: /cvs/MSB/pegasus/src/slp/slp_client/src/cmd-utils/slp_client/l_url.cpp,v 1.18 2009/09/25 13:32:38 venkat.puvvada Exp $
+ * $Header: /cvs/MSB/pegasus/src/slp/slp_client/src/cmd-utils/slp_client/l_url.cpp,v 1.19 2009/10/05 15:55:31 venkat.puvvada Exp $
*/
#define FLEX_SCANNER
void urlerror(const char *, ...);
static int16 heapIndex;
-static char heap[2052];
-static char buf[2052];
+static char *heap;
+static char *buf;
/* special counter to exit the appletalk state */
char atalk_state = 0;
#line 239 "url.l"
+static char *_lslp_strdup(const char *s)
+{
+ char *p = &heap[heapIndex];
+
+ while ((heap[heapIndex++] = *s++))
+ ;
+ return p;
+}
void url_close_lexer(size_t handle)
{
- PEGASUS_ASSERT(handle != 0);
+ PEGASUS_ASSERT(handle);
+ PEGASUS_ASSERT(buf);
+ PEGASUS_ASSERT(heap);
url_delete_buffer((YY_BUFFER_STATE)handle);
+ free(buf);
+ free(heap);
+ buf = heap = 0;
}
-
size_t url_init_lexer(const char *s)
{
- memset(&buf[0], 0x00, 2052);
- memset(&heap[0], 0x00, 2052);
+ size_t len = strlen(s) + 2;
+
+ if (!(heap = (char*)malloc(len)))
+ {
+ return 0;
+ }
+ if (!(buf = (char*)malloc(len)))
+ {
+ free (heap);
+ return 0;
+ }
heapIndex = 0;
- strncpy(&buf[0], s, 2048);
- return((size_t) url_scan_buffer(&buf[0], strlen(s) + 2));
-}
-
+ strcpy(buf, s);
+ buf[len - 1] = 0;
-static char *_lslp_strdup(const char *s)
-{
- char *p = &heap[heapIndex];
- do { heap[heapIndex++] = *s; } while ((*s != 0x00) && (heapIndex < 2049) && (++s));
- return(p);
+ return ((size_t) url_scan_buffer(buf, len));
}
void urlerror(const char *s, ...)
void urlerror(const char *, ...);
static int16 heapIndex;
-static char heap[2052];
-static char buf[2052];
+static char *heap;
+static char *buf;
/* special counter to exit the appletalk state */
char atalk_state = 0;
%%
+static char *_lslp_strdup(const char *s)
+{
+ char *p = &heap[heapIndex];
+
+ while ((heap[heapIndex++] = *s++))
+ ;
+ return p;
+}
void url_close_lexer(size_t handle)
{
- PEGASUS_ASSERT(handle != 0);
+ PEGASUS_ASSERT(handle);
+ PEGASUS_ASSERT(buf);
+ PEGASUS_ASSERT(heap);
url_delete_buffer((YY_BUFFER_STATE)handle);
+ free(buf);
+ free(heap);
+ buf = heap = 0;
}
-
size_t url_init_lexer(const char *s)
{
- memset(&buf[0], 0x00, 2052);
- memset(&heap[0], 0x00, 2052);
+ size_t len = strlen(s) + 2;
+
+ if (!(heap = (char*)malloc(len)))
+ {
+ return 0;
+ }
+ if (!(buf = (char*)malloc(len)))
+ {
+ free (heap);
+ return 0;
+ }
heapIndex = 0;
- strncpy(&buf[0], s, 2048);
- return((size_t) url_scan_buffer(&buf[0], strlen(s) + 2));
-}
-
+ strcpy(buf, s);
+ buf[len - 1] = 0;
-static char *_lslp_strdup(const char *s)
-{
- char *p = &heap[heapIndex];
- do { heap[heapIndex++] = *s; } while ((*s != 0x00) && (heapIndex < 2049) && (++s));
- return(p);
+ return ((size_t) url_scan_buffer(buf, len));
}
void urlerror(const char *s, ...)