Browse code

TM callbacks, acc, flags

Jiri Kuthan authored on 13/05/2002 01:15:40
Showing 1 changed files
1 1
deleted file mode 100644
... ...
@@ -1,44 +0,0 @@
1
-/* 
2
- * $Id$
3
- */
4
-
5
-#ifndef parser_f_h
6
-#define parser_f_h
7
-
8
-char* eat_line(char* buffer, unsigned int len);
9
-
10
-/* turn the most frequently called functions into inline functions */
11
-
12
-
13
-inline static char* eat_space_end(char* p, char* pend)
14
-{
15
-	for(;(p<pend)&&(*p==' ' || *p=='\t') ;p++);
16
-	return p;
17
-}
18
-
19
-
20
-
21
-inline static char* eat_token_end(char* p, char* pend)
22
-{
23
-	for (;(p<pend)&&(*p!=' ')&&(*p!='\t')&&(*p!='\n')&&(*p!='\r'); p++);
24
-	return p;
25
-}
26
-
27
-
28
-
29
-inline static char* eat_token2_end(char* p, char* pend, char delim)
30
-{
31
-	for (;(p<pend)&&(*p!=(delim))&&(*p!='\n')&&(*p!='\r'); p++);
32
-	return p;
33
-}
34
-
35
-
36
-
37
-inline static int is_empty_end(char* p, char* pend )
38
-{
39
-	p=eat_space_end(p, pend );
40
-	return ((p<(pend )) && (*p=='\r' || *p=='\n'));
41
-}
42
-
43
-
44
-#endif
Browse code

Sun cc ser core support: - major makefile changes - lots of warning fixed - replaced incompatible expr-statement defines ( ({ }) ). - special LOG, DBG, DPrint version for suncc

Andrei Pelinescu-Onciul authored on 01/03/2002 23:21:25
Showing 1 changed files
... ...
@@ -7,40 +7,38 @@
7 7
 
8 8
 char* eat_line(char* buffer, unsigned int len);
9 9
 
10
-/* turn the most frequently called functions into macros */
11
-
12
-
13
-#define eat_space_end(buffer,pend)                                       \
14
-  ( {   char *_p;                                                 	\
15
-	char *_pe=(pend);						\
16
-        for(_p=(buffer);(_p<_pe)&& (*_p==' ' || *_p=='\t') ;_p++);		\
17
-        _p;                                                              \
18
-  } )
19
-
20
-#define eat_token_end(buffer,pend)					\
21
-  ( { char *_p       ;							\
22
-      char *_pe=(pend);						\
23
-      for (_p=(buffer);(_p<_pe)&&					\
24
-                        (*_p!=' ')&&(*_p!='\t')&&(*_p!='\n')&&(*_p!='\r');	\
25
-                _p++);							\
26
-      _p;								\
27
-  } )
28
-
29
-#define eat_token2_end(buffer,pend,delim)					\
30
-  ( { char *_p       ;							\
31
-      char *_pe=(pend);						\
32
-      for (_p=(buffer);(_p<_pe)&&					\
33
-                        (*_p!=(delim))&&(*_p!='\n')&&(*_p!='\r');		\
34
-                _p++);							\
35
-      _p;								\
36
-  } )
37
-
38
-#define is_empty_end(buffer, pend )					\
39
-  ( { char *_p;								\
40
-      char *_pe=(pend);						\
41
-      _p=eat_space_end( buffer, _pe );					\
42
-      ((_p<(pend )) && (*_p=='\r' || *_p=='\n')) ? 1 : 0;			\
43
-  } )
10
+/* turn the most frequently called functions into inline functions */
11
+
12
+
13
+inline static char* eat_space_end(char* p, char* pend)
14
+{
15
+	for(;(p<pend)&&(*p==' ' || *p=='\t') ;p++);
16
+	return p;
17
+}
18
+
19
+
20
+
21
+inline static char* eat_token_end(char* p, char* pend)
22
+{
23
+	for (;(p<pend)&&(*p!=' ')&&(*p!='\t')&&(*p!='\n')&&(*p!='\r'); p++);
24
+	return p;
25
+}
26
+
27
+
28
+
29
+inline static char* eat_token2_end(char* p, char* pend, char delim)
30
+{
31
+	for (;(p<pend)&&(*p!=(delim))&&(*p!='\n')&&(*p!='\r'); p++);
32
+	return p;
33
+}
34
+
35
+
36
+
37
+inline static int is_empty_end(char* p, char* pend )
38
+{
39
+	p=eat_space_end(p, pend );
40
+	return ((p<(pend )) && (*p=='\r' || *p=='\n'));
41
+}
44 42
 
45 43
 
46 44
 #endif
Browse code

#define clean-up

Jiri Kuthan authored on 05/12/2001 23:00:08
Showing 1 changed files
... ...
@@ -7,13 +7,6 @@
7 7
 
8 8
 char* eat_line(char* buffer, unsigned int len);
9 9
 
10
-/* macro now
11
-int is_empty(char* buffer, unsigned int len);
12
-*/
13
-
14
-/* MACROEATER no more optional */
15
-/* #ifdef MACROEATER */
16
-
17 10
 /* turn the most frequently called functions into macros */
18 11
 
19 12
 
... ...
@@ -50,16 +43,4 @@ int is_empty(char* buffer, unsigned int len);
50 43
   } )
51 44
 
52 45
 
53
-/*
54
-#else
55
-
56
-
57
-char* eat_space(char* buffer, unsigned int len);
58
-char* eat_token(char* buffer, unsigned int len);
59
-char* eat_token2(char* buffer, unsigned int len, char delim);
60
-
61
-#endif
62
-*/
63
-/* EoMACROEATER */
64
-
65 46
 #endif
Browse code

t_reply_matching finalized

Jiri Kuthan authored on 29/11/2001 23:03:29
Showing 1 changed files
... ...
@@ -18,35 +18,35 @@ int is_empty(char* buffer, unsigned int len);
18 18
 
19 19
 
20 20
 #define eat_space_end(buffer,pend)                                       \
21
-  ( {   char *p;                                                 	\
22
-	char *pe=(pend);						\
23
-        for(p=(buffer);(p<pe)&& (*p==' ' || *p=='\t') ;p++);		\
24
-        p;                                                              \
21
+  ( {   char *_p;                                                 	\
22
+	char *_pe=(pend);						\
23
+        for(_p=(buffer);(_p<_pe)&& (*_p==' ' || *_p=='\t') ;_p++);		\
24
+        _p;                                                              \
25 25
   } )
26 26
 
27 27
 #define eat_token_end(buffer,pend)					\
28
-  ( { char *p       ;							\
29
-      char *pe=(pend);						\
30
-      for (p=(buffer);(p<pe)&&					\
31
-                        (*p!=' ')&&(*p!='\t')&&(*p!='\n')&&(*p!='\r');	\
32
-                p++);							\
33
-      p;								\
28
+  ( { char *_p       ;							\
29
+      char *_pe=(pend);						\
30
+      for (_p=(buffer);(_p<_pe)&&					\
31
+                        (*_p!=' ')&&(*_p!='\t')&&(*_p!='\n')&&(*_p!='\r');	\
32
+                _p++);							\
33
+      _p;								\
34 34
   } )
35 35
 
36 36
 #define eat_token2_end(buffer,pend,delim)					\
37
-  ( { char *p       ;							\
38
-      char *pe=(pend);						\
39
-      for (p=(buffer);(p<pe)&&					\
40
-                        (*p!=(delim))&&(*p!='\n')&&(*p!='\r');		\
41
-                p++);							\
42
-      p;								\
37
+  ( { char *_p       ;							\
38
+      char *_pe=(pend);						\
39
+      for (_p=(buffer);(_p<_pe)&&					\
40
+                        (*_p!=(delim))&&(*_p!='\n')&&(*_p!='\r');		\
41
+                _p++);							\
42
+      _p;								\
43 43
   } )
44 44
 
45 45
 #define is_empty_end(buffer, pend )					\
46
-  ( { char *p;								\
47
-      char *pe=(pend);						\
48
-      p=eat_space_end( buffer, pe );					\
49
-      ((p<pend ) && (*p=='\r' || *p=='\n')) ? 1 : 0;			\
46
+  ( { char *_p;								\
47
+      char *_pe=(pend);						\
48
+      _p=eat_space_end( buffer, _pe );					\
49
+      ((_p<(pend )) && (*_p=='\r' || *_p=='\n')) ? 1 : 0;			\
50 50
   } )
51 51
 
52 52
 
Browse code

fixed a macro inefficiency

Jiri Kuthan authored on 23/11/2001 16:38:51
Showing 1 changed files
... ...
@@ -19,13 +19,15 @@ int is_empty(char* buffer, unsigned int len);
19 19
 
20 20
 #define eat_space_end(buffer,pend)                                       \
21 21
   ( {   char *p;                                                 	\
22
-        for(p=(buffer);(p<pend)&& (*p==' ' || *p=='\t') ;p++);		\
22
+	char *pe=(pend);						\
23
+        for(p=(buffer);(p<pe)&& (*p==' ' || *p=='\t') ;p++);		\
23 24
         p;                                                              \
24 25
   } )
25 26
 
26 27
 #define eat_token_end(buffer,pend)					\
27 28
   ( { char *p       ;							\
28
-      for (p=(buffer);(p<pend)&&					\
29
+      char *pe=(pend);						\
30
+      for (p=(buffer);(p<pe)&&					\
29 31
                         (*p!=' ')&&(*p!='\t')&&(*p!='\n')&&(*p!='\r');	\
30 32
                 p++);							\
31 33
       p;								\
... ...
@@ -33,7 +35,8 @@ int is_empty(char* buffer, unsigned int len);
33 35
 
34 36
 #define eat_token2_end(buffer,pend,delim)					\
35 37
   ( { char *p       ;							\
36
-      for (p=(buffer);(p<pend)&&					\
38
+      char *pe=(pend);						\
39
+      for (p=(buffer);(p<pe)&&					\
37 40
                         (*p!=(delim))&&(*p!='\n')&&(*p!='\r');		\
38 41
                 p++);							\
39 42
       p;								\
... ...
@@ -41,7 +44,8 @@ int is_empty(char* buffer, unsigned int len);
41 44
 
42 45
 #define is_empty_end(buffer, pend )					\
43 46
   ( { char *p;								\
44
-      p=eat_space_end( buffer, pend );					\
47
+      char *pe=(pend);						\
48
+      p=eat_space_end( buffer, pe );					\
45 49
       ((p<pend ) && (*p=='\r' || *p=='\n')) ? 1 : 0;			\
46 50
   } )
47 51
 
Browse code

port numbers different now for remote and local

Jiri Kuthan authored on 20/11/2001 06:26:49
Showing 1 changed files
... ...
@@ -6,36 +6,47 @@
6 6
 #define parser_f_h
7 7
 
8 8
 char* eat_line(char* buffer, unsigned int len);
9
+
10
+/* macro now
9 11
 int is_empty(char* buffer, unsigned int len);
12
+*/
10 13
 
11
-#ifdef MACROEATER
14
+/* MACROEATER no more optional */
15
+/* #ifdef MACROEATER */
12 16
 
13 17
 /* turn the most frequently called functions into macros */
14 18
 
15 19
 
16
-#define eat_space(buffer,len)                                          \
17
-  ( {   char *p;                                                     	\
18
-        for(p=(buffer);(p<(buffer)+(len))&& (*p==' ' || *p=='\t') ;p++);\
20
+#define eat_space_end(buffer,pend)                                       \
21
+  ( {   char *p;                                                 	\
22
+        for(p=(buffer);(p<pend)&& (*p==' ' || *p=='\t') ;p++);		\
19 23
         p;                                                              \
20 24
   } )
21 25
 
22
-#define eat_token(buffer,len)						\
23
-  ( { char *p;								\
24
-      for (p=(buffer);(p<(buffer)+(len))&&				\
26
+#define eat_token_end(buffer,pend)					\
27
+  ( { char *p       ;							\
28
+      for (p=(buffer);(p<pend)&&					\
25 29
                         (*p!=' ')&&(*p!='\t')&&(*p!='\n')&&(*p!='\r');	\
26 30
                 p++);							\
27 31
       p;								\
28 32
   } )
29 33
 
30
-#define eat_token2(buffer,len,delim)					\
31
-  ( { char *p;								\
32
-      for (p=(buffer);(p<(buffer)+(len))&&				\
34
+#define eat_token2_end(buffer,pend,delim)					\
35
+  ( { char *p       ;							\
36
+      for (p=(buffer);(p<pend)&&					\
33 37
                         (*p!=(delim))&&(*p!='\n')&&(*p!='\r');		\
34 38
                 p++);							\
35 39
       p;								\
36 40
   } )
37 41
 
42
+#define is_empty_end(buffer, pend )					\
43
+  ( { char *p;								\
44
+      p=eat_space_end( buffer, pend );					\
45
+      ((p<pend ) && (*p=='\r' || *p=='\n')) ? 1 : 0;			\
46
+  } )
47
+
38 48
 
49
+/*
39 50
 #else
40 51
 
41 52
 
... ...
@@ -43,7 +54,8 @@ char* eat_space(char* buffer, unsigned int len);
43 54
 char* eat_token(char* buffer, unsigned int len);
44 55
 char* eat_token2(char* buffer, unsigned int len, char delim);
45 56
 
46
-/* EoMACROEATER */
47 57
 #endif
58
+*/
59
+/* EoMACROEATER */
48 60
 
49 61
 #endif
Browse code

Added NOCR and MACROEATER compile-time speed-up options. NOCR replaces a 'for' cycle with 'memchr' and MACROEATER replaces 'eater' functions with macros. The -V command-line options shows now which of these options are enabled. A signal handler is added which calls exit(0) on INT signal ... good for profiling.

-Jiri

Jiri Kuthan authored on 06/10/2001 22:17:53
Showing 1 changed files
... ...
@@ -6,10 +6,44 @@
6 6
 #define parser_f_h
7 7
 
8 8
 char* eat_line(char* buffer, unsigned int len);
9
+int is_empty(char* buffer, unsigned int len);
10
+
11
+#ifdef MACROEATER
12
+
13
+/* turn the most frequently called functions into macros */
14
+
15
+
16
+#define eat_space(buffer,len)                                          \
17
+  ( {   char *p;                                                     	\
18
+        for(p=(buffer);(p<(buffer)+(len))&& (*p==' ' || *p=='\t') ;p++);\
19
+        p;                                                              \
20
+  } )
21
+
22
+#define eat_token(buffer,len)						\
23
+  ( { char *p;								\
24
+      for (p=(buffer);(p<(buffer)+(len))&&				\
25
+                        (*p!=' ')&&(*p!='\t')&&(*p!='\n')&&(*p!='\r');	\
26
+                p++);							\
27
+      p;								\
28
+  } )
29
+
30
+#define eat_token2(buffer,len,delim)					\
31
+  ( { char *p;								\
32
+      for (p=(buffer);(p<(buffer)+(len))&&				\
33
+                        (*p!=(delim))&&(*p!='\n')&&(*p!='\r');		\
34
+                p++);							\
35
+      p;								\
36
+  } )
37
+
38
+
39
+#else
40
+
41
+
9 42
 char* eat_space(char* buffer, unsigned int len);
10 43
 char* eat_token(char* buffer, unsigned int len);
11 44
 char* eat_token2(char* buffer, unsigned int len, char delim);
12
-int is_empty(char* buffer, unsigned int len);
45
+
46
+/* EoMACROEATER */
47
+#endif
13 48
 
14 49
 #endif
15
- 
Browse code

Initial revision

Andrei Pelinescu-Onciul authored on 03/09/2001 21:27:11
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,15 @@
1
+/* 
2
+ * $Id$
3
+ */
4
+
5
+#ifndef parser_f_h
6
+#define parser_f_h
7
+
8
+char* eat_line(char* buffer, unsigned int len);
9
+char* eat_space(char* buffer, unsigned int len);
10
+char* eat_token(char* buffer, unsigned int len);
11
+char* eat_token2(char* buffer, unsigned int len, char delim);
12
+int is_empty(char* buffer, unsigned int len);
13
+
14
+#endif
15
+