beautify/format source code with gnu indent
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@9505 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
5364d135c7
commit
aa04c4c057
72 changed files with 27038 additions and 28016 deletions
|
|
@ -14,7 +14,7 @@ char cvsroot_wrapfunc_c[] = "$Header$";
|
|||
#include "swig.h"
|
||||
#include <ctype.h>
|
||||
|
||||
static int Compact_mode = 0; /* set to 0 on default */
|
||||
static int Compact_mode = 0; /* set to 0 on default */
|
||||
static int Max_line_size = 128;
|
||||
|
||||
/* -----------------------------------------------------------------------------
|
||||
|
|
@ -23,8 +23,7 @@ static int Max_line_size = 128;
|
|||
* Create a new wrapper function object.
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
Wrapper *
|
||||
NewWrapper() {
|
||||
Wrapper *NewWrapper() {
|
||||
Wrapper *w;
|
||||
w = (Wrapper *) malloc(sizeof(Wrapper));
|
||||
w->localh = NewHash();
|
||||
|
|
@ -40,8 +39,7 @@ NewWrapper() {
|
|||
* Delete a wrapper function object.
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
void
|
||||
DelWrapper(Wrapper *w) {
|
||||
void DelWrapper(Wrapper *w) {
|
||||
Delete(w->localh);
|
||||
Delete(w->locals);
|
||||
Delete(w->code);
|
||||
|
|
@ -55,8 +53,7 @@ DelWrapper(Wrapper *w) {
|
|||
* Set compact_mode.
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
void
|
||||
Wrapper_compact_print_mode_set(int flag) {
|
||||
void Wrapper_compact_print_mode_set(int flag) {
|
||||
Compact_mode = flag;
|
||||
}
|
||||
|
||||
|
|
@ -66,8 +63,7 @@ Wrapper_compact_print_mode_set(int flag) {
|
|||
* Formats a wrapper function and fixes up the indentation.
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
void
|
||||
Wrapper_pretty_print(String *str, File *f) {
|
||||
void Wrapper_pretty_print(String *str, File *f) {
|
||||
String *ts;
|
||||
int level = 0;
|
||||
int c, i;
|
||||
|
|
@ -77,127 +73,132 @@ Wrapper_pretty_print(String *str, File *f) {
|
|||
int label = 0;
|
||||
|
||||
ts = NewStringEmpty();
|
||||
Seek(str,0, SEEK_SET);
|
||||
Seek(str, 0, SEEK_SET);
|
||||
while ((c = Getc(str)) != EOF) {
|
||||
if (c == '\"') {
|
||||
Putc(c,ts);
|
||||
Putc(c, ts);
|
||||
while ((c = Getc(str)) != EOF) {
|
||||
if (c == '\\') {
|
||||
Putc(c,ts);
|
||||
Putc(c, ts);
|
||||
c = Getc(str);
|
||||
}
|
||||
Putc(c,ts);
|
||||
if (c == '\"') break;
|
||||
Putc(c, ts);
|
||||
if (c == '\"')
|
||||
break;
|
||||
}
|
||||
empty = 0;
|
||||
} else if (c == '\'') {
|
||||
Putc(c,ts);
|
||||
Putc(c, ts);
|
||||
while ((c = Getc(str)) != EOF) {
|
||||
if (c == '\\') {
|
||||
Putc(c,ts);
|
||||
Putc(c, ts);
|
||||
c = Getc(str);
|
||||
}
|
||||
Putc(c,ts);
|
||||
if (c == '\'') break;
|
||||
Putc(c, ts);
|
||||
if (c == '\'')
|
||||
break;
|
||||
}
|
||||
empty = 0;
|
||||
} else if (c == ':') {
|
||||
Putc(c,ts);
|
||||
Putc(c, ts);
|
||||
if ((c = Getc(str)) == '\n') {
|
||||
if (!empty && !strchr(Char(ts),'?')) label = 1;
|
||||
if (!empty && !strchr(Char(ts), '?'))
|
||||
label = 1;
|
||||
}
|
||||
Ungetc(c,str);
|
||||
Ungetc(c, str);
|
||||
} else if (c == '(') {
|
||||
Putc(c,ts);
|
||||
plevel+=indent;
|
||||
Putc(c, ts);
|
||||
plevel += indent;
|
||||
empty = 0;
|
||||
} else if (c == ')') {
|
||||
Putc(c,ts);
|
||||
plevel-=indent;
|
||||
Putc(c, ts);
|
||||
plevel -= indent;
|
||||
empty = 0;
|
||||
} else if (c == '{') {
|
||||
Putc(c,ts);
|
||||
Putc('\n',ts);
|
||||
for (i = 0; i < level; i++)
|
||||
Putc(' ',f);
|
||||
Printf(f,"%s", ts);
|
||||
Putc(c, ts);
|
||||
Putc('\n', ts);
|
||||
for (i = 0; i < level; i++)
|
||||
Putc(' ', f);
|
||||
Printf(f, "%s", ts);
|
||||
Clear(ts);
|
||||
level+=indent;
|
||||
level += indent;
|
||||
while ((c = Getc(str)) != EOF) {
|
||||
if (!isspace(c)) {
|
||||
Ungetc(c,str);
|
||||
Ungetc(c, str);
|
||||
break;
|
||||
}
|
||||
}
|
||||
empty = 0;
|
||||
} else if (c == '}') {
|
||||
if (!empty) {
|
||||
Putc('\n',ts);
|
||||
Putc('\n', ts);
|
||||
for (i = 0; i < level; i++)
|
||||
Putc(' ',f);
|
||||
Printf(f,"%s",ts);
|
||||
Putc(' ', f);
|
||||
Printf(f, "%s", ts);
|
||||
Clear(ts);
|
||||
}
|
||||
level-=indent;
|
||||
Putc(c,ts);
|
||||
level -= indent;
|
||||
Putc(c, ts);
|
||||
empty = 0;
|
||||
} else if (c == '\n') {
|
||||
Putc(c,ts);
|
||||
Putc(c, ts);
|
||||
empty = 0;
|
||||
if (!empty) {
|
||||
int slevel = level;
|
||||
if (label && (slevel >= indent)) slevel -= indent;
|
||||
if (label && (slevel >= indent))
|
||||
slevel -= indent;
|
||||
if ((Char(ts))[0] != '#') {
|
||||
for (i = 0; i < slevel; i++)
|
||||
Putc(' ',f);
|
||||
Putc(' ', f);
|
||||
}
|
||||
Printf(f,"%s",ts);
|
||||
Printf(f, "%s", ts);
|
||||
for (i = 0; i < plevel; i++)
|
||||
Putc(' ',f);
|
||||
Putc(' ', f);
|
||||
}
|
||||
Clear(ts);
|
||||
label = 0;
|
||||
empty = 1;
|
||||
} else if (c == '/') {
|
||||
empty = 0;
|
||||
Putc(c,ts);
|
||||
Putc(c, ts);
|
||||
c = Getc(str);
|
||||
if (c != EOF) {
|
||||
Putc(c,ts);
|
||||
if (c == '/') { /* C++ comment */
|
||||
Putc(c, ts);
|
||||
if (c == '/') { /* C++ comment */
|
||||
while ((c = Getc(str)) != EOF) {
|
||||
if (c == '\n') {
|
||||
Ungetc(c,str);
|
||||
Ungetc(c, str);
|
||||
break;
|
||||
}
|
||||
Putc(c,ts);
|
||||
Putc(c, ts);
|
||||
}
|
||||
} else if (c == '*') { /* C comment */
|
||||
int endstar = 0;
|
||||
} else if (c == '*') { /* C comment */
|
||||
int endstar = 0;
|
||||
while ((c = Getc(str)) != EOF) {
|
||||
if (endstar && c == '/') { /* end of C comment */
|
||||
Putc(c,ts);
|
||||
if (endstar && c == '/') { /* end of C comment */
|
||||
Putc(c, ts);
|
||||
break;
|
||||
}
|
||||
endstar = (c == '*');
|
||||
Putc(c,ts);
|
||||
if (c == '\n') { /* multi-line C comment. Could be improved slightly. */
|
||||
for (i = 0; i < level; i++)
|
||||
Putc(' ',ts);
|
||||
}
|
||||
endstar = (c == '*');
|
||||
Putc(c, ts);
|
||||
if (c == '\n') { /* multi-line C comment. Could be improved slightly. */
|
||||
for (i = 0; i < level; i++)
|
||||
Putc(' ', ts);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (!empty || !isspace(c)) {
|
||||
Putc(c,ts);
|
||||
Putc(c, ts);
|
||||
empty = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!empty) Printf(f,"%s",ts);
|
||||
if (!empty)
|
||||
Printf(f, "%s", ts);
|
||||
Delete(ts);
|
||||
Printf(f,"\n");
|
||||
Printf(f, "\n");
|
||||
}
|
||||
|
||||
/* -----------------------------------------------------------------------------
|
||||
|
|
@ -207,9 +208,8 @@ Wrapper_pretty_print(String *str, File *f) {
|
|||
* Print out in compact format, with Compact enabled.
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
void
|
||||
Wrapper_compact_print(String *str, File *f) {
|
||||
String *ts, *tf; /*temp string & temp file */
|
||||
void Wrapper_compact_print(String *str, File *f) {
|
||||
String *ts, *tf; /*temp string & temp file */
|
||||
int level = 0;
|
||||
int c, i;
|
||||
int empty = 1;
|
||||
|
|
@ -217,163 +217,165 @@ Wrapper_compact_print(String *str, File *f) {
|
|||
|
||||
ts = NewStringEmpty();
|
||||
tf = NewStringEmpty();
|
||||
Seek(str,0, SEEK_SET);
|
||||
Seek(str, 0, SEEK_SET);
|
||||
|
||||
while ((c = Getc(str)) != EOF) {
|
||||
if (c == '\"') { /* string 1 */
|
||||
if (c == '\"') { /* string 1 */
|
||||
empty = 0;
|
||||
Putc(c,ts);
|
||||
Putc(c, ts);
|
||||
while ((c = Getc(str)) != EOF) {
|
||||
if (c == '\\') {
|
||||
Putc(c,ts);
|
||||
Putc(c, ts);
|
||||
c = Getc(str);
|
||||
}
|
||||
Putc(c,ts);
|
||||
if (c == '\"') break;
|
||||
Putc(c, ts);
|
||||
if (c == '\"')
|
||||
break;
|
||||
}
|
||||
} else if (c == '\'') { /* string 2 */
|
||||
} else if (c == '\'') { /* string 2 */
|
||||
empty = 0;
|
||||
Putc(c,ts);
|
||||
Putc(c, ts);
|
||||
while ((c = Getc(str)) != EOF) {
|
||||
if (c == '\\') {
|
||||
Putc(c,ts);
|
||||
Putc(c, ts);
|
||||
c = Getc(str);
|
||||
}
|
||||
Putc(c,ts);
|
||||
if (c == '\'') break;
|
||||
Putc(c, ts);
|
||||
if (c == '\'')
|
||||
break;
|
||||
}
|
||||
} else if (c == '{') { /* start of {...} */
|
||||
} else if (c == '{') { /* start of {...} */
|
||||
empty = 0;
|
||||
Putc(c,ts);
|
||||
Putc(c, ts);
|
||||
if (Len(tf) == 0) {
|
||||
for (i = 0; i < level; i++)
|
||||
Putc(' ',tf);
|
||||
for (i = 0; i < level; i++)
|
||||
Putc(' ', tf);
|
||||
} else if ((Len(tf) + Len(ts)) < Max_line_size) {
|
||||
Putc(' ',tf);
|
||||
Putc(' ', tf);
|
||||
} else {
|
||||
Putc('\n',tf);
|
||||
Printf(f,"%s", tf);
|
||||
Putc('\n', tf);
|
||||
Printf(f, "%s", tf);
|
||||
Clear(tf);
|
||||
for (i = 0; i < level; i++)
|
||||
Putc(' ',tf);
|
||||
for (i = 0; i < level; i++)
|
||||
Putc(' ', tf);
|
||||
}
|
||||
Append(tf,ts);
|
||||
Append(tf, ts);
|
||||
Clear(ts);
|
||||
level+=indent;
|
||||
level += indent;
|
||||
while ((c = Getc(str)) != EOF) {
|
||||
if (!isspace(c)) {
|
||||
Ungetc(c,str);
|
||||
Ungetc(c, str);
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else if (c == '}') { /* end of {...} */
|
||||
} else if (c == '}') { /* end of {...} */
|
||||
empty = 0;
|
||||
if (Len(tf) == 0) {
|
||||
for (i = 0; i < level; i++)
|
||||
Putc(' ',tf);
|
||||
for (i = 0; i < level; i++)
|
||||
Putc(' ', tf);
|
||||
} else if ((Len(tf) + Len(ts)) < Max_line_size) {
|
||||
Putc(' ',tf);
|
||||
Putc(' ', tf);
|
||||
} else {
|
||||
Putc('\n',tf);
|
||||
Printf(f,"%s", tf);
|
||||
Putc('\n', tf);
|
||||
Printf(f, "%s", tf);
|
||||
Clear(tf);
|
||||
for (i = 0; i < level; i++)
|
||||
Putc(' ',tf);
|
||||
for (i = 0; i < level; i++)
|
||||
Putc(' ', tf);
|
||||
}
|
||||
Append(tf, ts);
|
||||
Putc(c, tf);
|
||||
Clear(ts);
|
||||
level-=indent;
|
||||
} else if (c == '\n') { /* line end */
|
||||
level -= indent;
|
||||
} else if (c == '\n') { /* line end */
|
||||
while ((c = Getc(str)) != EOF) {
|
||||
if (!isspace(c))
|
||||
break;
|
||||
}
|
||||
if (c == '#'){
|
||||
Putc('\n',ts);
|
||||
if (c == '#') {
|
||||
Putc('\n', ts);
|
||||
} else if (c == '}') {
|
||||
Putc(' ',ts);
|
||||
} else if ( (c != EOF) || (Len(ts)!=0) ){
|
||||
Putc(' ', ts);
|
||||
} else if ((c != EOF) || (Len(ts) != 0)) {
|
||||
if (Len(tf) == 0) {
|
||||
for (i = 0; i < level; i++)
|
||||
Putc(' ',tf);
|
||||
for (i = 0; i < level; i++)
|
||||
Putc(' ', tf);
|
||||
} else if ((Len(tf) + Len(ts)) < Max_line_size) {
|
||||
Putc(' ',tf);
|
||||
Putc(' ', tf);
|
||||
} else {
|
||||
Putc('\n',tf);
|
||||
Printf(f,"%s", tf);
|
||||
Putc('\n', tf);
|
||||
Printf(f, "%s", tf);
|
||||
Clear(tf);
|
||||
for (i = 0; i < level; i++)
|
||||
Putc(' ',tf);
|
||||
for (i = 0; i < level; i++)
|
||||
Putc(' ', tf);
|
||||
}
|
||||
Append(tf,ts);
|
||||
Append(tf, ts);
|
||||
Clear(ts);
|
||||
}
|
||||
Ungetc(c,str);
|
||||
Ungetc(c, str);
|
||||
|
||||
empty = 1;
|
||||
} else if (c == '/') { /* comment */
|
||||
} else if (c == '/') { /* comment */
|
||||
empty = 0;
|
||||
c = Getc(str);
|
||||
if (c != EOF) {
|
||||
if (c == '/') { /* C++ comment */
|
||||
if (c == '/') { /* C++ comment */
|
||||
while ((c = Getc(str)) != EOF) {
|
||||
if (c == '\n') {
|
||||
Ungetc(c,str);
|
||||
Ungetc(c, str);
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else if (c == '*') { /* C comment */
|
||||
} else if (c == '*') { /* C comment */
|
||||
int endstar = 0;
|
||||
while ((c = Getc(str)) != EOF) {
|
||||
if (endstar && c == '/') { /* end of C comment */
|
||||
if (endstar && c == '/') { /* end of C comment */
|
||||
break;
|
||||
}
|
||||
endstar = (c == '*');
|
||||
endstar = (c == '*');
|
||||
}
|
||||
} else {
|
||||
Putc('/',ts);
|
||||
Putc(c,ts);
|
||||
} else {
|
||||
Putc('/', ts);
|
||||
Putc(c, ts);
|
||||
}
|
||||
}
|
||||
} else if (c == '#') { /* Preprocessor line */
|
||||
} else if (c == '#') { /* Preprocessor line */
|
||||
Putc('#', ts);
|
||||
while ((c = Getc(str)) != EOF) {
|
||||
Putc(c, ts);
|
||||
if (c == '\\') { /* Continued line of the same PP */
|
||||
if (c == '\\') { /* Continued line of the same PP */
|
||||
c = Getc(str);
|
||||
if (c == '\n')
|
||||
Putc(c, ts);
|
||||
else
|
||||
Ungetc(c, str);
|
||||
} else if (c == '\n')
|
||||
} else if (c == '\n')
|
||||
break;
|
||||
}
|
||||
if (!empty) {
|
||||
Append(tf,"\n");
|
||||
Append(tf, "\n");
|
||||
}
|
||||
Append(tf,ts);
|
||||
Append(tf, ts);
|
||||
Printf(f, "%s", tf);
|
||||
Clear(tf);
|
||||
Clear(ts);
|
||||
for (i = 0; i < level; i++)
|
||||
Putc(' ',tf);
|
||||
for (i = 0; i < level; i++)
|
||||
Putc(' ', tf);
|
||||
empty = 1;
|
||||
} else {
|
||||
if (!empty || !isspace(c)) {
|
||||
Putc(c,ts);
|
||||
Putc(c, ts);
|
||||
empty = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!empty) {
|
||||
Append(tf,ts);
|
||||
Append(tf, ts);
|
||||
}
|
||||
if (Len(tf) != 0)
|
||||
Printf(f,"%s",tf);
|
||||
Printf(f, "%s", tf);
|
||||
Delete(ts);
|
||||
Delete(tf);
|
||||
Printf(f,"\n");
|
||||
Printf(f, "\n");
|
||||
}
|
||||
|
||||
/* -----------------------------------------------------------------------------
|
||||
|
|
@ -382,18 +384,17 @@ Wrapper_compact_print(String *str, File *f) {
|
|||
* Print out a wrapper function. Does pretty or compact printing as well.
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
void
|
||||
Wrapper_print(Wrapper *w, File *f) {
|
||||
void Wrapper_print(Wrapper *w, File *f) {
|
||||
String *str;
|
||||
|
||||
str = NewStringEmpty();
|
||||
Printf(str,"%s\n", w->def);
|
||||
Printf(str,"%s\n", w->locals);
|
||||
Printf(str,"%s\n", w->code);
|
||||
Printf(str, "%s\n", w->def);
|
||||
Printf(str, "%s\n", w->locals);
|
||||
Printf(str, "%s\n", w->code);
|
||||
if (Compact_mode == 1)
|
||||
Wrapper_compact_print(str,f);
|
||||
Wrapper_compact_print(str, f);
|
||||
else
|
||||
Wrapper_pretty_print(str,f);
|
||||
Wrapper_pretty_print(str, f);
|
||||
|
||||
Delete(str);
|
||||
}
|
||||
|
|
@ -405,14 +406,13 @@ Wrapper_print(Wrapper *w, File *f) {
|
|||
* present (which may or may not be okay to the caller).
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
int
|
||||
Wrapper_add_local(Wrapper *w, const String_or_char *name, const String_or_char *decl) {
|
||||
int Wrapper_add_local(Wrapper *w, const String_or_char *name, const String_or_char *decl) {
|
||||
/* See if the local has already been declared */
|
||||
if (Getattr(w->localh,name)) {
|
||||
if (Getattr(w->localh, name)) {
|
||||
return -1;
|
||||
}
|
||||
Setattr(w->localh,name,decl);
|
||||
Printf(w->locals,"%s;\n", decl);
|
||||
Setattr(w->localh, name, decl);
|
||||
Printf(w->locals, "%s;\n", decl);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -424,24 +424,23 @@ Wrapper_add_local(Wrapper *w, const String_or_char *name, const String_or_char *
|
|||
* to manually construct the 'decl' string before calling.
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
int
|
||||
Wrapper_add_localv(Wrapper *w, const String_or_char *name, ...) {
|
||||
int Wrapper_add_localv(Wrapper *w, const String_or_char *name, ...) {
|
||||
va_list ap;
|
||||
int ret;
|
||||
int ret;
|
||||
String *decl;
|
||||
DOH *obj;
|
||||
DOH *obj;
|
||||
decl = NewStringEmpty();
|
||||
va_start(ap,name);
|
||||
va_start(ap, name);
|
||||
|
||||
obj = va_arg(ap,void *);
|
||||
obj = va_arg(ap, void *);
|
||||
while (obj) {
|
||||
Append(decl,obj);
|
||||
Append(decl, obj);
|
||||
Putc(' ', decl);
|
||||
obj = va_arg(ap, void *);
|
||||
}
|
||||
va_end(ap);
|
||||
|
||||
ret = Wrapper_add_local(w,name,decl);
|
||||
ret = Wrapper_add_local(w, name, decl);
|
||||
Delete(decl);
|
||||
return ret;
|
||||
}
|
||||
|
|
@ -452,9 +451,8 @@ Wrapper_add_localv(Wrapper *w, const String_or_char *name, ...) {
|
|||
* Check to see if a local name has already been declared
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
int
|
||||
Wrapper_check_local(Wrapper *w, const String_or_char *name) {
|
||||
if (Getattr(w->localh,name)) {
|
||||
int Wrapper_check_local(Wrapper *w, const String_or_char *name) {
|
||||
if (Getattr(w->localh, name)) {
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
|
|
@ -467,27 +465,26 @@ Wrapper_check_local(Wrapper *w, const String_or_char *name) {
|
|||
* used. Returns the name that was actually selected.
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
char *
|
||||
Wrapper_new_local(Wrapper *w, const String_or_char *name, const String_or_char *decl) {
|
||||
char *Wrapper_new_local(Wrapper *w, const String_or_char *name, const String_or_char *decl) {
|
||||
int i;
|
||||
String *nname = NewString(name);
|
||||
String *ndecl = NewString(decl);
|
||||
char *ret;
|
||||
char *ret;
|
||||
|
||||
i = 0;
|
||||
|
||||
while (Wrapper_check_local(w,nname)) {
|
||||
while (Wrapper_check_local(w, nname)) {
|
||||
Clear(nname);
|
||||
Printf(nname,"%s%d",name,i);
|
||||
Printf(nname, "%s%d", name, i);
|
||||
i++;
|
||||
}
|
||||
Replace(ndecl, name, nname, DOH_REPLACE_ID);
|
||||
Setattr(w->localh,nname,ndecl);
|
||||
Printf(w->locals,"%s;\n", ndecl);
|
||||
Setattr(w->localh, nname, ndecl);
|
||||
Printf(w->locals, "%s;\n", ndecl);
|
||||
ret = Char(nname);
|
||||
Delete(nname);
|
||||
Delete(ndecl);
|
||||
return ret; /* Note: nname should still exists in the w->localh hash */
|
||||
return ret; /* Note: nname should still exists in the w->localh hash */
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -499,30 +496,23 @@ Wrapper_new_local(Wrapper *w, const String_or_char *name, const String_or_char *
|
|||
* to manually construct the 'decl' string before calling.
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
char *
|
||||
Wrapper_new_localv(Wrapper *w, const String_or_char *name, ...) {
|
||||
char *Wrapper_new_localv(Wrapper *w, const String_or_char *name, ...) {
|
||||
va_list ap;
|
||||
char *ret;
|
||||
String *decl;
|
||||
DOH *obj;
|
||||
DOH *obj;
|
||||
decl = NewStringEmpty();
|
||||
va_start(ap,name);
|
||||
va_start(ap, name);
|
||||
|
||||
obj = va_arg(ap,void *);
|
||||
obj = va_arg(ap, void *);
|
||||
while (obj) {
|
||||
Append(decl,obj);
|
||||
Putc(' ',decl);
|
||||
Append(decl, obj);
|
||||
Putc(' ', decl);
|
||||
obj = va_arg(ap, void *);
|
||||
}
|
||||
va_end(ap);
|
||||
|
||||
ret = Wrapper_new_local(w,name,decl);
|
||||
ret = Wrapper_new_local(w, name, decl);
|
||||
Delete(decl);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue