*** empty log message ***
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@22 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
16ca1b7225
commit
cab4069c6a
7 changed files with 25 additions and 12 deletions
|
|
@ -9,7 +9,7 @@
|
||||||
* Chicago, IL 60637
|
* Chicago, IL 60637
|
||||||
* beazley@cs.uchicago.edu
|
* beazley@cs.uchicago.edu
|
||||||
*
|
*
|
||||||
* Please read the file LICENSE for the copyright and terms by which SWIG
|
* Please read the file LICENSE for the copyright and terms by which DOH
|
||||||
* can be used and distributed.
|
* can be used and distributed.
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@
|
||||||
* Chicago, IL 60637
|
* Chicago, IL 60637
|
||||||
* beazley@cs.uchicago.edu
|
* beazley@cs.uchicago.edu
|
||||||
*
|
*
|
||||||
* Please read the file LICENSE for the copyright and terms by which SWIG
|
* Please read the file LICENSE for the copyright and terms by which DOH
|
||||||
* can be used and distributed.
|
* can be used and distributed.
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@
|
||||||
* Chicago, IL 60637
|
* Chicago, IL 60637
|
||||||
* beazley@cs.uchicago.edu
|
* beazley@cs.uchicago.edu
|
||||||
*
|
*
|
||||||
* Please read the file LICENSE for the copyright and terms by which SWIG
|
* Please read the file LICENSE for the copyright and terms by which DOH
|
||||||
* can be used and distributed.
|
* can be used and distributed.
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
|
@ -426,12 +426,20 @@ DOH *DohSplit(DOH *in, char *chs, int nsplits) {
|
||||||
|
|
||||||
DOH *DohReadline(DOH *in) {
|
DOH *DohReadline(DOH *in) {
|
||||||
char c;
|
char c;
|
||||||
|
int n = 0;
|
||||||
DOH *s = NewString("");
|
DOH *s = NewString("");
|
||||||
while (1) {
|
while (1) {
|
||||||
if (Read(in,&c,1) < 0) return s;
|
if (Read(in,&c,1) < 0) {
|
||||||
|
if (n == 0) {
|
||||||
|
Delete(s);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
return s;
|
||||||
|
}
|
||||||
if (c == '\n') return s;
|
if (c == '\n') return s;
|
||||||
if (c == '\r') continue;
|
if (c == '\r') continue;
|
||||||
Putc(c,s);
|
Putc(c,s);
|
||||||
|
n++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Simplified Wrapper and Interface Generator (SWIG)
|
* DOH
|
||||||
*
|
*
|
||||||
* Author : David Beazley
|
* Author : David Beazley
|
||||||
*
|
*
|
||||||
|
|
@ -9,7 +9,7 @@
|
||||||
* Chicago, IL 60637
|
* Chicago, IL 60637
|
||||||
* beazley@cs.uchicago.edu
|
* beazley@cs.uchicago.edu
|
||||||
*
|
*
|
||||||
* Please read the file LICENSE for the copyright and terms by which SWIG
|
* Please read the file LICENSE for the copyright and terms by which DOH
|
||||||
* can be used and distributed.
|
* can be used and distributed.
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Simplified Wrapper and Interface Generator (SWIG)
|
* DOH
|
||||||
*
|
*
|
||||||
* Author : David Beazley
|
* Author : David Beazley
|
||||||
*
|
*
|
||||||
|
|
@ -9,7 +9,7 @@
|
||||||
* Chicago, IL 60637
|
* Chicago, IL 60637
|
||||||
* beazley@cs.uchicago.edu
|
* beazley@cs.uchicago.edu
|
||||||
*
|
*
|
||||||
* Please read the file LICENSE for the copyright and terms by which SWIG
|
* Please read the file LICENSE for the copyright and terms by which DOH
|
||||||
* can be used and distributed.
|
* can be used and distributed.
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
|
@ -326,9 +326,9 @@ List_str(DOH *lo)
|
||||||
|
|
||||||
List *l = (List *) lo;
|
List *l = (List *) lo;
|
||||||
s = NewString("");
|
s = NewString("");
|
||||||
Printf(s,"List [ ");
|
Printf(s,"List[ ");
|
||||||
for (i = 0; i < l->nitems; i++) {
|
for (i = 0; i < l->nitems; i++) {
|
||||||
Printf(s, " %s\n", l->items[i]);
|
Printf(s, "%s", l->items[i]);
|
||||||
if ((i+1) < l->nitems)
|
if ((i+1) < l->nitems)
|
||||||
Printf(s,", ");
|
Printf(s,", ");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@
|
||||||
* Chicago, IL 60637
|
* Chicago, IL 60637
|
||||||
* beazley@cs.uchicago.edu
|
* beazley@cs.uchicago.edu
|
||||||
*
|
*
|
||||||
* Please read the file LICENSE for the copyright and terms by which SWIG
|
* Please read the file LICENSE for the copyright and terms by which DOH
|
||||||
* can be used and distributed.
|
* can be used and distributed.
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@
|
||||||
* Chicago, IL 60637
|
* Chicago, IL 60637
|
||||||
* beazley@cs.uchicago.edu
|
* beazley@cs.uchicago.edu
|
||||||
*
|
*
|
||||||
* Please read the file LICENSE for the copyright and terms by which SWIG
|
* Please read the file LICENSE for the copyright and terms by which DOH
|
||||||
* can be used and distributed.
|
* can be used and distributed.
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
|
|
@ -181,6 +181,8 @@ extern int DohvPrintf(DOH *obj, char *format, va_list ap);
|
||||||
extern int DohvScanf(DOH *obj, char *format, va_list ap); */
|
extern int DohvScanf(DOH *obj, char *format, va_list ap); */
|
||||||
|
|
||||||
extern DOH *DohReadline(DOH *in);
|
extern DOH *DohReadline(DOH *in);
|
||||||
|
|
||||||
|
#ifndef DOH_LONG_NAMES
|
||||||
/* Macros to invoke the above functions. Includes the location of
|
/* Macros to invoke the above functions. Includes the location of
|
||||||
the caller to simplify debugging if something goes wrong */
|
the caller to simplify debugging if something goes wrong */
|
||||||
|
|
||||||
|
|
@ -230,6 +232,8 @@ extern DOH *DohReadline(DOH *in);
|
||||||
#define Nextitem DohNextitem
|
#define Nextitem DohNextitem
|
||||||
#define Readline DohReadline
|
#define Readline DohReadline
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
/* #define Scanf DohScanf
|
/* #define Scanf DohScanf
|
||||||
#define vScanf DohvScanf*/
|
#define vScanf DohvScanf*/
|
||||||
|
|
||||||
|
|
@ -321,3 +325,4 @@ extern DOH *DohSplit(DOH *input, char *chs, int nsplits);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue