From 6dc277bfcfeec66b1d73c9cd4b143310f3807abf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20H=C3=BCbinette=20=28Hubbe=29?= <hubbe@hubbe.net> Date: Fri, 28 Jul 2000 00:16:22 -0700 Subject: [PATCH] JUMBOPATCH: dynamic loading now works on Win* !!!! (somewhat experimental :) Rev: NT/tools/ar:1.10 Rev: NT/tools/lib.pike:1.14 Rev: NT/tools/rntcl:1.7 Rev: bin/fake_dynamic_load.pike:1.1 Rev: bin/fixdepends.sh:1.7 Rev: bin/install.pike:1.58 Rev: bin/precompile.pike:1.13 Rev: lib/modules/Parser.pmod/C.pmod:1.8 Rev: src/modules/CommonLog/clf.c:1.3 Rev: src/modules/Gdbm/gdbmmod.c:1.11 Rev: src/modules/Gettext/gettext.c:1.4 Rev: src/modules/Gmp/mpz_glue.c:1.79 Rev: src/modules/Gmp/my_mpz_xor.c:1.3 Rev: src/modules/Gz/zlibmod.c:1.29 Rev: src/modules/HTTPLoop/accept_and_parse.c:1.14 Rev: src/modules/HTTPLoop/cache.c:1.12 Rev: src/modules/HTTPLoop/configure.in:1.5 Rev: src/modules/HTTPLoop/filesystem.c:1.5 Rev: src/modules/HTTPLoop/log.c:1.7 Rev: src/modules/HTTPLoop/requestobject.c:1.10 Rev: src/modules/HTTPLoop/timeout.c:1.6 Rev: src/modules/HTTPLoop/util.c:1.4 Rev: src/modules/Image/blit.c:1.43 Rev: src/modules/Image/colors.c:1.32 Rev: src/modules/Image/colortable.c:1.79 Rev: src/modules/Image/configure.in:1.15 Rev: src/modules/Image/dct.c:1.15 Rev: src/modules/Image/encodings/_xpm.c:1.12 Rev: src/modules/Image/encodings/any.c:1.18 Rev: src/modules/Image/encodings/avs.c:1.9 Rev: src/modules/Image/encodings/bmp.c:1.22 Rev: src/modules/Image/encodings/gd.c:1.4 Rev: src/modules/Image/encodings/gif.c:1.52 Rev: src/modules/Image/encodings/gif_lzw.c:1.7 Rev: src/modules/Image/encodings/hrz.c:1.5 Rev: src/modules/Image/encodings/iff.c:1.5 Rev: src/modules/Image/encodings/ilbm.c:1.15 Rev: src/modules/Image/encodings/pcx.c:1.10 Rev: src/modules/Image/encodings/png.c:1.33 Rev: src/modules/Image/encodings/pnm.c:1.22 Rev: src/modules/Image/encodings/psd.c:1.17 Rev: src/modules/Image/encodings/pvr.c:1.9 Rev: src/modules/Image/encodings/ras.c:1.7 Rev: src/modules/Image/encodings/tga.c:1.16 Rev: src/modules/Image/encodings/tim.c:1.7 Rev: src/modules/Image/encodings/wbf.c:1.5 Rev: src/modules/Image/encodings/x.c:1.27 Rev: src/modules/Image/encodings/xbm.c:1.10 Rev: src/modules/Image/encodings/xcf.c:1.15 Rev: src/modules/Image/encodings/xwd.c:1.15 Rev: src/modules/Image/font.c:1.60 Rev: src/modules/Image/image.c:1.166 Rev: src/modules/Image/image_module.c:1.7 Rev: src/modules/Image/layers.c:1.45 Rev: src/modules/Image/matrix.c:1.24 Rev: src/modules/Image/operator.c:1.30 Rev: src/modules/Image/orient.c:1.15 Rev: src/modules/Image/pattern.c:1.20 Rev: src/modules/Image/poly.c:1.5 Rev: src/modules/Image/polyfill.c:1.32 Rev: src/modules/Image/search.c:1.16 Rev: src/modules/Java/jvm.c:1.26 Rev: src/modules/MIME/mime.c:1.22 Rev: src/modules/Math/math_matrix.c:1.14 Rev: src/modules/Math/math_module.c:1.5 Rev: src/modules/Mird/mird_glue.c:1.4 Rev: src/modules/Msql/msqlmod.c:1.14 Rev: src/modules/Mysql/mysql.c:1.35 Rev: src/modules/Odbc/odbc.c:1.19 Rev: src/modules/Odbc/odbc_result.c:1.19 Rev: src/modules/Oracle/oracle.c:1.44 Rev: src/modules/Parser/html.c:1.93 Rev: src/modules/Parser/parser.c:1.8 Rev: src/modules/Perl/perlmod.c:1.18 Rev: src/modules/Pipe/pipe.c:1.37 Rev: src/modules/Postgres/pgresult.c:1.13 Rev: src/modules/Postgres/postgres.c:1.18 Rev: src/modules/Regexp/glue.c:1.18 Rev: src/modules/Regexp/pike_regexp.c:1.14 Rev: src/modules/SANE/.cvsignore:1.2 Rev: src/modules/SANE/sane.c:1.6 Rev: src/modules/Yp/yp.c:1.18 Rev: src/modules/_Charset/charsetmod.c:1.20 Rev: src/modules/_Charset/iso2022.c:1.16 Rev: src/modules/_Crypto/arcfour.c:1.11 Rev: src/modules/_Crypto/cast.c:1.7 Rev: src/modules/_Crypto/cbc.c:1.16 Rev: src/modules/_Crypto/crypto.c:1.33 Rev: src/modules/_Crypto/des.c:1.16 Rev: src/modules/_Crypto/idea.c:1.14 Rev: src/modules/_Crypto/invert.c:1.9 Rev: src/modules/_Crypto/md5.c:1.13 Rev: src/modules/_Crypto/nt.c:1.3 Rev: src/modules/_Crypto/pipe.c:1.17 Rev: src/modules/_Crypto/rsa.c:1.22 Rev: src/modules/_Crypto/sha.c:1.16 Rev: src/modules/_Image_JPEG/image_jpeg.c:1.30 Rev: src/modules/_Image_TIFF/image_tiff.c:1.15 Rev: src/modules/_Image_TTF/image_ttf.c:1.31 Rev: src/modules/_Image_XFace/image_xface.c:1.9 Rev: src/modules/dynamic_module_makefile.in:1.67 Rev: src/modules/spider/discdate.c:1.7 Rev: src/modules/spider/spider.c:1.94 Rev: src/modules/spider/stardate.c:1.9 Rev: src/modules/spider/streamed_parser.c:1.12 Rev: src/modules/spider/xml.c:1.23 Rev: src/modules/sybase/.cvsignore:1.2 Rev: src/modules/sybase/sybase.c:1.4 Rev: src/modules/system/configure.in:1.35 Rev: src/post_modules/GL/auto.c.in:1.14 Rev: src/post_modules/GL/top.c:1.12 Rev: src/post_modules/GLUT/auto.c.in:1.2 Rev: src/post_modules/GLUT/top.c:1.3 Rev: src/post_modules/GTK/dummy.c:1.2 Rev: src/post_modules/GTK/pgtk.h:1.16 --- NT/tools/ar | 8 +- NT/tools/lib.pike | 49 ++- NT/tools/rntcl | 3 +- bin/fake_dynamic_load.pike | 408 ++++++++++++++++++++++++ bin/fixdepends.sh | 2 +- bin/install.pike | 10 +- bin/precompile.pike | 2 +- lib/modules/Parser.pmod/C.pmod | 7 +- src/modules/CommonLog/clf.c | 9 +- src/modules/Gdbm/gdbmmod.c | 9 +- src/modules/Gettext/gettext.c | 9 +- src/modules/Gmp/mpz_glue.c | 6 +- src/modules/Gmp/my_mpz_xor.c | 7 +- src/modules/Gz/zlibmod.c | 5 +- src/modules/HTTPLoop/accept_and_parse.c | 3 + src/modules/HTTPLoop/cache.c | 3 + src/modules/HTTPLoop/configure.in | 9 +- src/modules/HTTPLoop/filesystem.c | 2 + src/modules/HTTPLoop/log.c | 3 + src/modules/HTTPLoop/requestobject.c | 6 +- src/modules/HTTPLoop/timeout.c | 3 + src/modules/HTTPLoop/util.c | 2 + src/modules/Image/blit.c | 7 +- src/modules/Image/colors.c | 7 +- src/modules/Image/colortable.c | 10 +- src/modules/Image/configure.in | 9 +- src/modules/Image/dct.c | 7 +- src/modules/Image/encodings/_xpm.c | 5 +- src/modules/Image/encodings/any.c | 9 +- src/modules/Image/encodings/avs.c | 10 +- src/modules/Image/encodings/bmp.c | 11 +- src/modules/Image/encodings/gd.c | 5 +- src/modules/Image/encodings/gif.c | 12 +- src/modules/Image/encodings/gif_lzw.c | 5 +- src/modules/Image/encodings/hrz.c | 5 +- src/modules/Image/encodings/iff.c | 6 +- src/modules/Image/encodings/ilbm.c | 9 +- src/modules/Image/encodings/pcx.c | 5 +- src/modules/Image/encodings/png.c | 5 +- src/modules/Image/encodings/pnm.c | 12 +- src/modules/Image/encodings/psd.c | 26 +- src/modules/Image/encodings/pvr.c | 5 +- src/modules/Image/encodings/ras.c | 9 +- src/modules/Image/encodings/tga.c | 8 +- src/modules/Image/encodings/tim.c | 6 +- src/modules/Image/encodings/wbf.c | 16 +- src/modules/Image/encodings/x.c | 10 +- src/modules/Image/encodings/xbm.c | 6 +- src/modules/Image/encodings/xcf.c | 22 +- src/modules/Image/encodings/xwd.c | 14 +- src/modules/Image/font.c | 7 +- src/modules/Image/image.c | 10 +- src/modules/Image/image_module.c | 6 +- src/modules/Image/layers.c | 6 +- src/modules/Image/matrix.c | 7 +- src/modules/Image/operator.c | 7 +- src/modules/Image/orient.c | 7 +- src/modules/Image/pattern.c | 7 +- src/modules/Image/poly.c | 7 +- src/modules/Image/polyfill.c | 7 +- src/modules/Image/search.c | 3 + src/modules/Java/jvm.c | 6 +- src/modules/MIME/mime.c | 6 +- src/modules/Math/math_matrix.c | 5 +- src/modules/Math/math_module.c | 5 +- src/modules/Mird/mird_glue.c | 2 + src/modules/Msql/msqlmod.c | 5 +- src/modules/Mysql/mysql.c | 8 +- src/modules/Odbc/odbc.c | 7 +- src/modules/Odbc/odbc_result.c | 7 +- src/modules/Oracle/oracle.c | 7 +- src/modules/Parser/html.c | 3 + src/modules/Parser/parser.c | 5 +- src/modules/Perl/perlmod.c | 5 +- src/modules/Pipe/pipe.c | 6 +- src/modules/Postgres/pgresult.c | 8 +- src/modules/Postgres/postgres.c | 6 +- src/modules/Regexp/glue.c | 5 +- src/modules/Regexp/pike_regexp.c | 5 +- src/modules/SANE/.cvsignore | 1 + src/modules/SANE/.gitignore | 1 + src/modules/SANE/sane.c | 8 +- src/modules/Yp/yp.c | 6 +- src/modules/_Charset/charsetmod.c | 5 +- src/modules/_Charset/iso2022.c | 4 +- src/modules/_Crypto/arcfour.c | 9 +- src/modules/_Crypto/cast.c | 6 +- src/modules/_Crypto/cbc.c | 6 +- src/modules/_Crypto/crypto.c | 9 +- src/modules/_Crypto/des.c | 5 +- src/modules/_Crypto/idea.c | 5 +- src/modules/_Crypto/invert.c | 5 +- src/modules/_Crypto/md5.c | 5 +- src/modules/_Crypto/nt.c | 4 +- src/modules/_Crypto/pipe.c | 5 +- src/modules/_Crypto/rsa.c | 7 +- src/modules/_Crypto/sha.c | 7 +- src/modules/_Image_JPEG/image_jpeg.c | 9 +- src/modules/_Image_TIFF/image_tiff.c | 17 +- src/modules/_Image_TTF/image_ttf.c | 9 +- src/modules/_Image_XFace/image_xface.c | 5 +- src/modules/dynamic_module_makefile.in | 4 +- src/modules/spider/discdate.c | 5 +- src/modules/spider/spider.c | 7 +- src/modules/spider/stardate.c | 7 +- src/modules/spider/streamed_parser.c | 7 +- src/modules/spider/xml.c | 3 + src/modules/sybase/.cvsignore | 10 + src/modules/sybase/.gitignore | 10 + src/modules/sybase/sybase.c | 7 +- src/modules/system/configure.in | 8 +- src/post_modules/GL/auto.c.in | 6 +- src/post_modules/GL/top.c | 5 +- src/post_modules/GLUT/auto.c.in | 6 +- src/post_modules/GLUT/top.c | 6 +- src/post_modules/GTK/dummy.c | 4 +- src/post_modules/GTK/pgtk.h | 2 + 117 files changed, 1009 insertions(+), 227 deletions(-) create mode 100755 bin/fake_dynamic_load.pike diff --git a/NT/tools/ar b/NT/tools/ar index 95c9b09b93..a0a3eac7db 100755 --- a/NT/tools/ar +++ b/NT/tools/ar @@ -13,8 +13,8 @@ shift OUTPUT=$1 shift -case "$CC" in - *rntcl|*rntecl) +case "`echo $CC`" in + *rntcl*|*rntecl*) case "E$OPTIONS" in *x*) ofixed="`fixpath $OUTPUT`" @@ -43,7 +43,7 @@ case "$CC" in esac ;; - *rntcc) + *rntcc*) XOPTS="-b -c" @@ -108,7 +108,7 @@ case "$CC" in ;; *) - echo Unknown C compiler: $CC + echo "Unknown C compiler: \"$CC\"" exit 1 ;; esac diff --git a/NT/tools/lib.pike b/NT/tools/lib.pike index c5dae94b75..5355af3ff0 100644 --- a/NT/tools/lib.pike +++ b/NT/tools/lib.pike @@ -206,6 +206,9 @@ int silent_do_cmd(string *cmd, mixed|void filter, int|void silent) object rl=Stdio.Readline(); string prompt=""; + array from_handler= ({"\r\n","\n\r","\n"}); + array to_handler= ({"\n\r","\n\r","\n\r"}); + string read() { string tmp=rl->read(); @@ -219,16 +222,42 @@ int silent_do_cmd(string *cmd, mixed|void filter, int|void silent) int write(string s) { - s=prompt+s-"\r"; - array lines=s/"\n"; - rl->write(lines[..sizeof(s)-2]*"\n"); - rl->set_prompt(prompt=lines[-1]); + /* This provides some very basic terminal emulation */ + /* We need to understand \r, \n, and \b */ +// werror("%O\n",s); + s=replace(prompt+s,from_handler,to_handler); + + array tmp=s/"/b"; + + array lines=s/"\r"; + foreach(lines, string l) + { + if(strlen(l) && l[-1]=='\n') + { + rl->write(l); + prompt=""; + }else{ + prompt=l; + } + } + + rl->set_prompt(prompt); return strlen(s); } void create() { rl->enable_history(512); + for(int e=0;e<256;e++) + { + switch(e) + { + case '\n': case '\r': break; + default: + from_handler+=({ sprintf("%c\b",e) }); + to_handler+=({ sprintf("") }); + } + } } }; @@ -252,13 +281,19 @@ int silent_do_cmd(string *cmd, mixed|void filter, int|void silent) thread_create(lambda(object f) { int killed; + int last_killed; void killme() { - if(!killed) + if(last_killed == time()) return; + last_killed=time(); + werror("\r\n** Interupted\r\n"); + if(!killed || killed+5 > time()) { - werror("\r\n** Interupted\r\n"); f->write_oob("x"); - killed=1; + if(!killed) + killed=time(); + }else{ + exit(1); } }; diff --git a/NT/tools/rntcl b/NT/tools/rntcl index be80a032f5..656894ae99 100755 --- a/NT/tools/rntcl +++ b/NT/tools/rntcl @@ -90,6 +90,7 @@ int main(int argc, string *argv) switch(option[1]) { case "hare": + case "hared": share=1; target="dll"; break; @@ -220,7 +221,7 @@ int main(int argc, string *argv) else output=remove_ext(argv[1])+".dll"; -// cflags+=({"-MD" + (debug?"d":"") }); + cflags+=({"-MD" + (debug?"d":""), "-LD" + (debug?"d":"")}); wantfile=output; break; diff --git a/bin/fake_dynamic_load.pike b/bin/fake_dynamic_load.pike new file mode 100755 index 0000000000..af47c8f8f1 --- /dev/null +++ b/bin/fake_dynamic_load.pike @@ -0,0 +1,408 @@ +#!/usr/local/bin/pike + +#define PC Parser.C + +#ifdef OLD +import "."; +#define PC .C +#endif + +string strip(string s) +{ + array(string) tmp=s/"."; + switch(tmp[-1]) + { + case "protos": + case "pp": + case "pph": + case "h": + case "c": + case "cmod": + tmp[-1]="pp"; + s=tmp*"."; + } + s=replace(s,"_t.","."); /* magic */ + s=replace(s,"\\\\","/"); + s=basename(lower_case(s)); + return s; +} + +string low_strip_other_files(string data, string s) +{ + if(!data) + { + werror("File %s missing?\n",s); + return 0; + } + + data-="\r"; + array tmp=data/"\n#"; + string ret=tmp[0]; + string cf=s; + int cl=1; + + s=strip(s); + foreach(tmp[1..], string x) + { + string file; + if(sscanf(x,"line %*d \"%s\"", file) || + sscanf(data," %*d \"%s\"", file)) + if(file) cf=strip(file); + + + if(cf == s) ret+="#"+x; + } + return ret; +} + +string my_read_file(string s) +{ + if(getenv("SRCDIR")) + { + string tmp=combine_path(getenv("SRCDIR"),s); + if(Stdio.file_size(tmp) != -1) s=tmp; + } + return Stdio.read_file(s); +} + + +array flatten(array a) +{ + array ret=({}); + foreach(a, a) ret+=arrayp(a)?flatten(a):({a}); + return ret; +} + +string arg(array x, int num) +{ + if( sizeof(x) <= ( num >= 0 ? num : ~num )) return ""; + return (string) ( arrayp(x[num]) ? x[num][0] : x[num] ); +} + +array(string) fixarg(array s) +{ +// werror("%O\n",s); + if(sizeof(s)>1) + { + switch(arg(s,-1)) + { + case "void": + case "int": + case "char": + case "unsigned": + case "*": + case "short": + case "long": + case "float": + case "double": + case "...": + case "(": + break; + + default: + switch(arg(s,-2)) + { + case "union": + case "enum": + case "struct": + case "const": + case "register": + break; + + default: + s=s[..sizeof(s)-2]; + } + } + } + + return flatten(s); +} + +string implode(array(string) s) +{ + string ret=" "; + foreach(flatten(s), mixed s) + { + switch(ret[-1]) + { + case 'a'..'z': + case 'A'..'Z': + case '_': + case '0'..'9': + switch(((string)s)[0]) + { + case 'a'..'z': + case 'A'..'Z': + case '_': + case '0'..'9': + ret+=" "; + } + } + ret+=(string)s; + } + return ret[1..]; +} + + +array classify(array s) +{ +// werror("%O\n",s); +// werror("Classifying.."); + array data=({}); + s=s/({"PMOD_PROTO"}) * ({ "PMOD_EXPORT","PPROTO" }); +// werror("CLASSIFY %d\n",sizeof(s/ ({"PMOD_EXPORT"}))); + foreach((s/ ({"PMOD_EXPORT"}))[1..], array expr) + { + int a; + int proto=0; + int var=1; + + if(expr[0]=="PPROTO") + { + expr=expr[1..]; + proto=1; + } + + for(a=0;a<sizeof(expr);a++) + { + if(arrayp(expr[a])) + { + if(sizeof(expr[a])) + { + switch((string)(expr[a][0])) + { + default: continue; + case "(": var=0;continue; + case "{": break; + } + break; + } + }else{ + switch((string) expr[a]) + { + default: continue; + case ";": if(!proto && !var) a=0; + case "=": + case "__attribute__": break; + } + break; + } + } + expr=expr[..a-1]; + if(!sizeof(expr)) continue; +// werror("Considering %O\n",expr[0..4]); + while(1) + { +// werror("FN: %O\n",expr); + switch((string)expr[0]) + { + case "extern": + expr=expr[1..]; + continue; + + break; + + case "typedef": + case "typdef": + break; /* ignored */ + + case "struct": + case "union": + case "enum": +// werror("%O\n",expr); + if(sizeof(expr) <= 2) break; /* Forward decl */ + default: +// werror(" %O\n",expr); + int ptr=sizeof(expr)-1; + while(arrayp(expr[ptr]) && expr[ptr][0]=='[') ptr--; + + if(arrayp(expr[ptr])) + { + if("(" != (string) (expr[ptr][0]) ) break; /* Ignore structs and unions */ + +// werror("GURKA!\n"); + array args=map(expr[ptr][1..sizeof(expr[ptr])-2]/({","}),fixarg); + string rettype=implode(expr[..sizeof(expr)-3]); +// werror("%O\n",expr); + mixed name=expr[-2]; + string location; + if(arrayp(name)) + { + location=name[0]->file+":"+name[0]->line; + name=PC.simple_reconstitute(name); + }else{ + location=name->file+":"+name->line; + name=(string)name; + } + data+=({ ([ + "class": "function", + "rettype": rettype, + "location":location, + "name": name, + "args": args, + "post_type":implode(expr[ptr+1..]), + "ptrtype":sprintf("%s(*)(%s)",rettype,implode(args*({","}))), + "proto":sprintf("%s %s(%s)",rettype,name,implode(args*({","}))), + ]) }); + }else{ +// werror("FNORD\n"); + string type=implode(expr[..sizeof(expr)-2]); + data+=({ ([ + "arg_type":"", + "post_type":implode(expr[ptr+1..]), + "class": "variable", + "ptrtype": type+"*", + "type": type, + "location":sprintf("%s:%d",expr[ptr]->file||"",expr[ptr]->line), + "name": expr[ptr], + "proto":implode(expr), + ]) }); + } + } + + break; + } + + } + return data; +} + +array prototypes=({}); + +void low_process_file(mixed data, string file) +{ + if(mixed err=catch { + data=low_strip_other_files(data,file); + if(!data || !sizeof(data)) return; + data=PC.split(data); + data=PC.tokenize(data); + if(!data || !sizeof(data)) return; + data=PC.hide_whitespaces(data); + data=PC.strip_line_statements(data); + array data=PC.group(data); + if(sizeof(data) && strlen( (string) (data[0]) )) + { + switch(((string)data[0])[0] ) + { + case ' ': case '\n': case '\t': case '\14': case '\r': + data=data[1..]; + } + } + data=classify(data); + prototypes+=data; + }) throw(err); +// werror("%s Done\n",file); +} + +void process_file(string file) +{ +// werror("Processing %s\n",file); + low_process_file(my_read_file(file), file); +} + +int main(int argc, string *argv) +{ + + int protos_only; + int run_cpp; + int num_threads=1; + /* Hmm, threaded operation doesn't seem to work, maybe + * my windoze machine needs more memory? + */ + + foreach(Getopt.find_all_options(argv,aggregate( + ({"protos",Getopt.NO_ARG,({"--protos"})}), + ({"run_cpp",Getopt.NO_ARG,({"--cpp"})}), + ({"threads",Getopt.HAS_ARG,({"--threads"})}), + ),1),array opt) + { + switch(opt[0]) + { + case "protos": protos_only++; break; + case "run_cpp": run_cpp++; break; + case "threads": num_threads=(int)opt[1]; break; + } + } + + argv=Getopt.get_args(argv,1); + + if(run_cpp) + { + object f=Stdio.File(); + object p=f->pipe(Stdio.PROP_IPC); + object proc=Process.create_process(argv[1..], (["stdout":p])); + + destruct(p); + string data=f->read(0x7fffffff); + if(int x=proc->wait()) + { + werror("CPP failed with error code %d\n",x); + exit(1); + } + low_process_file(data, argv[-1]); + }else{ + +#if constant(thread_create) + if(num_threads >1) + { + werror("Using %d threads\n",num_threads); + Thread.Fifo fifo=Thread.Fifo(); + void worker() + { + while(string f=fifo->read()) process_file(f); + }; + array threads=allocate(num_threads, thread_create)(worker); + foreach(argv[1..], string file) fifo->write(file); + foreach(threads, mixed t) fifo->write(0); + threads->wait(); + }else +#endif + foreach(argv[1..], string file) + process_file(file); + } + + + prototypes=values(mkmapping((array(string))(prototypes->name),prototypes)); + sort((array(string))(prototypes->name),prototypes); + + if(protos_only) + { + foreach(prototypes, mixed expr) + write("PMOD_PROTO %s;\n",expr->proto); + werror("[ %d symbol%s exported ]\n", sizeof(prototypes),sizeof(prototypes)==1?"":"s"); + exit(0); + }else{ + string ret="/* Fake prototypes */\n"; + foreach(prototypes, mixed expr) + ret+=sprintf("extern int %s;\n",expr->name); + ret+="\nvoid *PikeSymbol[]= {\n"; + foreach(prototypes, mixed expr) + ret+=sprintf(" (void *)& %s,\n",expr->name,expr->name); + ret+="0 };\n\n"; + + /* Fixme: touch module_magic.h if we need to + * recompile all the modules. + */ + + Stdio.write_file("export_functions.c",ret); + + ret="PMOD_EXPORT extern void **PikeSymbol;\n"; + int num=0; + foreach(prototypes, mixed expr) + { + ret+=sprintf("/* %s */\n#define %s (*(%s)(PikeSymbol[%d]))\n", + expr->location || "", + expr->name, + expr->ptrtype, + num++); + + if(expr->post_type!="") + werror("NOSUPP: %s %s %s\n",expr->type,expr->name,expr->post_type); + } + + Stdio.stdout->write(ret); + + werror("[ %d symbol%s exported ]\n", sizeof(prototypes),sizeof(prototypes)==1?"":"s"); + if(!sizeof(prototypes)) exit(1); + } +} diff --git a/bin/fixdepends.sh b/bin/fixdepends.sh index 40b923212a..2308a7bb66 100755 --- a/bin/fixdepends.sh +++ b/bin/fixdepends.sh @@ -1,6 +1,6 @@ #!/bin/sh -sed -e "s@ $1/\([-a-zA-Z0-9.,_]*\)@ \$(SRCDIR)/\1@g" >$1/dependencies +sed -e "s@ $1/\([-a-zA-Z0-9.,_]*\)@ \$(SRCDIR)/\1@g" | sed 's/^\([-a-zA-Z0-9.,_]*\)\.o: /\1.o \1.protos: /g' >$1/dependencies #sed -e "s@/./@/@g #s@$1/\([-a-zA-Z0-9.,_]*\)@\$(SRCDIR)/\1@g" >$1/dependencies diff --git a/bin/install.pike b/bin/install.pike index 0abd5d1273..d50d142b5e 100644 --- a/bin/install.pike +++ b/bin/install.pike @@ -135,10 +135,14 @@ void status_clear() } } -int mkdirhier(string dir) + +mapping already_created=([]); +int mkdirhier(string orig_dir) { int tomove; if(export) return 1; + string dir=orig_dir; + if(already_created[orig_dir]) return 1; if(dir=="" || (strlen(dir)==2 && dir[-1]==':')) return 1; dir=fakeroot(dir); @@ -149,7 +153,7 @@ int mkdirhier(string dir) if(s) { if(s[1]<0) - return 1; + return already_created[orig_dir]=1; if(glob("*.pmod",dir)) { @@ -174,7 +178,7 @@ int mkdirhier(string dir) if(!mv(dir+".tmp",dir+"/module.pmod")) fail("mv(%s,%s)",dir+".tmp",dir+"/module.pmod"); - return 1; + return already_created[orig_dir]=1; } int compare_files(string a,string b) diff --git a/bin/precompile.pike b/bin/precompile.pike index 7d7781e545..363bc4b3fc 100644 --- a/bin/precompile.pike +++ b/bin/precompile.pike @@ -460,7 +460,7 @@ array convert(array x, string base) ret+=({ sprintf("#define f_%s_defined\n",name), - sprintf("void f_%s(INT32 args) ",name), + sprintf("PMOD_EXPORT void f_%s(INT32 args) ",name), "{","\n", }); diff --git a/lib/modules/Parser.pmod/C.pmod b/lib/modules/Parser.pmod/C.pmod index afbd72d335..13064efabb 100644 --- a/lib/modules/Parser.pmod/C.pmod +++ b/lib/modules/Parser.pmod/C.pmod @@ -85,12 +85,15 @@ array(string) split(string data) break; default: - werror("Unknown token %O\n",data[pos..pos+5]); + werror("%O\n",ret); + werror("Unknown token %O\n",data[pos..pos+20]); exit(1); case '`': while(data[pos]=='`') data[pos]++; + case '\\': pos++; continue; /* IGNORED */ + case '/': case '{': case '}': case '[': case ']': @@ -156,7 +159,7 @@ array(string) split(string data) case '\'': pos++; if(data[pos]=='\\') pos++; - pos=search(data, "'", pos)+1; + pos=search(data, "'", pos+1)+1; break; case '"': diff --git a/src/modules/CommonLog/clf.c b/src/modules/CommonLog/clf.c index 8f501d3bf0..1484cfbecd 100644 --- a/src/modules/CommonLog/clf.c +++ b/src/modules/CommonLog/clf.c @@ -1,6 +1,6 @@ - +/* MUST BE FIRST */ #include "global.h" -RCSID("$Id: clf.c,v 1.2 2000/03/27 00:04:48 grubba Exp $"); +RCSID("$Id: clf.c,v 1.3 2000/07/28 07:11:47 hubbe Exp $"); #include "fdlib.h" #include "stralloc.h" #include "pike_macros.h" @@ -15,12 +15,13 @@ RCSID("$Id: clf.c,v 1.2 2000/03/27 00:04:48 grubba Exp $"); #include <stdio.h> #include <fcntl.h> +/* MUST BE LAST */ +#include "module_magic.h" + /** Forward declarations of functions implementing Pike functions **/ static void f_read_clf( INT32 args ); -extern int fd_from_object(struct object *o); - /** Global tables **/ diff --git a/src/modules/Gdbm/gdbmmod.c b/src/modules/Gdbm/gdbmmod.c index d1bd203418..45a4608b00 100644 --- a/src/modules/Gdbm/gdbmmod.c +++ b/src/modules/Gdbm/gdbmmod.c @@ -4,14 +4,12 @@ ||| See the files COPYING and DISCLAIMER for more information. \*/ #include "global.h" -RCSID("$Id: gdbmmod.c,v 1.10 2000/07/07 14:02:12 grubba Exp $"); +RCSID("$Id: gdbmmod.c,v 1.11 2000/07/28 07:11:52 hubbe Exp $"); #include "gdbm_machine.h" #include "threads.h" /* Todo: make sure only one thread accesses the same gdbmmod */ -#if defined(HAVE_GDBM_H) && defined(HAVE_LIBGDBM) - #include "interpret.h" #include "svalue.h" #include "stralloc.h" @@ -19,6 +17,11 @@ RCSID("$Id: gdbmmod.c,v 1.10 2000/07/07 14:02:12 grubba Exp $"); #include "object.h" #include "pike_macros.h" +/* THIS MUST BE INCLUDED LAST */ +#include "module_magic.h" + +#if defined(HAVE_GDBM_H) && defined(HAVE_LIBGDBM) + #include <gdbm.h> #ifdef _REENTRANT diff --git a/src/modules/Gettext/gettext.c b/src/modules/Gettext/gettext.c index 2a1474aa10..d3f1f61e4a 100644 --- a/src/modules/Gettext/gettext.c +++ b/src/modules/Gettext/gettext.c @@ -20,7 +20,10 @@ #include "mapping.h" #include "module_support.h" -RCSID("$Id: gettext.c,v 1.3 2000/02/29 20:41:13 neotron Exp $"); +/* This must be included last */ +#include "module_magic.h" + +RCSID("$Id: gettext.c,v 1.4 2000/07/28 07:12:00 hubbe Exp $"); /* **! module Locale.Gettext @@ -28,7 +31,7 @@ RCSID("$Id: gettext.c,v 1.3 2000/02/29 20:41:13 neotron Exp $"); **! This module enables access to localization functions from within Pike. **! **! note -**! $Id: gettext.c,v 1.3 2000/02/29 20:41:13 neotron Exp $ +**! $Id: gettext.c,v 1.4 2000/07/28 07:12:00 hubbe Exp $ */ /******************** PUBLIC FUNCTIONS BELOW THIS LINE */ @@ -447,6 +450,8 @@ void pike_module_exit(void) } #else +#include "module_magic.h" + void pike_module_init(void) {} void pike_module_exit(void) {} diff --git a/src/modules/Gmp/mpz_glue.c b/src/modules/Gmp/mpz_glue.c index a6043800e4..b6135641fb 100644 --- a/src/modules/Gmp/mpz_glue.c +++ b/src/modules/Gmp/mpz_glue.c @@ -4,7 +4,7 @@ ||| See the files COPYING and DISCLAIMER for more information. \*/ #include "global.h" -RCSID("$Id: mpz_glue.c,v 1.78 2000/06/24 00:48:26 hubbe Exp $"); +RCSID("$Id: mpz_glue.c,v 1.79 2000/07/28 07:12:07 hubbe Exp $"); #include "gmp_machine.h" #if defined(HAVE_GMP2_GMP_H) && defined(HAVE_LIBGMP2) @@ -37,6 +37,9 @@ RCSID("$Id: mpz_glue.c,v 1.78 2000/06/24 00:48:26 hubbe Exp $"); #include <limits.h> +/* This must be included last! */ +#include "module_magic.h" + #ifdef _MSC_VER /* No random()... provide one for gmp * This should possibly be a configure test @@ -189,7 +192,6 @@ static void mpzmod_create(INT32 args) { #ifdef AUTO_BIGNUM /* Alert bignum.c that we have been loaded /Hubbe */ - extern int gmp_library_loaded; if(THIS_PROGRAM == bignum_program) gmp_library_loaded=1; #endif diff --git a/src/modules/Gmp/my_mpz_xor.c b/src/modules/Gmp/my_mpz_xor.c index 86ab196536..14e13dbd7f 100644 --- a/src/modules/Gmp/my_mpz_xor.c +++ b/src/modules/Gmp/my_mpz_xor.c @@ -1,11 +1,11 @@ -/* $Id: my_mpz_xor.c,v 1.2 1999/11/09 17:01:50 mast Exp $ +/* $Id: my_mpz_xor.c,v 1.3 2000/07/28 07:12:07 hubbe Exp $ * * since xor isn't implemented by gmp (for some odd reason) */ #include "global.h" -RCSID("$Id: my_mpz_xor.c,v 1.2 1999/11/09 17:01:50 mast Exp $"); +RCSID("$Id: my_mpz_xor.c,v 1.3 2000/07/28 07:12:07 hubbe Exp $"); #include "gmp_machine.h" @@ -21,6 +21,9 @@ RCSID("$Id: my_mpz_xor.c,v 1.2 1999/11/09 17:01:50 mast Exp $"); #include "my_gmp.h" +/* This must be included last! */ +#include "module_magic.h" + void my_mpz_xor (mpz_ptr res, mpz_srcptr a, mpz_srcptr b) { /* (a&~b)|(~a&b) for now */ diff --git a/src/modules/Gz/zlibmod.c b/src/modules/Gz/zlibmod.c index cb4cf1ef93..ff6c93d574 100644 --- a/src/modules/Gz/zlibmod.c +++ b/src/modules/Gz/zlibmod.c @@ -5,7 +5,7 @@ \*/ /**/ #include "global.h" -RCSID("$Id: zlibmod.c,v 1.28 2000/07/07 14:01:59 grubba Exp $"); +RCSID("$Id: zlibmod.c,v 1.29 2000/07/28 07:12:19 hubbe Exp $"); #include "zlib_machine.h" @@ -29,6 +29,9 @@ RCSID("$Id: zlibmod.c,v 1.28 2000/07/07 14:01:59 grubba Exp $"); #include <zlib.h> +/* This must be included last! */ +#include "module_magic.h" + struct zipper { struct z_stream_s gz; diff --git a/src/modules/HTTPLoop/accept_and_parse.c b/src/modules/HTTPLoop/accept_and_parse.c index 9619b12152..115d0ea723 100644 --- a/src/modules/HTTPLoop/accept_and_parse.c +++ b/src/modules/HTTPLoop/accept_and_parse.c @@ -50,6 +50,9 @@ #include "util.h" #include "timeout.h" +/* This must be included last! */ +#include "module_magic.h" + static struct callback *my_callback; struct program *request_program; struct program *c_request_program; diff --git a/src/modules/HTTPLoop/cache.c b/src/modules/HTTPLoop/cache.c index cfe12688d1..ef61915946 100644 --- a/src/modules/HTTPLoop/cache.c +++ b/src/modules/HTTPLoop/cache.c @@ -26,6 +26,9 @@ #include "util.h" #include "backend.h" +/* This must be included last! */ +#include "module_magic.h" + struct cache *first_cache; static struct pike_string *free_queue[1024]; diff --git a/src/modules/HTTPLoop/configure.in b/src/modules/HTTPLoop/configure.in index c805bc754a..ce1e0f29e9 100644 --- a/src/modules/HTTPLoop/configure.in +++ b/src/modules/HTTPLoop/configure.in @@ -1,4 +1,4 @@ -# $Id: configure.in,v 1.4 2000/03/26 14:46:30 grubba Exp $ +# $Id: configure.in,v 1.5 2000/07/28 07:12:28 hubbe Exp $ AC_INIT(accept_and_parse.c) AC_CONFIG_HEADER(config.h) @@ -183,4 +183,11 @@ int sendfile(int out, int in, int *off, int size) fi fi +if test x"$pike_cv_sys_os" = xWindows_NT ; then + # FIXME: These look suspiciouly much like 32bit versions. + # We probably want to use 64bit versions on IA64. + LDFLAGS="-lws2_32 $LDFLAGS" +fi + + AC_OUTPUT(Makefile,echo FOO >stamp-h ) diff --git a/src/modules/HTTPLoop/filesystem.c b/src/modules/HTTPLoop/filesystem.c index cefa4d81ea..6d1b9e4415 100644 --- a/src/modules/HTTPLoop/filesystem.c +++ b/src/modules/HTTPLoop/filesystem.c @@ -26,6 +26,8 @@ #include "cache.h" #include "util.h" +/* This must be included last! */ +#include "module_magic.h" struct file_ret *aap_find_file( char *s, int len, char *ho, int hlen, diff --git a/src/modules/HTTPLoop/log.c b/src/modules/HTTPLoop/log.c index cec871becd..f7669dded8 100644 --- a/src/modules/HTTPLoop/log.c +++ b/src/modules/HTTPLoop/log.c @@ -39,6 +39,9 @@ #include "requestobject.h" #include "util.h" +/* This must be included last! */ +#include "module_magic.h" + int num_log_entries; void free_log_entry( struct log_entry *le ) { diff --git a/src/modules/HTTPLoop/requestobject.c b/src/modules/HTTPLoop/requestobject.c index 238cb96858..443d892649 100644 --- a/src/modules/HTTPLoop/requestobject.c +++ b/src/modules/HTTPLoop/requestobject.c @@ -1,5 +1,5 @@ /* - * $Id: requestobject.c,v 1.9 2000/07/07 14:00:55 grubba Exp $ + * $Id: requestobject.c,v 1.10 2000/07/28 07:12:28 hubbe Exp $ */ #include "global.h" @@ -41,6 +41,9 @@ #include <sys/uio.h> #endif +/* This must be included last! */ +#include "module_magic.h" + #ifdef _REENTRANT #include "accept_and_parse.h" #include "log.h" @@ -442,7 +445,6 @@ void f_aap_index_op(INT32 args) if(s == s_my_fd) { - struct object *file_make_object_from_fd(int fd, int mode, int guess); /* 0x3800 is from modules/files/file.h, * FILE_READ|FILE_WRITE|FILE_SET_CLOSE_ON_EXEC */ diff --git a/src/modules/HTTPLoop/timeout.c b/src/modules/HTTPLoop/timeout.c index 039802c02d..cbcb7c8730 100644 --- a/src/modules/HTTPLoop/timeout.c +++ b/src/modules/HTTPLoop/timeout.c @@ -39,6 +39,9 @@ #endif /* HAVE_POLL_H */ #endif /* HAVE_POLL */ +/* This must be included last! */ +#include "module_magic.h" + MUTEX_T aap_timeout_mutex; struct timeout diff --git a/src/modules/HTTPLoop/util.c b/src/modules/HTTPLoop/util.c index 7cbc294421..ab3b9b0903 100644 --- a/src/modules/HTTPLoop/util.c +++ b/src/modules/HTTPLoop/util.c @@ -22,6 +22,8 @@ #include "accept_and_parse.h" #include "util.h" +/* This must be included last! */ +#include "module_magic.h" int aap_get_time(void) { diff --git a/src/modules/Image/blit.c b/src/modules/Image/blit.c index 568059b9c0..f7c7fd40f9 100644 --- a/src/modules/Image/blit.c +++ b/src/modules/Image/blit.c @@ -1,10 +1,10 @@ -/* $Id: blit.c,v 1.42 2000/07/07 13:56:45 grubba Exp $ */ +/* $Id: blit.c,v 1.43 2000/07/28 07:12:44 hubbe Exp $ */ #include "global.h" /* **! module Image **! note -**! $Id: blit.c,v 1.42 2000/07/07 13:56:45 grubba Exp $ +**! $Id: blit.c,v 1.43 2000/07/28 07:12:44 hubbe Exp $ **! class Image */ @@ -29,6 +29,9 @@ #include "assembly.h" #endif +/* This must be included last! */ +#include "module_magic.h" + extern struct program *image_program; #ifdef THIS #undef THIS /* Needed for NT */ diff --git a/src/modules/Image/colors.c b/src/modules/Image/colors.c index 46960e00c0..beff4a0c87 100644 --- a/src/modules/Image/colors.c +++ b/src/modules/Image/colors.c @@ -1,7 +1,7 @@ /* **! module Image **! note -**! $Id: colors.c,v 1.31 2000/07/07 13:56:45 grubba Exp $ +**! $Id: colors.c,v 1.32 2000/07/28 07:12:44 hubbe Exp $ **! submodule Color **! **! This module keeps names and easy handling @@ -179,7 +179,7 @@ #include "global.h" -RCSID("$Id: colors.c,v 1.31 2000/07/07 13:56:45 grubba Exp $"); +RCSID("$Id: colors.c,v 1.32 2000/07/28 07:12:44 hubbe Exp $"); #include "image_machine.h" @@ -203,6 +203,9 @@ RCSID("$Id: colors.c,v 1.31 2000/07/07 13:56:45 grubba Exp $"); #include "image.h" #include "colortable.h" +/* This must be included last! */ +#include "module_magic.h" + static struct mapping *colors=NULL; static struct object *colortable=NULL; static struct array *colornames=NULL; diff --git a/src/modules/Image/colortable.c b/src/modules/Image/colortable.c index cb99b041b8..e6b4fdef29 100644 --- a/src/modules/Image/colortable.c +++ b/src/modules/Image/colortable.c @@ -1,11 +1,11 @@ #include "global.h" -/* $Id: colortable.c,v 1.78 2000/07/07 13:56:45 grubba Exp $ */ +/* $Id: colortable.c,v 1.79 2000/07/28 07:12:44 hubbe Exp $ */ /* **! module Image **! note -**! $Id: colortable.c,v 1.78 2000/07/07 13:56:45 grubba Exp $ +**! $Id: colortable.c,v 1.79 2000/07/28 07:12:44 hubbe Exp $ **! class Colortable **! **! This object keeps colortable information, @@ -20,7 +20,7 @@ #undef COLORTABLE_DEBUG #undef COLORTABLE_REDUCE_DEBUG -RCSID("$Id: colortable.c,v 1.78 2000/07/07 13:56:45 grubba Exp $"); +RCSID("$Id: colortable.c,v 1.79 2000/07/28 07:12:44 hubbe Exp $"); #include <math.h> /* fabs() */ @@ -45,6 +45,10 @@ RCSID("$Id: colortable.c,v 1.78 2000/07/07 13:56:45 grubba Exp $"); #include "colortable.h" #include "initstuff.h" +/* This must be included last! */ +#include "module_magic.h" + + #define WEIGHT_NEEDED (nct_weight_t)(0x10000000) #define WEIGHT_REMOVE (nct_weight_t)(0x10000001) diff --git a/src/modules/Image/configure.in b/src/modules/Image/configure.in index dccb6d69dc..53a98d0c0e 100644 --- a/src/modules/Image/configure.in +++ b/src/modules/Image/configure.in @@ -1,4 +1,4 @@ -# $Id: configure.in,v 1.14 2000/07/14 21:23:10 grubba Exp $ +# $Id: configure.in,v 1.15 2000/07/28 07:12:44 hubbe Exp $ AC_INIT(image.c) AC_CONFIG_HEADER(image_machine.h) @@ -58,6 +58,13 @@ else AC_MSG_RESULT(no) fi +if test x"$pike_cv_sys_os" = xWindows_NT ; then + # FIXME: These look suspiciouly much like 32bit versions. + # We probably want to use 64bit versions on IA64. + LDFLAGS="-lws2_32 $LDFLAGS" +fi + + AC_SUBST(RANLIB) AC_CONFIG_SUBDIRS(encodings) diff --git a/src/modules/Image/dct.c b/src/modules/Image/dct.c index e8f313056d..1f17b3d6e4 100644 --- a/src/modules/Image/dct.c +++ b/src/modules/Image/dct.c @@ -1,9 +1,9 @@ -/* $Id: dct.c,v 1.14 1999/06/18 19:19:20 mirar Exp $ */ +/* $Id: dct.c,v 1.15 2000/07/28 07:12:44 hubbe Exp $ */ /* **! module Image **! note -**! $Id: dct.c,v 1.14 1999/06/18 19:19:20 mirar Exp $ +**! $Id: dct.c,v 1.15 2000/07/28 07:12:44 hubbe Exp $ **! class Image */ @@ -24,6 +24,9 @@ #include "image.h" +/* This must be included last! */ +#include "module_magic.h" + extern struct program *image_program; #ifdef THIS #undef THIS /* Needed for NT */ diff --git a/src/modules/Image/encodings/_xpm.c b/src/modules/Image/encodings/_xpm.c index 79a75fe1b7..0ee20b17f4 100644 --- a/src/modules/Image/encodings/_xpm.c +++ b/src/modules/Image/encodings/_xpm.c @@ -1,5 +1,5 @@ #include "global.h" -RCSID("$Id: _xpm.c,v 1.11 2000/06/09 22:06:05 mast Exp $"); +RCSID("$Id: _xpm.c,v 1.12 2000/07/28 07:13:06 hubbe Exp $"); #include "image_machine.h" @@ -37,6 +37,9 @@ RCSID("$Id: _xpm.c,v 1.11 2000/06/09 22:06:05 mast Exp $"); #include "image.h" #include "colortable.h" +/* MUST BE INCLUDED LAST */ +#include "module_magic.h" + extern struct program *image_program; static int hextoint( int what ) diff --git a/src/modules/Image/encodings/any.c b/src/modules/Image/encodings/any.c index 811e307088..49f9ec0c3b 100644 --- a/src/modules/Image/encodings/any.c +++ b/src/modules/Image/encodings/any.c @@ -1,9 +1,9 @@ -/* $Id: any.c,v 1.17 2000/07/03 13:30:32 grubba Exp $ */ +/* $Id: any.c,v 1.18 2000/07/28 07:13:06 hubbe Exp $ */ /* **! module Image **! note -**! $Id: any.c,v 1.17 2000/07/03 13:30:32 grubba Exp $ +**! $Id: any.c,v 1.18 2000/07/28 07:13:06 hubbe Exp $ **! submodule ANY **! **! This method calls the other decoding methods @@ -23,7 +23,7 @@ #include <ctype.h> #include "stralloc.h" -RCSID("$Id: any.c,v 1.17 2000/07/03 13:30:32 grubba Exp $"); +RCSID("$Id: any.c,v 1.18 2000/07/28 07:13:06 hubbe Exp $"); #include "pike_macros.h" #include "operators.h" #include "builtin_functions.h" @@ -40,6 +40,9 @@ RCSID("$Id: any.c,v 1.17 2000/07/03 13:30:32 grubba Exp $"); #include "encodings.h" +/* MUST BE INCLUDED LAST */ +#include "module_magic.h" + /* **! method mapping _decode(string data) **! method object decode(string data) diff --git a/src/modules/Image/encodings/avs.c b/src/modules/Image/encodings/avs.c index 8154094aab..07975f2a84 100644 --- a/src/modules/Image/encodings/avs.c +++ b/src/modules/Image/encodings/avs.c @@ -8,7 +8,7 @@ #endif #include "stralloc.h" -RCSID("$Id: avs.c,v 1.8 2000/02/03 19:01:29 grubba Exp $"); +RCSID("$Id: avs.c,v 1.9 2000/07/28 07:13:06 hubbe Exp $"); #include "pike_macros.h" #include "object.h" #include "constants.h" @@ -17,12 +17,16 @@ RCSID("$Id: avs.c,v 1.8 2000/02/03 19:01:29 grubba Exp $"); #include "threads.h" #include "array.h" #include "error.h" - +#include "mapping.h" +#include "operators.h" #include "image.h" #include "builtin_functions.h" #include "module_support.h" +/* MUST BE INCLUDED LAST */ +#include "module_magic.h" + extern struct program *image_program; /* @@ -46,7 +50,6 @@ extern struct program *image_program; void image_avs_f__decode(INT32 args) { - extern void f_aggregate_mapping(INT32 args); struct object *io, *ao; struct pike_string *s; unsigned int c; @@ -91,7 +94,6 @@ void image_avs_f__decode(INT32 args) void image_avs_f_decode(INT32 args) { - extern void f_index(INT32 args); image_avs_f__decode(args); push_constant_text("image"); f_index(2); diff --git a/src/modules/Image/encodings/bmp.c b/src/modules/Image/encodings/bmp.c index cf54daa064..4ff2f022af 100644 --- a/src/modules/Image/encodings/bmp.c +++ b/src/modules/Image/encodings/bmp.c @@ -1,9 +1,9 @@ -/* $Id: bmp.c,v 1.21 2000/07/03 13:30:32 grubba Exp $ */ +/* $Id: bmp.c,v 1.22 2000/07/28 07:13:06 hubbe Exp $ */ /* **! module Image **! note -**! $Id: bmp.c,v 1.21 2000/07/03 13:30:32 grubba Exp $ +**! $Id: bmp.c,v 1.22 2000/07/28 07:13:06 hubbe Exp $ **! submodule BMP **! **! This submodule keeps the BMP (Windows Bitmap) @@ -22,7 +22,7 @@ #include <ctype.h> #include "stralloc.h" -RCSID("$Id: bmp.c,v 1.21 2000/07/03 13:30:32 grubba Exp $"); +RCSID("$Id: bmp.c,v 1.22 2000/07/28 07:13:06 hubbe Exp $"); #include "pike_macros.h" #include "object.h" #include "constants.h" @@ -34,7 +34,6 @@ RCSID("$Id: bmp.c,v 1.21 2000/07/03 13:30:32 grubba Exp $"); #include "error.h" #include "operators.h" - #include "image.h" #include "colortable.h" @@ -42,7 +41,9 @@ RCSID("$Id: bmp.c,v 1.21 2000/07/03 13:30:32 grubba Exp $"); #include "encodings.h" -extern void f_add(INT32 args); +/* MUST BE INCLUDED LAST */ +#include "module_magic.h" + extern struct program *image_colortable_program; extern struct program *image_program; diff --git a/src/modules/Image/encodings/gd.c b/src/modules/Image/encodings/gd.c index 929356ef71..f93c83c31c 100644 --- a/src/modules/Image/encodings/gd.c +++ b/src/modules/Image/encodings/gd.c @@ -8,7 +8,7 @@ #endif #include "stralloc.h" -RCSID("$Id: gd.c,v 1.3 1999/05/30 20:12:08 mirar Exp $"); +RCSID("$Id: gd.c,v 1.4 2000/07/28 07:13:06 hubbe Exp $"); #include "pike_macros.h" #include "object.h" #include "constants.h" @@ -24,6 +24,9 @@ RCSID("$Id: gd.c,v 1.3 1999/05/30 20:12:08 mirar Exp $"); #include "image.h" +/* MUST BE INCLUDED LAST */ +#include "module_magic.h" + extern struct program *image_program; /* diff --git a/src/modules/Image/encodings/gif.c b/src/modules/Image/encodings/gif.c index f9da94420b..10d727563d 100644 --- a/src/modules/Image/encodings/gif.c +++ b/src/modules/Image/encodings/gif.c @@ -1,9 +1,9 @@ -/* $Id: gif.c,v 1.51 2000/07/03 13:30:32 grubba Exp $ */ +/* $Id: gif.c,v 1.52 2000/07/28 07:13:06 hubbe Exp $ */ /* **! module Image **! note -**! $Id: gif.c,v 1.51 2000/07/03 13:30:32 grubba Exp $ +**! $Id: gif.c,v 1.52 2000/07/28 07:13:06 hubbe Exp $ **! submodule GIF **! **! This submodule keep the GIF encode/decode capabilities @@ -31,7 +31,7 @@ #include <ctype.h> #include "stralloc.h" -RCSID("$Id: gif.c,v 1.51 2000/07/03 13:30:32 grubba Exp $"); +RCSID("$Id: gif.c,v 1.52 2000/07/28 07:13:06 hubbe Exp $"); #include "pike_macros.h" #include "object.h" #include "constants.h" @@ -45,18 +45,20 @@ RCSID("$Id: gif.c,v 1.51 2000/07/03 13:30:32 grubba Exp $"); #include "image.h" #include "colortable.h" #include "builtin_functions.h" +#include "operators.h" #include "mapping.h" #include "gif_lzw.h" #include "encodings.h" +/* MUST BE INCLUDED LAST */ +#include "module_magic.h" + extern struct program *image_colortable_program; extern struct program *image_program; extern struct program *image_layer_program; -extern void f_add(INT32 args); - enum { GIF_ILLEGAL, diff --git a/src/modules/Image/encodings/gif_lzw.c b/src/modules/Image/encodings/gif_lzw.c index 4cd1b40023..7f98ce82e8 100644 --- a/src/modules/Image/encodings/gif_lzw.c +++ b/src/modules/Image/encodings/gif_lzw.c @@ -1,13 +1,16 @@ /* **! module Image **! note -**! $Id: gif_lzw.c,v 1.6 1999/05/30 20:11:14 mirar Exp $ +**! $Id: gif_lzw.c,v 1.7 2000/07/28 07:13:06 hubbe Exp $ */ #include "global.h" #include "image_machine.h" #include "gif_lzw.h" +/* MUST BE INCLUDED LAST */ +#include "module_magic.h" + #define DEFAULT_OUTBYTES 16384 #define STDLZWCODES 8192 diff --git a/src/modules/Image/encodings/hrz.c b/src/modules/Image/encodings/hrz.c index 2651d9f690..f836b84eeb 100644 --- a/src/modules/Image/encodings/hrz.c +++ b/src/modules/Image/encodings/hrz.c @@ -4,7 +4,7 @@ #include <ctype.h> #include "stralloc.h" -RCSID("$Id: hrz.c,v 1.4 1999/09/25 20:02:39 grubba Exp $"); +RCSID("$Id: hrz.c,v 1.5 2000/07/28 07:13:06 hubbe Exp $"); #include "pike_macros.h" #include "object.h" #include "mapping.h" @@ -21,6 +21,9 @@ RCSID("$Id: hrz.c,v 1.4 1999/09/25 20:02:39 grubba Exp $"); #include "builtin_functions.h" #include "module_support.h" +/* MUST BE INCLUDED LAST */ +#include "module_magic.h" + extern struct program *image_program; /* diff --git a/src/modules/Image/encodings/iff.c b/src/modules/Image/encodings/iff.c index 209f0f5d82..e18a6675f2 100644 --- a/src/modules/Image/encodings/iff.c +++ b/src/modules/Image/encodings/iff.c @@ -1,9 +1,9 @@ -/* $Id: iff.c,v 1.4 2000/02/03 19:01:29 grubba Exp $ */ +/* $Id: iff.c,v 1.5 2000/07/28 07:13:06 hubbe Exp $ */ #include "global.h" #include "stralloc.h" -RCSID("$Id: iff.c,v 1.4 2000/02/03 19:01:29 grubba Exp $"); +RCSID("$Id: iff.c,v 1.5 2000/07/28 07:13:06 hubbe Exp $"); #include "pike_macros.h" #include "object.h" #include "constants.h" @@ -15,6 +15,8 @@ RCSID("$Id: iff.c,v 1.4 2000/02/03 19:01:29 grubba Exp $"); #include "operators.h" #include "builtin_functions.h" +/* MUST BE INCLUDED LAST */ +#include "module_magic.h" static INT32 low_parse_iff(unsigned char *data, INT32 len, unsigned char *hdr, struct mapping *m, unsigned char *stopchunk) diff --git a/src/modules/Image/encodings/ilbm.c b/src/modules/Image/encodings/ilbm.c index d52513fb0d..dbd776c622 100644 --- a/src/modules/Image/encodings/ilbm.c +++ b/src/modules/Image/encodings/ilbm.c @@ -1,9 +1,9 @@ -/* $Id: ilbm.c,v 1.14 2000/07/03 13:30:32 grubba Exp $ */ +/* $Id: ilbm.c,v 1.15 2000/07/28 07:13:06 hubbe Exp $ */ /* **! module Image **! note -**! $Id: ilbm.c,v 1.14 2000/07/03 13:30:32 grubba Exp $ +**! $Id: ilbm.c,v 1.15 2000/07/28 07:13:06 hubbe Exp $ **! submodule ILBM **! **! This submodule keep the ILBM encode/decode capabilities @@ -14,7 +14,7 @@ #include "global.h" #include "stralloc.h" -RCSID("$Id: ilbm.c,v 1.14 2000/07/03 13:30:32 grubba Exp $"); +RCSID("$Id: ilbm.c,v 1.15 2000/07/28 07:13:06 hubbe Exp $"); #include "pike_macros.h" #include "object.h" #include "constants.h" @@ -32,6 +32,9 @@ RCSID("$Id: ilbm.c,v 1.14 2000/07/03 13:30:32 grubba Exp $"); #include "encodings.h" +/* MUST BE INCLUDED LAST */ +#include "module_magic.h" + extern struct program *image_colortable_program; extern struct program *image_program; diff --git a/src/modules/Image/encodings/pcx.c b/src/modules/Image/encodings/pcx.c index a2f10af845..e78012278f 100644 --- a/src/modules/Image/encodings/pcx.c +++ b/src/modules/Image/encodings/pcx.c @@ -1,5 +1,5 @@ #include "global.h" -RCSID("$Id: pcx.c,v 1.9 2000/02/03 19:01:29 grubba Exp $"); +RCSID("$Id: pcx.c,v 1.10 2000/07/28 07:13:06 hubbe Exp $"); #include "image_machine.h" @@ -24,6 +24,9 @@ RCSID("$Id: pcx.c,v 1.9 2000/02/03 19:01:29 grubba Exp $"); #include "image.h" #include "colortable.h" +/* MUST BE INCLUDED LAST */ +#include "module_magic.h" + extern struct program *image_colortable_program; extern struct program *image_program; diff --git a/src/modules/Image/encodings/png.c b/src/modules/Image/encodings/png.c index c2d234bff5..a103cc5163 100644 --- a/src/modules/Image/encodings/png.c +++ b/src/modules/Image/encodings/png.c @@ -1,5 +1,5 @@ #include "global.h" -RCSID("$Id: png.c,v 1.32 2000/07/03 13:30:32 grubba Exp $"); +RCSID("$Id: png.c,v 1.33 2000/07/28 07:13:06 hubbe Exp $"); #include "image_machine.h" @@ -20,6 +20,9 @@ RCSID("$Id: png.c,v 1.32 2000/07/03 13:30:32 grubba Exp $"); #include "image.h" #include "colortable.h" +/* MUST BE INCLUDED LAST */ +#include "module_magic.h" + extern struct program *image_colortable_program; extern struct program *image_program; diff --git a/src/modules/Image/encodings/pnm.c b/src/modules/Image/encodings/pnm.c index 5633cea402..04c7080f96 100644 --- a/src/modules/Image/encodings/pnm.c +++ b/src/modules/Image/encodings/pnm.c @@ -1,9 +1,9 @@ -/* $Id: pnm.c,v 1.21 2000/07/03 13:30:32 grubba Exp $ */ +/* $Id: pnm.c,v 1.22 2000/07/28 07:13:06 hubbe Exp $ */ /* **! module Image **! note -**! $Id: pnm.c,v 1.21 2000/07/03 13:30:32 grubba Exp $ +**! $Id: pnm.c,v 1.22 2000/07/28 07:13:06 hubbe Exp $ **! submodule PNM **! **! This submodule keeps the PNM encode/decode capabilities @@ -49,7 +49,7 @@ #include <ctype.h> #include "stralloc.h" -RCSID("$Id: pnm.c,v 1.21 2000/07/03 13:30:32 grubba Exp $"); +RCSID("$Id: pnm.c,v 1.22 2000/07/28 07:13:06 hubbe Exp $"); #include "pike_macros.h" #include "object.h" #include "constants.h" @@ -58,6 +58,7 @@ RCSID("$Id: pnm.c,v 1.21 2000/07/03 13:30:32 grubba Exp $"); #include "threads.h" #include "array.h" #include "error.h" +#include "operators.h" #include "image.h" @@ -65,6 +66,9 @@ RCSID("$Id: pnm.c,v 1.21 2000/07/03 13:30:32 grubba Exp $"); #include "encodings.h" +/* MUST BE INCLUDED LAST */ +#include "module_magic.h" + extern struct program *image_colortable_program; extern struct program *image_program; @@ -302,8 +306,6 @@ void img_pnm_encode_P1(INT32 args) /* ascii PBM */ free_string(b); } -extern void f_add(INT32 args); - void img_pnm_encode_P2(INT32 args) /* ascii PGM */ { char buf[80]; diff --git a/src/modules/Image/encodings/psd.c b/src/modules/Image/encodings/psd.c index 397e3c2e78..269d6d0c88 100644 --- a/src/modules/Image/encodings/psd.c +++ b/src/modules/Image/encodings/psd.c @@ -1,5 +1,5 @@ #include "global.h" -RCSID("$Id: psd.c,v 1.16 2000/07/07 16:24:08 grubba Exp $"); +RCSID("$Id: psd.c,v 1.17 2000/07/28 07:13:06 hubbe Exp $"); #include "image_machine.h" @@ -25,6 +25,8 @@ RCSID("$Id: psd.c,v 1.16 2000/07/07 16:24:08 grubba Exp $"); #include "image.h" #include "colortable.h" +/* MUST BE INCLUDED LAST */ +#include "module_magic.h" /* The sp macro conflicts with Solaris 2.5.1's <netinet/in.h>. */ @@ -75,7 +77,7 @@ static unsigned int read_uint( struct buffer *from ) return res; } -static int read_int( struct buffer *from ) +static int psd_read_int( struct buffer *from ) { return (int)read_uint( from ); } @@ -128,7 +130,7 @@ static char *read_data( struct buffer * from, unsigned int len ) static struct buffer read_string( struct buffer *data ) { struct buffer res; - res.len = read_int( data ); + res.len = psd_read_int( data ); res.str = (unsigned char *)read_data( data, res.len ); if(res.len > 0) res.len--; /* len includes ending \0 */ if(!res.str) @@ -210,7 +212,7 @@ static void decode_layers_and_masks( struct psd_image *dst, if(!src->len) return; - exp_offset = src->len-read_int( src ); /* size of layer region */ + exp_offset = src->len-psd_read_int( src ); /* size of layer region */ count = read_short( src ); if( count < 0 ) @@ -228,10 +230,10 @@ static void decode_layers_and_masks( struct psd_image *dst, layer->next = dst->first_layer; if(dst->first_layer) dst->first_layer->prev = layer; dst->first_layer = layer; - layer->top = read_int( src ); - layer->left = read_int( src ); - layer->bottom = read_int( src ); - layer->right = read_int( src ); + layer->top = psd_read_int( src ); + layer->left = psd_read_int( src ); + layer->bottom = psd_read_int( src ); + layer->right = psd_read_int( src ); layer->num_channels = read_short( src ); for(cnt=0; cnt<layer->num_channels; cnt++) { @@ -253,10 +255,10 @@ static void decode_layers_and_masks( struct psd_image *dst, tmp2 = read_string( &tmp ); if( tmp2.len ) { - layer->mask_top = read_int( &tmp2 ); - layer->mask_left = read_int( &tmp2 ); - layer->mask_bottom = read_int( &tmp2 ); - layer->mask_right = read_int( &tmp2 ); + layer->mask_top = psd_read_int( &tmp2 ); + layer->mask_left = psd_read_int( &tmp2 ); + layer->mask_bottom = psd_read_int( &tmp2 ); + layer->mask_right = psd_read_int( &tmp2 ); layer->mask_default_color = read_uchar( &tmp2 ); layer->mask_flags = read_uchar( &tmp2 ); } diff --git a/src/modules/Image/encodings/pvr.c b/src/modules/Image/encodings/pvr.c index 0d20d93348..7fe830f87b 100644 --- a/src/modules/Image/encodings/pvr.c +++ b/src/modules/Image/encodings/pvr.c @@ -4,7 +4,7 @@ #include <ctype.h> #include "stralloc.h" -RCSID("$Id: pvr.c,v 1.8 2000/07/03 13:30:32 grubba Exp $"); +RCSID("$Id: pvr.c,v 1.9 2000/07/28 07:13:06 hubbe Exp $"); #include "pike_macros.h" #include "object.h" #include "constants.h" @@ -24,6 +24,9 @@ RCSID("$Id: pvr.c,v 1.8 2000/07/03 13:30:32 grubba Exp $"); #include "encodings.h" +/* MUST BE INCLUDED LAST */ +#include "module_magic.h" + extern struct program *image_program; /* diff --git a/src/modules/Image/encodings/ras.c b/src/modules/Image/encodings/ras.c index 6a34e78876..f42997b66e 100644 --- a/src/modules/Image/encodings/ras.c +++ b/src/modules/Image/encodings/ras.c @@ -1,9 +1,9 @@ -/* $Id: ras.c,v 1.6 2000/07/03 13:30:32 grubba Exp $ */ +/* $Id: ras.c,v 1.7 2000/07/28 07:13:06 hubbe Exp $ */ /* **! module Image **! note -**! $Id: ras.c,v 1.6 2000/07/03 13:30:32 grubba Exp $ +**! $Id: ras.c,v 1.7 2000/07/28 07:13:06 hubbe Exp $ **! submodule RAS **! **! This submodule keep the RAS encode/decode capabilities @@ -14,7 +14,7 @@ #include "global.h" #include "stralloc.h" -RCSID("$Id: ras.c,v 1.6 2000/07/03 13:30:32 grubba Exp $"); +RCSID("$Id: ras.c,v 1.7 2000/07/28 07:13:06 hubbe Exp $"); #include "pike_macros.h" #include "object.h" #include "constants.h" @@ -34,6 +34,9 @@ RCSID("$Id: ras.c,v 1.6 2000/07/03 13:30:32 grubba Exp $"); #include "encodings.h" +/* MUST BE INCLUDED LAST */ +#include "module_magic.h" + extern struct program *image_colortable_program; extern struct program *image_program; diff --git a/src/modules/Image/encodings/tga.c b/src/modules/Image/encodings/tga.c index 4d83c541b1..984d7ea0c5 100644 --- a/src/modules/Image/encodings/tga.c +++ b/src/modules/Image/encodings/tga.c @@ -1,6 +1,6 @@ /* - * $Id: tga.c,v 1.15 2000/07/07 00:41:46 hubbe Exp $ + * $Id: tga.c,v 1.16 2000/07/28 07:13:06 hubbe Exp $ * * Targa codec for pike. Based on the tga plugin for gimp. * @@ -77,7 +77,11 @@ #include "image.h" #include "colortable.h" -RCSID("$Id: tga.c,v 1.15 2000/07/07 00:41:46 hubbe Exp $"); +/* MUST BE INCLUDED LAST */ +#include "module_magic.h" + + +RCSID("$Id: tga.c,v 1.16 2000/07/28 07:13:06 hubbe Exp $"); #ifndef MIN # define MIN(X,Y) ((X)<(Y)?(X):(Y)) diff --git a/src/modules/Image/encodings/tim.c b/src/modules/Image/encodings/tim.c index c81798496f..067427a47f 100644 --- a/src/modules/Image/encodings/tim.c +++ b/src/modules/Image/encodings/tim.c @@ -4,7 +4,7 @@ #include <ctype.h> #include "stralloc.h" -RCSID("$Id: tim.c,v 1.6 2000/07/03 13:30:32 grubba Exp $"); +RCSID("$Id: tim.c,v 1.7 2000/07/28 07:13:06 hubbe Exp $"); #include "pike_macros.h" #include "object.h" #include "constants.h" @@ -24,6 +24,10 @@ RCSID("$Id: tim.c,v 1.6 2000/07/03 13:30:32 grubba Exp $"); #include "encodings.h" +/* MUST BE INCLUDED LAST */ +#include "module_magic.h" + + extern struct program *image_program; /* diff --git a/src/modules/Image/encodings/wbf.c b/src/modules/Image/encodings/wbf.c index dc92bca0f1..db55a183c0 100644 --- a/src/modules/Image/encodings/wbf.c +++ b/src/modules/Image/encodings/wbf.c @@ -5,7 +5,7 @@ #include <ctype.h> #include "stralloc.h" -RCSID("$Id: wbf.c,v 1.4 2000/02/03 19:01:29 grubba Exp $"); +RCSID("$Id: wbf.c,v 1.5 2000/07/28 07:13:06 hubbe Exp $"); #include "pike_macros.h" #include "object.h" #include "mapping.h" @@ -24,6 +24,10 @@ RCSID("$Id: wbf.c,v 1.4 2000/02/03 19:01:29 grubba Exp $"); #include "builtin_functions.h" #include "module_support.h" +/* MUST BE INCLUDED LAST */ +#include "module_magic.h" + + extern struct program *image_program; /* @@ -80,7 +84,7 @@ static unsigned char read_uchar( struct buffer *from ) return res; } -static int read_int( struct buffer *from ) +static int wbf_read_int( struct buffer *from ) { int res = 0; while( 1 ) @@ -107,14 +111,14 @@ static struct wbf_header decode_header( struct buffer *data ) { struct wbf_header res; MEMSET( &res, 0, sizeof(res) ); - res.type = read_int( data ); + res.type = wbf_read_int( data ); res.fix_header_field = read_uchar( data ); if( res.fix_header_field & 0x80 ) { switch( (res.fix_header_field>>5) & 0x3 ) { case 0: /* Single varint extra header */ - res.ext_header_field = read_int( data ); + res.ext_header_field = wbf_read_int( data ); break; case 1: /* reserved */ case 2: /* reserved */ @@ -138,8 +142,8 @@ static struct wbf_header decode_header( struct buffer *data ) } } } - res.width = read_int( data ); - res.height = read_int( data ); + res.width = wbf_read_int( data ); + res.height = wbf_read_int( data ); return res; } diff --git a/src/modules/Image/encodings/x.c b/src/modules/Image/encodings/x.c index b8ef6e068d..f4d305e277 100644 --- a/src/modules/Image/encodings/x.c +++ b/src/modules/Image/encodings/x.c @@ -1,9 +1,9 @@ -/* $Id: x.c,v 1.26 2000/03/27 07:42:35 hubbe Exp $ */ +/* $Id: x.c,v 1.27 2000/07/28 07:13:06 hubbe Exp $ */ /* **! module Image **! note -**! $Id: x.c,v 1.26 2000/03/27 07:42:35 hubbe Exp $ +**! $Id: x.c,v 1.27 2000/07/28 07:13:06 hubbe Exp $ **! submodule X **! **! This submodule handles encoding and decoding of @@ -29,7 +29,7 @@ #include <winsock.h> #endif -RCSID("$Id: x.c,v 1.26 2000/03/27 07:42:35 hubbe Exp $"); +RCSID("$Id: x.c,v 1.27 2000/07/28 07:13:06 hubbe Exp $"); #include "pike_macros.h" #include "object.h" #include "constants.h" @@ -46,6 +46,10 @@ RCSID("$Id: x.c,v 1.26 2000/03/27 07:42:35 hubbe Exp $"); #include "colortable.h" #include "builtin_functions.h" +/* MUST BE INCLUDED LAST */ +#include "module_magic.h" + + extern struct program *image_colortable_program; extern struct program *image_program; diff --git a/src/modules/Image/encodings/xbm.c b/src/modules/Image/encodings/xbm.c index 0c71940a0d..41c228fe78 100644 --- a/src/modules/Image/encodings/xbm.c +++ b/src/modules/Image/encodings/xbm.c @@ -1,5 +1,5 @@ #include "global.h" -RCSID("$Id: xbm.c,v 1.9 2000/07/07 00:42:24 hubbe Exp $"); +RCSID("$Id: xbm.c,v 1.10 2000/07/28 07:13:06 hubbe Exp $"); #define NO_PIKE_SHORTHAND @@ -39,6 +39,10 @@ RCSID("$Id: xbm.c,v 1.9 2000/07/07 00:42:24 hubbe Exp $"); #include "image.h" #include "colortable.h" +/* MUST BE INCLUDED LAST */ +#include "module_magic.h" + + extern struct program *image_colortable_program; extern struct program *image_program; diff --git a/src/modules/Image/encodings/xcf.c b/src/modules/Image/encodings/xcf.c index 441885bec0..a1d337a193 100644 --- a/src/modules/Image/encodings/xcf.c +++ b/src/modules/Image/encodings/xcf.c @@ -1,5 +1,5 @@ #include "global.h" -RCSID("$Id: xcf.c,v 1.14 2000/04/10 21:58:23 grubba Exp $"); +RCSID("$Id: xcf.c,v 1.15 2000/07/28 07:13:06 hubbe Exp $"); #include "image_machine.h" @@ -20,10 +20,15 @@ RCSID("$Id: xcf.c,v 1.14 2000/04/10 21:58:23 grubba Exp $"); #include "builtin_functions.h" #include "operators.h" #include "dynamic_buffer.h" +#include "signal_handler.h" #include "image.h" #include "colortable.h" +/* MUST BE INCLUDED LAST */ +#include "module_magic.h" + + extern struct program *image_colortable_program; extern struct program *image_program; @@ -154,7 +159,7 @@ static unsigned int read_uint( struct buffer *from ) return res; } -static int read_int( struct buffer *from ) +static int xcf_read_int( struct buffer *from ) { return (int)read_uint( from ); } @@ -173,7 +178,7 @@ static char *read_data( struct buffer * from, unsigned int len ) static struct buffer read_string( struct buffer *data ) { struct buffer res; - res.len = read_int( data ); + res.len = xcf_read_int( data ); res.str = (unsigned char *)read_data( data, res.len ); if(res.len > 0) res.len--; /* len includes ending \0 */ if(!res.str) @@ -497,7 +502,7 @@ static struct layer read_layer( struct buffer *buff, struct buffer *initial ) SET_ONERROR( err, free_layer, &res ); res.width = read_uint( buff ); res.height = read_uint( buff ); - res.type = read_int( buff ); + res.type = xcf_read_int( buff ); res.name = read_string( buff ); @@ -513,8 +518,8 @@ static struct layer read_layer( struct buffer *buff, struct buffer *initial ) } } while( tmp.type ); - h_offset = read_int( buff ); - lm_offset = read_int( buff ); + h_offset = xcf_read_int( buff ); + lm_offset = xcf_read_int( buff ); if(lm_offset) { @@ -565,7 +570,7 @@ static struct gimp_image read_image( struct buffer * data ) res.width = read_uint( data ); res.height = read_uint( data ); - res.type = read_int( data ); + res.type = xcf_read_int( data ); SET_ONERROR( err, free_image, &res ); @@ -1088,7 +1093,6 @@ void image_xcf_f__rle_decode( INT32 args ) void image_xcf_f__decode_tiles( INT32 args ) { - extern void check_signals(); struct object *io,*ao, *cmapo; struct array *tiles; struct image *i, *a=NULL; @@ -1164,7 +1168,7 @@ void image_xcf_f__decode_tiles( INT32 args ) s = (unsigned char *)tile->str; - check_signals(); /* Allow ^C */ + check_signals(0,0,0); /* Allow ^C */ for(cy=0; cy<eheight; cy++) { diff --git a/src/modules/Image/encodings/xwd.c b/src/modules/Image/encodings/xwd.c index 9363fdf296..140fbe924e 100644 --- a/src/modules/Image/encodings/xwd.c +++ b/src/modules/Image/encodings/xwd.c @@ -1,9 +1,9 @@ -/* $Id: xwd.c,v 1.14 2000/07/03 13:30:32 grubba Exp $ */ +/* $Id: xwd.c,v 1.15 2000/07/28 07:13:06 hubbe Exp $ */ /* **! module Image **! note -**! $Id: xwd.c,v 1.14 2000/07/03 13:30:32 grubba Exp $ +**! $Id: xwd.c,v 1.15 2000/07/28 07:13:06 hubbe Exp $ **! submodule XWD **! **! This submodule keeps the XWD (X Windows Dump) @@ -25,7 +25,7 @@ #include <ctype.h> #include "stralloc.h" -RCSID("$Id: xwd.c,v 1.14 2000/07/03 13:30:32 grubba Exp $"); +RCSID("$Id: xwd.c,v 1.15 2000/07/28 07:13:06 hubbe Exp $"); #include "pike_macros.h" #include "object.h" #include "constants.h" @@ -38,16 +38,18 @@ RCSID("$Id: xwd.c,v 1.14 2000/07/03 13:30:32 grubba Exp $"); #include "image.h" #include "builtin_functions.h" - +#include "operators.h" #include "encodings.h" +/* MUST BE INCLUDED LAST */ +#include "module_magic.h" + + extern struct program *image_colortable_program; extern struct program *image_program; void image_x_decode_truecolor_masks(INT32 args); void image_x_decode_pseudocolor(INT32 args); -void f_aggregate_mapping(INT32 args); -void f_index(INT32 args); /* **! method mapping _decode(string data) diff --git a/src/modules/Image/font.c b/src/modules/Image/font.c index ab548ba4ad..06dd08fe2a 100644 --- a/src/modules/Image/font.c +++ b/src/modules/Image/font.c @@ -1,4 +1,4 @@ -/* $Id: font.c,v 1.59 2000/07/07 13:56:45 grubba Exp $ */ +/* $Id: font.c,v 1.60 2000/07/28 07:12:44 hubbe Exp $ */ #include "global.h" #define SPACE_CHAR 'i' @@ -9,7 +9,7 @@ extern unsigned char * image_default_font; /* **! module Image **! note -**! $Id: font.c,v 1.59 2000/07/07 13:56:45 grubba Exp $ +**! $Id: font.c,v 1.60 2000/07/28 07:12:44 hubbe Exp $ **! class Font **! **! note @@ -185,6 +185,9 @@ Kerningtable types: #include "fdlib.h" +/* This must be included last! */ +#include "module_magic.h" + extern struct program *font_program; extern struct program *image_program; diff --git a/src/modules/Image/image.c b/src/modules/Image/image.c index fbc073926a..a2c31735ac 100644 --- a/src/modules/Image/image.c +++ b/src/modules/Image/image.c @@ -1,9 +1,9 @@ -/* $Id: image.c,v 1.165 2000/07/27 03:45:48 per Exp $ */ +/* $Id: image.c,v 1.166 2000/07/28 07:12:44 hubbe Exp $ */ /* **! module Image **! note -**! $Id: image.c,v 1.165 2000/07/27 03:45:48 per Exp $ +**! $Id: image.c,v 1.166 2000/07/28 07:12:44 hubbe Exp $ **! class Image **! **! The main object of the <ref>Image</ref> module, this object @@ -98,7 +98,7 @@ #include "stralloc.h" #include "global.h" -RCSID("$Id: image.c,v 1.165 2000/07/27 03:45:48 per Exp $"); +RCSID("$Id: image.c,v 1.166 2000/07/28 07:12:44 hubbe Exp $"); #include "pike_macros.h" #include "object.h" #include "constants.h" @@ -119,6 +119,10 @@ RCSID("$Id: image.c,v 1.165 2000/07/27 03:45:48 per Exp $"); #include "assembly.h" #endif +/* This must be included last! */ +#include "module_magic.h" + + extern struct program *image_program; extern struct program *image_colortable_program; diff --git a/src/modules/Image/image_module.c b/src/modules/Image/image_module.c index 7fe7eb95eb..b11265f8e3 100644 --- a/src/modules/Image/image_module.c +++ b/src/modules/Image/image_module.c @@ -1,7 +1,7 @@ #include "global.h" #include "stralloc.h" #include "global.h" -RCSID("$Id: image_module.c,v 1.6 2000/06/02 05:03:13 per Exp $"); +RCSID("$Id: image_module.c,v 1.7 2000/07/28 07:12:44 hubbe Exp $"); #include "pike_macros.h" #include "interpret.h" #include "program.h" @@ -12,6 +12,10 @@ RCSID("$Id: image_module.c,v 1.6 2000/06/02 05:03:13 per Exp $"); #include "assembly.h" #include "image_machine.h" +/* This must be included last! */ +#include "module_magic.h" + + #define IMAGE_INITER /* #define DEBUG */ diff --git a/src/modules/Image/layers.c b/src/modules/Image/layers.c index 69e55b00d9..789f15673d 100644 --- a/src/modules/Image/layers.c +++ b/src/modules/Image/layers.c @@ -1,7 +1,7 @@ /* **! module Image **! note -**! $Id: layers.c,v 1.44 2000/07/07 00:40:19 hubbe Exp $ +**! $Id: layers.c,v 1.45 2000/07/28 07:12:44 hubbe Exp $ **! class Layer **! see also: layers **! @@ -215,7 +215,7 @@ #include <math.h> /* floor */ -RCSID("$Id: layers.c,v 1.44 2000/07/07 00:40:19 hubbe Exp $"); +RCSID("$Id: layers.c,v 1.45 2000/07/28 07:12:44 hubbe Exp $"); #include "image_machine.h" @@ -236,6 +236,8 @@ RCSID("$Id: layers.c,v 1.44 2000/07/07 00:40:19 hubbe Exp $"); #include "image.h" +/* This must be included last! */ +#include "module_magic.h" #ifdef TRY_USE_MMX #include <mmx.h> diff --git a/src/modules/Image/matrix.c b/src/modules/Image/matrix.c index 4c77a16eef..d7ab25b21c 100644 --- a/src/modules/Image/matrix.c +++ b/src/modules/Image/matrix.c @@ -1,9 +1,9 @@ -/* $Id: matrix.c,v 1.23 2000/07/07 13:56:46 grubba Exp $ */ +/* $Id: matrix.c,v 1.24 2000/07/28 07:12:44 hubbe Exp $ */ /* **! module Image **! note -**! $Id: matrix.c,v 1.23 2000/07/07 13:56:46 grubba Exp $ +**! $Id: matrix.c,v 1.24 2000/07/28 07:12:44 hubbe Exp $ **! class Image */ @@ -25,6 +25,9 @@ #include "image.h" +/* This must be included last! */ +#include "module_magic.h" + extern struct program *image_program; #ifdef THIS #undef THIS /* Needed for NT */ diff --git a/src/modules/Image/operator.c b/src/modules/Image/operator.c index db21c8e6b0..f1a1cdd6a6 100644 --- a/src/modules/Image/operator.c +++ b/src/modules/Image/operator.c @@ -1,9 +1,9 @@ -/* $Id: operator.c,v 1.29 2000/07/07 13:56:46 grubba Exp $ */ +/* $Id: operator.c,v 1.30 2000/07/28 07:12:44 hubbe Exp $ */ /* **! module Image **! note -**! $Id: operator.c,v 1.29 2000/07/07 13:56:46 grubba Exp $ +**! $Id: operator.c,v 1.30 2000/07/28 07:12:44 hubbe Exp $ **! class Image */ @@ -28,6 +28,9 @@ #include "image_machine.h" #include "assembly.h" +/* This must be included last! */ +#include "module_magic.h" + extern struct program *image_program; #ifdef THIS #undef THIS diff --git a/src/modules/Image/orient.c b/src/modules/Image/orient.c index 185f9dded3..77c9680d9a 100644 --- a/src/modules/Image/orient.c +++ b/src/modules/Image/orient.c @@ -1,9 +1,9 @@ -/* $Id: orient.c,v 1.14 2000/07/07 13:56:46 grubba Exp $ */ +/* $Id: orient.c,v 1.15 2000/07/28 07:12:44 hubbe Exp $ */ /* **! module Image **! note -**! $Id: orient.c,v 1.14 2000/07/07 13:56:46 grubba Exp $ +**! $Id: orient.c,v 1.15 2000/07/28 07:12:44 hubbe Exp $ **! class Image */ @@ -27,6 +27,9 @@ #include <builtin_functions.h> +/* This must be included last! */ +#include "module_magic.h" + extern struct program *image_program; #ifdef THIS #undef THIS /* Needed for NT */ diff --git a/src/modules/Image/pattern.c b/src/modules/Image/pattern.c index e6812dfc92..b38f11bd9a 100644 --- a/src/modules/Image/pattern.c +++ b/src/modules/Image/pattern.c @@ -1,9 +1,9 @@ -/* $Id: pattern.c,v 1.19 2000/07/07 13:56:46 grubba Exp $ */ +/* $Id: pattern.c,v 1.20 2000/07/28 07:12:44 hubbe Exp $ */ /* **! module Image **! note -**! $Id: pattern.c,v 1.19 2000/07/07 13:56:46 grubba Exp $ +**! $Id: pattern.c,v 1.20 2000/07/28 07:12:44 hubbe Exp $ **! class Image */ @@ -26,6 +26,9 @@ #include "image.h" +/* This must be included last! */ +#include "module_magic.h" + extern struct program *image_program; #ifdef THIS #undef THIS diff --git a/src/modules/Image/poly.c b/src/modules/Image/poly.c index 054ba1b1c8..8c5e2aa51e 100644 --- a/src/modules/Image/poly.c +++ b/src/modules/Image/poly.c @@ -1,7 +1,7 @@ /* **! module Image **! note -**! $Id: poly.c,v 1.4 2000/07/07 13:56:46 grubba Exp $ +**! $Id: poly.c,v 1.5 2000/07/28 07:12:44 hubbe Exp $ **! class Poly **! */ @@ -18,7 +18,7 @@ another? #include "global.h" -RCSID("$Id: poly.c,v 1.4 2000/07/07 13:56:46 grubba Exp $"); +RCSID("$Id: poly.c,v 1.5 2000/07/28 07:12:44 hubbe Exp $"); #include "image_machine.h" @@ -44,6 +44,9 @@ RCSID("$Id: poly.c,v 1.4 2000/07/07 13:56:46 grubba Exp $"); #include "colortable.h" #include "initstuff.h" +/* This must be included last! */ +#include "module_magic.h" + #ifdef PFLOAT #undef PFLOAT #endif diff --git a/src/modules/Image/polyfill.c b/src/modules/Image/polyfill.c index 259b05badf..9f0366b5a9 100644 --- a/src/modules/Image/polyfill.c +++ b/src/modules/Image/polyfill.c @@ -1,5 +1,5 @@ #include "global.h" -RCSID("$Id: polyfill.c,v 1.31 2000/07/07 13:56:46 grubba Exp $"); +RCSID("$Id: polyfill.c,v 1.32 2000/07/28 07:12:44 hubbe Exp $"); /* Prototypes are needed for these */ extern double floor(double); @@ -26,6 +26,9 @@ extern double floor(double); #include "image.h" +/* This must be included last! */ +#include "module_magic.h" + #ifdef THIS #undef THIS #endif @@ -37,7 +40,7 @@ extern double floor(double); /* **! module Image **! note -**! $Id: polyfill.c,v 1.31 2000/07/07 13:56:46 grubba Exp $ +**! $Id: polyfill.c,v 1.32 2000/07/28 07:12:44 hubbe Exp $ **! class Image */ diff --git a/src/modules/Image/search.c b/src/modules/Image/search.c index 023d79eb37..fb34bc7b94 100644 --- a/src/modules/Image/search.c +++ b/src/modules/Image/search.c @@ -26,6 +26,9 @@ #include <builtin_functions.h> +/* This must be included last! */ +#include "module_magic.h" + extern struct program *image_program; #ifdef THIS #undef THIS /* Needed for NT */ diff --git a/src/modules/Java/jvm.c b/src/modules/Java/jvm.c index 069ec0aab7..14c3895c9b 100644 --- a/src/modules/Java/jvm.c +++ b/src/modules/Java/jvm.c @@ -1,5 +1,5 @@ /* - * $Id: jvm.c,v 1.25 2000/07/08 01:10:36 marcus Exp $ + * $Id: jvm.c,v 1.26 2000/07/28 07:13:18 hubbe Exp $ * * Pike interface to Java Virtual Machine * @@ -17,7 +17,7 @@ #endif /* HAVE_CONFIG_H */ #include "global.h" -RCSID("$Id: jvm.c,v 1.25 2000/07/08 01:10:36 marcus Exp $"); +RCSID("$Id: jvm.c,v 1.26 2000/07/28 07:13:18 hubbe Exp $"); #include "program.h" #include "interpret.h" #include "stralloc.h" @@ -3159,6 +3159,8 @@ static void f_new_double_array(INT32 args) push_int(0); } +#else +#include "module_magic.h" #endif /* HAVE_JAVA */ void pike_module_init(void) diff --git a/src/modules/MIME/mime.c b/src/modules/MIME/mime.c index 96618ef442..4f7856d655 100644 --- a/src/modules/MIME/mime.c +++ b/src/modules/MIME/mime.c @@ -1,5 +1,5 @@ /* - * $Id: mime.c,v 1.21 1999/08/17 18:38:32 marcus Exp $ + * $Id: mime.c,v 1.22 2000/07/28 07:13:26 hubbe Exp $ * * RFC1521 functionality for Pike * @@ -10,7 +10,7 @@ #include "config.h" -RCSID("$Id: mime.c,v 1.21 1999/08/17 18:38:32 marcus Exp $"); +RCSID("$Id: mime.c,v 1.22 2000/07/28 07:13:26 hubbe Exp $"); #include "stralloc.h" #include "pike_macros.h" #include "object.h" @@ -25,6 +25,8 @@ RCSID("$Id: mime.c,v 1.21 1999/08/17 18:38:32 marcus Exp $"); #define SIGNED #endif +/* must be included last */ +#include "module_magic.h" /** Forward declarations of functions implementing Pike functions **/ diff --git a/src/modules/Math/math_matrix.c b/src/modules/Math/math_matrix.c index 51a8545a8d..06df59034b 100644 --- a/src/modules/Math/math_matrix.c +++ b/src/modules/Math/math_matrix.c @@ -1,4 +1,4 @@ -/* $Id: math_matrix.c,v 1.13 2000/07/07 14:01:16 grubba Exp $ */ +/* $Id: math_matrix.c,v 1.14 2000/07/28 07:13:32 hubbe Exp $ */ #include "global.h" #include "config.h" @@ -20,6 +20,9 @@ #include "math_module.h" +/* must be included last */ +#include "module_magic.h" + /* **! module Math **! class Matrix diff --git a/src/modules/Math/math_module.c b/src/modules/Math/math_module.c index 6576a0b145..a0a8447223 100644 --- a/src/modules/Math/math_module.c +++ b/src/modules/Math/math_module.c @@ -1,5 +1,5 @@ /* - * $Id: math_module.c,v 1.4 1999/11/08 22:40:16 grubba Exp $ + * $Id: math_module.c,v 1.5 2000/07/28 07:13:32 hubbe Exp $ */ #include "global.h" @@ -9,6 +9,9 @@ #include "math_module.h" +/* must be included last */ +#include "module_magic.h" + /*** module init & exit & stuff *****************************************/ /* add other parsers here */ diff --git a/src/modules/Mird/mird_glue.c b/src/modules/Mird/mird_glue.c index e0e5b80766..acff206667 100644 --- a/src/modules/Mird/mird_glue.c +++ b/src/modules/Mird/mird_glue.c @@ -18,6 +18,8 @@ #endif #endif +#include "module_magic.h" + #ifdef HAVE_MIRD #include "mird.h" diff --git a/src/modules/Msql/msqlmod.c b/src/modules/Msql/msqlmod.c index 56f90e57b1..985e31216f 100644 --- a/src/modules/Msql/msqlmod.c +++ b/src/modules/Msql/msqlmod.c @@ -2,7 +2,7 @@ * This code is (C) Francesco Chemolli, 1997. * You may use, modify and redistribute it freely under the terms * of the GNU General Public License, version 2. - * $Id: msqlmod.c,v 1.13 2000/04/30 21:15:24 kinkie Exp $ + * $Id: msqlmod.c,v 1.14 2000/07/28 07:13:45 hubbe Exp $ * * This version is intended for Pike/0.5 and later. * It won't compile under older versions of the Pike interpreter. @@ -35,7 +35,7 @@ #include "operators.h" #include "multiset.h" -RCSID("$Id: msqlmod.c,v 1.13 2000/04/30 21:15:24 kinkie Exp $"); +RCSID("$Id: msqlmod.c,v 1.14 2000/07/28 07:13:45 hubbe Exp $"); #include "version.h" #ifdef _REENTRANT @@ -806,6 +806,7 @@ void pike_module_init(void) } #else /*HAVE_MSQL*/ +#include "module_magic.h" void pike_module_init(void) {} #endif /*HAVE_MSQL*/ diff --git a/src/modules/Mysql/mysql.c b/src/modules/Mysql/mysql.c index 86e9bc892a..7c6b324690 100644 --- a/src/modules/Mysql/mysql.c +++ b/src/modules/Mysql/mysql.c @@ -1,5 +1,5 @@ /* - * $Id: mysql.c,v 1.34 2000/07/07 16:05:46 marcus Exp $ + * $Id: mysql.c,v 1.35 2000/07/28 07:13:51 hubbe Exp $ * * SQL database functionality for Pike * @@ -80,6 +80,8 @@ typedef struct dynamic_buffer_s dynamic_buffer; #include <memory.h> #endif +#include "module_magic.h" + #ifdef HAVE_MYSQL /* Local includes */ @@ -89,7 +91,7 @@ typedef struct dynamic_buffer_s dynamic_buffer; * Globals */ -RCSID("$Id: mysql.c,v 1.34 2000/07/07 16:05:46 marcus Exp $"); +RCSID("$Id: mysql.c,v 1.35 2000/07/28 07:13:51 hubbe Exp $"); /* **! module Mysql @@ -101,7 +103,7 @@ RCSID("$Id: mysql.c,v 1.34 2000/07/07 16:05:46 marcus Exp $"); **! see also: Mysql.mysql, Mysql.result, Sql.sql **! **! note -**! $Id: mysql.c,v 1.34 2000/07/07 16:05:46 marcus Exp $ +**! $Id: mysql.c,v 1.35 2000/07/28 07:13:51 hubbe Exp $ **! **! class mysql **! diff --git a/src/modules/Odbc/odbc.c b/src/modules/Odbc/odbc.c index 331ba86936..c93a89a6f1 100644 --- a/src/modules/Odbc/odbc.c +++ b/src/modules/Odbc/odbc.c @@ -1,5 +1,5 @@ /* - * $Id: odbc.c,v 1.18 1999/05/18 02:06:09 grubba Exp $ + * $Id: odbc.c,v 1.19 2000/07/28 07:13:58 hubbe Exp $ * * Pike interface to ODBC compliant databases. * @@ -16,7 +16,7 @@ #include "config.h" #endif /* HAVE_CONFIG_H */ -RCSID("$Id: odbc.c,v 1.18 1999/05/18 02:06:09 grubba Exp $"); +RCSID("$Id: odbc.c,v 1.19 2000/07/28 07:13:58 hubbe Exp $"); #include "interpret.h" #include "object.h" @@ -31,6 +31,9 @@ RCSID("$Id: odbc.c,v 1.18 1999/05/18 02:06:09 grubba Exp $"); #include "precompiled_odbc.h" +/* must be included last */ +#include "module_magic.h" + #ifdef HAVE_ODBC /* diff --git a/src/modules/Odbc/odbc_result.c b/src/modules/Odbc/odbc_result.c index d16dab671e..f1f7fc793a 100644 --- a/src/modules/Odbc/odbc_result.c +++ b/src/modules/Odbc/odbc_result.c @@ -1,5 +1,5 @@ /* - * $Id: odbc_result.c,v 1.18 1999/03/28 17:50:03 marcus Exp $ + * $Id: odbc_result.c,v 1.19 2000/07/28 07:13:58 hubbe Exp $ * * Pike interface to ODBC compliant databases * @@ -16,7 +16,7 @@ #include "config.h" #endif /* HAVE_CONFIG_H */ -RCSID("$Id: odbc_result.c,v 1.18 1999/03/28 17:50:03 marcus Exp $"); +RCSID("$Id: odbc_result.c,v 1.19 2000/07/28 07:13:58 hubbe Exp $"); #include "interpret.h" #include "object.h" @@ -35,6 +35,9 @@ RCSID("$Id: odbc_result.c,v 1.18 1999/03/28 17:50:03 marcus Exp $"); #include "precompiled_odbc.h" +/* must be included last */ +#include "module_magic.h" + #ifdef HAVE_ODBC /* #define ODBC_DEBUG */ diff --git a/src/modules/Oracle/oracle.c b/src/modules/Oracle/oracle.c index 96bc4eac72..ad3632219f 100644 --- a/src/modules/Oracle/oracle.c +++ b/src/modules/Oracle/oracle.c @@ -1,5 +1,5 @@ /* - * $Id: oracle.c,v 1.43 2000/07/07 00:50:10 hubbe Exp $ + * $Id: oracle.c,v 1.44 2000/07/28 07:14:04 hubbe Exp $ * * Pike interface to Oracle databases. * @@ -33,6 +33,9 @@ #include "opcodes.h" #include "pike_macros.h" +/* must be included last */ +#include "module_magic.h" + #ifdef HAVE_ORACLE /* VERY VERY UGLY */ @@ -41,7 +44,7 @@ #include <oci.h> #include <math.h> -RCSID("$Id: oracle.c,v 1.43 2000/07/07 00:50:10 hubbe Exp $"); +RCSID("$Id: oracle.c,v 1.44 2000/07/28 07:14:04 hubbe Exp $"); #define BLOB_FETCH_CHUNK 16384 diff --git a/src/modules/Parser/html.c b/src/modules/Parser/html.c index 046b203b81..a8abcfcf02 100644 --- a/src/modules/Parser/html.c +++ b/src/modules/Parser/html.c @@ -19,6 +19,9 @@ #include "parser.h" +/* must be included last */ +#include "module_magic.h" + extern struct program *parser_html_program; /* diff --git a/src/modules/Parser/parser.c b/src/modules/Parser/parser.c index cb012a3e3c..0b3fc12092 100644 --- a/src/modules/Parser/parser.c +++ b/src/modules/Parser/parser.c @@ -1,7 +1,7 @@ #include "global.h" #include "stralloc.h" #include "global.h" -RCSID("$Id: parser.c,v 1.7 2000/06/24 00:48:31 hubbe Exp $"); +RCSID("$Id: parser.c,v 1.8 2000/07/28 07:14:14 hubbe Exp $"); #include "pike_macros.h" #include "interpret.h" #include "program.h" @@ -11,6 +11,9 @@ RCSID("$Id: parser.c,v 1.7 2000/06/24 00:48:31 hubbe Exp $"); #include "parser.h" +/* must be included last */ +#include "module_magic.h" + #define PARSER_INITER /*#define DEBUG*/ diff --git a/src/modules/Perl/perlmod.c b/src/modules/Perl/perlmod.c index b4043b4272..f23ae0c7cd 100644 --- a/src/modules/Perl/perlmod.c +++ b/src/modules/Perl/perlmod.c @@ -1,4 +1,4 @@ -/* $Id: perlmod.c,v 1.17 2000/07/07 02:44:07 hubbe Exp $ */ +/* $Id: perlmod.c,v 1.18 2000/07/28 07:14:20 hubbe Exp $ */ #include "builtin_functions.h" #include "global.h" @@ -11,6 +11,9 @@ #include "mapping.h" #include "perl_machine.h" +/* must be included last */ +#include "module_magic.h" + #ifdef HAVE_PERL /* #define PERL_560 1 */ diff --git a/src/modules/Pipe/pipe.c b/src/modules/Pipe/pipe.c index a2c25aa0b9..265365ac50 100644 --- a/src/modules/Pipe/pipe.c +++ b/src/modules/Pipe/pipe.c @@ -26,7 +26,7 @@ #include <fcntl.h> -RCSID("$Id: pipe.c,v 1.36 2000/07/07 13:59:28 grubba Exp $"); +RCSID("$Id: pipe.c,v 1.37 2000/07/28 07:14:27 hubbe Exp $"); #include "threads.h" #include "stralloc.h" @@ -47,6 +47,10 @@ RCSID("$Id: pipe.c,v 1.36 2000/07/07 13:59:28 grubba Exp $"); #endif #endif +/* must be included last */ +#include "module_magic.h" + + /* #define PIPE_STRING_DEBUG #define PIPE_MMAP_DEBUG diff --git a/src/modules/Postgres/pgresult.c b/src/modules/Postgres/pgresult.c index 3b66d122c1..99a1291996 100644 --- a/src/modules/Postgres/pgresult.c +++ b/src/modules/Postgres/pgresult.c @@ -1,5 +1,5 @@ /* - * $Id: pgresult.c,v 1.12 2000/04/18 06:54:08 jonasw Exp $ + * $Id: pgresult.c,v 1.13 2000/07/28 07:14:33 hubbe Exp $ * * Postgres95 support for pike/0.5 and up * @@ -63,7 +63,7 @@ #include "builtin_functions.h" #include "module_support.h" -RCSID("$Id: pgresult.c,v 1.12 2000/04/18 06:54:08 jonasw Exp $"); +RCSID("$Id: pgresult.c,v 1.13 2000/07/28 07:14:33 hubbe Exp $"); #ifdef _REENTRANT MUTEX_T pike_postgres_result_mutex STATIC_MUTEX_INIT; @@ -76,6 +76,10 @@ MUTEX_T pike_postgres_result_mutex STATIC_MUTEX_INIT; #include "pg_types.h" +/* must be included last */ +#include "module_magic.h" + + #define THIS ((struct postgres_result_object_data *) fp->current_storage) #ifdef PGRESDEBUG diff --git a/src/modules/Postgres/postgres.c b/src/modules/Postgres/postgres.c index a8f5deeb20..85a943aac2 100644 --- a/src/modules/Postgres/postgres.c +++ b/src/modules/Postgres/postgres.c @@ -48,6 +48,9 @@ MUTEX_T pike_postgres_mutex STATIC_MUTEX_INIT; #include "pg_types.h" +/* must be included last */ +#include "module_magic.h" + #ifdef PGDEBUG #define pgdebug printf #else @@ -56,7 +59,7 @@ static void pgdebug (char * a, ...) {} struct program * postgres_program; -RCSID("$Id: postgres.c,v 1.17 2000/04/18 06:54:08 jonasw Exp $"); +RCSID("$Id: postgres.c,v 1.18 2000/07/28 07:14:33 hubbe Exp $"); #define THIS ((struct pgres_object_data *) fp->current_storage) @@ -506,6 +509,7 @@ void pike_module_exit(void) } #else /* HAVE_POSTGRES */ +#include "module_magic.h" void pike_module_init(void) {} void pike_module_exit(void) {} #endif /* HAVE_POSTGRES */ diff --git a/src/modules/Regexp/glue.c b/src/modules/Regexp/glue.c index b190dc90dc..450954ed08 100644 --- a/src/modules/Regexp/glue.c +++ b/src/modules/Regexp/glue.c @@ -19,7 +19,7 @@ #include "threads.h" #include "module_support.h" -RCSID("$Id: glue.c,v 1.17 2000/07/07 13:58:57 grubba Exp $"); +RCSID("$Id: glue.c,v 1.18 2000/07/28 07:14:40 hubbe Exp $"); #ifdef USE_SYSTEM_REGEXP #include <regexp.h> @@ -39,6 +39,9 @@ struct regexp_glue #endif /* USE_SYSTEM_REGEXP */ +/* must be included last */ +#include "module_magic.h" + #ifdef THIS #undef THIS diff --git a/src/modules/Regexp/pike_regexp.c b/src/modules/Regexp/pike_regexp.c index e5b8e630b6..fe5d5ebaf5 100644 --- a/src/modules/Regexp/pike_regexp.c +++ b/src/modules/Regexp/pike_regexp.c @@ -1,5 +1,5 @@ /* - * $Id: pike_regexp.c,v 1.13 1998/11/22 11:05:36 hubbe Exp $ + * $Id: pike_regexp.c,v 1.14 2000/07/28 07:14:40 hubbe Exp $ * * regexp.c - regular expression matching * @@ -68,6 +68,9 @@ #include "pike_memory.h" #include "error.h" +/* must be included last */ +#include "module_magic.h" + /* * The "internal use only" fields in regexp.h are present to pass info from * compile to execute that permits the execute phase to run lots faster on diff --git a/src/modules/SANE/.cvsignore b/src/modules/SANE/.cvsignore index 8f3aaf06dd..4b82bc2164 100644 --- a/src/modules/SANE/.cvsignore +++ b/src/modules/SANE/.cvsignore @@ -1,4 +1,5 @@ .pure +Makefile config.h config.h.in config.log diff --git a/src/modules/SANE/.gitignore b/src/modules/SANE/.gitignore index 0f37cb1635..11458f6d8e 100644 --- a/src/modules/SANE/.gitignore +++ b/src/modules/SANE/.gitignore @@ -1,4 +1,5 @@ /.pure +/Makefile /config.h /config.h.in /config.log diff --git a/src/modules/SANE/sane.c b/src/modules/SANE/sane.c index 5b7a09bef8..ff28f56d46 100644 --- a/src/modules/SANE/sane.c +++ b/src/modules/SANE/sane.c @@ -29,7 +29,10 @@ #include "../Image/image.h" -RCSID("$Id: sane.c,v 1.5 2000/07/07 16:10:07 marcus Exp $"); +/* must be included last */ +#include "module_magic.h" + +RCSID("$Id: sane.c,v 1.6 2000/07/28 07:14:53 hubbe Exp $"); /* **! module SANE @@ -38,7 +41,7 @@ RCSID("$Id: sane.c,v 1.5 2000/07/07 16:10:07 marcus Exp $"); **! library from pike **! **! note -**! $Id: sane.c,v 1.5 2000/07/07 16:10:07 marcus Exp $ +**! $Id: sane.c,v 1.6 2000/07/28 07:14:53 hubbe Exp $ */ static int sane_is_inited; @@ -746,6 +749,7 @@ void pike_module_exit() } #else +#include "module_magic.h" void pike_module_init() {} void pike_module_exit() {} #endif diff --git a/src/modules/Yp/yp.c b/src/modules/Yp/yp.c index debcd9ba40..3819133e0e 100644 --- a/src/modules/Yp/yp.c +++ b/src/modules/Yp/yp.c @@ -28,7 +28,10 @@ #include "builtin_functions.h" #include "module_support.h" -RCSID("$Id: yp.c,v 1.17 1999/08/03 00:42:53 hubbe Exp $"); +/* must be included last */ +#include "module_magic.h" + +RCSID("$Id: yp.c,v 1.18 2000/07/28 07:15:01 hubbe Exp $"); #define YPERROR(fun,err) do{ if(err) error("yp->%s(): %s\n", (fun), \ yperr_string(err)); }while(0) @@ -253,6 +256,7 @@ void pike_module_exit(void) } #else +#include "module_magic.h" void pike_module_init(void) {} void pike_module_exit(void) {} diff --git a/src/modules/_Charset/charsetmod.c b/src/modules/_Charset/charsetmod.c index 2859e86c4a..a98b921063 100644 --- a/src/modules/_Charset/charsetmod.c +++ b/src/modules/_Charset/charsetmod.c @@ -3,7 +3,7 @@ #endif /* HAVE_CONFIG_H */ #include "../../global.h" -RCSID("$Id: charsetmod.c,v 1.19 2000/07/24 11:22:31 lange Exp $"); +RCSID("$Id: charsetmod.c,v 1.20 2000/07/28 07:15:07 hubbe Exp $"); #include "program.h" #include "interpret.h" #include "stralloc.h" @@ -13,6 +13,9 @@ RCSID("$Id: charsetmod.c,v 1.19 2000/07/24 11:22:31 lange Exp $"); #include "iso2022.h" +/* MUST BE LAST INCLUDE */ +#include "module_magic.h" + #ifdef __CHAR_UNSIGNED__ #define SIGNED signed #else diff --git a/src/modules/_Charset/iso2022.c b/src/modules/_Charset/iso2022.c index 0ba2436725..41cd1ed0f6 100644 --- a/src/modules/_Charset/iso2022.c +++ b/src/modules/_Charset/iso2022.c @@ -3,7 +3,7 @@ #endif /* HAVE_CONFIG_H */ #include "global.h" -RCSID("$Id: iso2022.c,v 1.15 2000/07/24 11:22:31 lange Exp $"); +RCSID("$Id: iso2022.c,v 1.16 2000/07/28 07:15:07 hubbe Exp $"); #include "program.h" #include "interpret.h" #include "stralloc.h" @@ -13,6 +13,8 @@ RCSID("$Id: iso2022.c,v 1.15 2000/07/24 11:22:31 lange Exp $"); #include "iso2022.h" +/* MUST BE LAST INCLUDE */ +#include "module_magic.h" #define PRGM_NAME "Locale.Charset.ISO2022" diff --git a/src/modules/_Crypto/arcfour.c b/src/modules/_Crypto/arcfour.c index d367ab64c8..c168fdd55f 100644 --- a/src/modules/_Crypto/arcfour.c +++ b/src/modules/_Crypto/arcfour.c @@ -16,7 +16,10 @@ #include "arcfour.h" -RCSID("$Id: arcfour.c,v 1.10 2000/03/28 12:16:08 grubba Exp $"); +/* THIS MUST BE INCLUDED LAST */ +#include "module_magic.h" + +RCSID("$Id: arcfour.c,v 1.11 2000/07/28 07:15:16 hubbe Exp $"); #undef THIS #define THIS ((struct arcfour_ctx *)(fp->current_storage)) @@ -69,7 +72,7 @@ static void f_set_key(INT32 args) } /* string crypt(string) */ -static void f_crypt(INT32 args) +static void f_arcfour_crypt(INT32 args) { int len; struct pike_string *s; @@ -107,7 +110,7 @@ void pike_arcfour_init(void) /* function(string:object) */ ADD_FUNCTION("set_decrypt_key", f_set_key,tFunc(tStr,tObj), 0); /* function(string:string) */ - ADD_FUNCTION("crypt", f_crypt,tFunc(tStr,tStr), 0); + ADD_FUNCTION("crypt", f_arcfour_crypt,tFunc(tStr,tStr), 0); set_init_callback(init_pike_arcfour); set_exit_callback(exit_pike_arcfour); diff --git a/src/modules/_Crypto/cast.c b/src/modules/_Crypto/cast.c index e598abd8f6..e9649bb074 100644 --- a/src/modules/_Crypto/cast.c +++ b/src/modules/_Crypto/cast.c @@ -1,5 +1,5 @@ /* - * $Id: cast.c,v 1.6 1999/02/10 21:51:30 hubbe Exp $ + * $Id: cast.c,v 1.7 2000/07/28 07:15:16 hubbe Exp $ * * CAST crypto module for Pike * @@ -22,6 +22,10 @@ #include <cast.h> +/* THIS MUST BE INCLUDED LAST */ +#include "module_magic.h" + + struct pike_crypto_cast { struct cast_key key; void (*crypt_fun)(struct cast_key* key, unsigned INT8* inblock, diff --git a/src/modules/_Crypto/cbc.c b/src/modules/_Crypto/cbc.c index 48629214ae..c0067f77d0 100644 --- a/src/modules/_Crypto/cbc.c +++ b/src/modules/_Crypto/cbc.c @@ -1,5 +1,5 @@ /* - * $Id: cbc.c,v 1.15 2000/07/07 13:57:15 grubba Exp $ + * $Id: cbc.c,v 1.16 2000/07/28 07:15:16 hubbe Exp $ * * CBC (Cipher Block Chaining Mode) crypto module for Pike. * @@ -28,6 +28,10 @@ /* Prototypes */ #include "crypto.h" +/* THIS MUST BE INCLUDED LAST */ +#include "module_magic.h" + + struct pike_crypto_cbc { struct object *object; unsigned INT8 *iv; diff --git a/src/modules/_Crypto/crypto.c b/src/modules/_Crypto/crypto.c index c7ed7f420c..6d435791fb 100644 --- a/src/modules/_Crypto/crypto.c +++ b/src/modules/_Crypto/crypto.c @@ -1,5 +1,5 @@ /* - * $Id: crypto.c,v 1.32 2000/07/07 13:57:15 grubba Exp $ + * $Id: crypto.c,v 1.33 2000/07/28 07:15:16 hubbe Exp $ * * A pike module for getting access to some common cryptos. * @@ -37,6 +37,9 @@ /* Prototypes */ #include "crypto.h" +/* THIS MUST BE INCLUDED LAST */ +#include "module_magic.h" + struct pike_crypto { struct object *object; INT32 block_size; @@ -306,7 +309,7 @@ static void f_set_decrypt_key(INT32 args) } /* string crypt(string) */ -static void f_crypt(INT32 args) +static void f_crypto_crypt(INT32 args) { unsigned char *result; INT32 roffset = 0; @@ -482,7 +485,7 @@ void pike_crypto_init(void) /* function(string:object) */ ADD_FUNCTION("set_decrypt_key", f_set_decrypt_key,tFunc(tStr,tObj), 0); /* function(string:string) */ - ADD_FUNCTION("crypt", f_crypt,tFunc(tStr,tStr), 0); + ADD_FUNCTION("crypt", f_crypto_crypt,tFunc(tStr,tStr), 0); /* function(void:string) */ ADD_FUNCTION("pad", f_pad,tFunc(tVoid,tStr), 0); diff --git a/src/modules/_Crypto/des.c b/src/modules/_Crypto/des.c index fb865dae70..5f859cc1b4 100644 --- a/src/modules/_Crypto/des.c +++ b/src/modules/_Crypto/des.c @@ -1,5 +1,5 @@ /* - * $Id: des.c,v 1.15 2000/07/07 13:57:15 grubba Exp $ + * $Id: des.c,v 1.16 2000/07/28 07:15:16 hubbe Exp $ * * A pike module for getting access to some common cryptos. * @@ -41,6 +41,9 @@ #include <des.h> +/* THIS MUST BE INCLUDED LAST */ +#include "module_magic.h" + struct pike_crypto_des { unsigned INT32 method[DES_EXPANDED_KEYLEN]; void (*crypt_fun)(unsigned INT8 *dest, diff --git a/src/modules/_Crypto/idea.c b/src/modules/_Crypto/idea.c index d3994c6751..e72c300635 100644 --- a/src/modules/_Crypto/idea.c +++ b/src/modules/_Crypto/idea.c @@ -1,5 +1,5 @@ /* - * $Id: idea.c,v 1.13 1999/02/10 21:51:35 hubbe Exp $ + * $Id: idea.c,v 1.14 2000/07/28 07:15:16 hubbe Exp $ * * IDEA crypto module for Pike * @@ -24,6 +24,9 @@ /* Backend includes */ #include <idea.h> +/* THIS MUST BE INCLUDED LAST */ +#include "module_magic.h" + #undef THIS #define THIS ((unsigned INT16 *)(fp->current_storage)) #define OBTOCTX(o) ((unsigned INT16 *)(o->storage)) diff --git a/src/modules/_Crypto/invert.c b/src/modules/_Crypto/invert.c index 5781436e1c..8beb95a770 100644 --- a/src/modules/_Crypto/invert.c +++ b/src/modules/_Crypto/invert.c @@ -1,5 +1,5 @@ /* - * $Id: invert.c,v 1.8 1999/02/10 21:51:36 hubbe Exp $ + * $Id: invert.c,v 1.9 2000/07/28 07:15:16 hubbe Exp $ * * INVERT crypto module for Pike * @@ -24,6 +24,9 @@ #include "stralloc.h" #include "builtin_functions.h" +/* THIS MUST BE INCLUDED LAST */ +#include "module_magic.h" + /* * Globals */ diff --git a/src/modules/_Crypto/md5.c b/src/modules/_Crypto/md5.c index 6d61a278ee..fa44e6d73e 100644 --- a/src/modules/_Crypto/md5.c +++ b/src/modules/_Crypto/md5.c @@ -1,5 +1,5 @@ /* - * $Id: md5.c,v 1.12 1999/02/10 21:51:38 hubbe Exp $ + * $Id: md5.c,v 1.13 2000/07/28 07:15:16 hubbe Exp $ * * A pike module for getting access to some common cryptos. * @@ -24,6 +24,9 @@ #include <md5.h> +/* THIS MUST BE INCLUDED LAST */ +#include "module_magic.h" + #undef THIS #define THIS ((struct md5_ctx *)(fp->current_storage)) #define OBTOCTX(o) ((struct md5_ctx *)(o->storage)) diff --git a/src/modules/_Crypto/nt.c b/src/modules/_Crypto/nt.c index 2a6438eae7..270a25c5bf 100644 --- a/src/modules/_Crypto/nt.c +++ b/src/modules/_Crypto/nt.c @@ -1,5 +1,5 @@ /* - * $Id: nt.c,v 1.2 2000/01/10 00:41:48 hubbe Exp $ + * $Id: nt.c,v 1.3 2000/07/28 07:15:16 hubbe Exp $ * * NT crypto stuff for Pike */ @@ -24,6 +24,8 @@ #include <wincrypt.h> +/* THIS MUST BE INCLUDED LAST */ +#include "module_magic.h" static struct program *cryptcontext_program = NULL; diff --git a/src/modules/_Crypto/pipe.c b/src/modules/_Crypto/pipe.c index 70a159ceda..07097680f5 100644 --- a/src/modules/_Crypto/pipe.c +++ b/src/modules/_Crypto/pipe.c @@ -1,5 +1,5 @@ /* - * $Id: pipe.c,v 1.16 2000/07/07 13:57:15 grubba Exp $ + * $Id: pipe.c,v 1.17 2000/07/28 07:15:16 hubbe Exp $ * * PIPE crypto module for Pike. * @@ -28,6 +28,9 @@ /* Prototypes */ #include "crypto.h" +/* THIS MUST BE INCLUDED LAST */ +#include "module_magic.h" + struct pike_crypto_pipe { struct object **objects; INT32 num_objs; diff --git a/src/modules/_Crypto/rsa.c b/src/modules/_Crypto/rsa.c index f66bc90ed9..569e7eccf1 100644 --- a/src/modules/_Crypto/rsa.c +++ b/src/modules/_Crypto/rsa.c @@ -1,5 +1,5 @@ /* - * $Id: rsa.c,v 1.21 2000/07/07 13:57:15 grubba Exp $ + * $Id: rsa.c,v 1.22 2000/07/28 07:15:16 hubbe Exp $ * * Glue to RSA BSAFE's RSA implementation. * @@ -31,7 +31,10 @@ #include <bsafe.h> -RCSID("$Id: rsa.c,v 1.21 2000/07/07 13:57:15 grubba Exp $"); +/* THIS MUST BE INCLUDED LAST */ +#include "module_magic.h" + +RCSID("$Id: rsa.c,v 1.22 2000/07/28 07:15:16 hubbe Exp $"); struct pike_rsa_data { diff --git a/src/modules/_Crypto/sha.c b/src/modules/_Crypto/sha.c index bae09246d3..ddf3a1f0f5 100644 --- a/src/modules/_Crypto/sha.c +++ b/src/modules/_Crypto/sha.c @@ -1,4 +1,4 @@ -/* $Id: sha.c,v 1.15 1999/02/10 21:51:41 hubbe Exp $ +/* $Id: sha.c,v 1.16 2000/07/28 07:15:16 hubbe Exp $ * * Written by Niels M�ller */ @@ -16,10 +16,13 @@ #include "module_support.h" #include "las.h" -RCSID("$Id: sha.c,v 1.15 1999/02/10 21:51:41 hubbe Exp $"); +RCSID("$Id: sha.c,v 1.16 2000/07/28 07:15:16 hubbe Exp $"); #include <sha.h> +/* THIS MUST BE INCLUDED LAST */ +#include "module_magic.h" + #undef THIS #define THIS ((struct sha_ctx *)(fp->current_storage)) #define OBTOCTX(o) ((struct sha_ctx *)(o->storage)) diff --git a/src/modules/_Image_JPEG/image_jpeg.c b/src/modules/_Image_JPEG/image_jpeg.c index 6013db3bc2..2ac12517f7 100644 --- a/src/modules/_Image_JPEG/image_jpeg.c +++ b/src/modules/_Image_JPEG/image_jpeg.c @@ -1,5 +1,5 @@ /* - * $Id: image_jpeg.c,v 1.29 2000/07/04 14:49:49 grubba Exp $ + * $Id: image_jpeg.c,v 1.30 2000/07/28 07:15:23 hubbe Exp $ */ #include "global.h" @@ -37,7 +37,7 @@ #ifdef HAVE_STDLIB_H #undef HAVE_STDLIB_H #endif -RCSID("$Id: image_jpeg.c,v 1.29 2000/07/04 14:49:49 grubba Exp $"); +RCSID("$Id: image_jpeg.c,v 1.30 2000/07/28 07:15:23 hubbe Exp $"); /* For some reason EXTERN can be defined here. * This is not good, since it confuses compilation.h. @@ -60,6 +60,9 @@ RCSID("$Id: image_jpeg.c,v 1.29 2000/07/04 14:49:49 grubba Exp $"); #include "builtin_functions.h" #include "module_support.h" +/* This must be included last! */ +#include "module_magic.h" + #ifdef HAVE_JPEGLIB_H #include "../Image/image.h" @@ -952,8 +955,6 @@ void image_jpeg_quant_tables(INT32 args) /*** module init & exit & stuff *****************************************/ -void f_index(INT32 args); - void pike_module_exit(void) { diff --git a/src/modules/_Image_TIFF/image_tiff.c b/src/modules/_Image_TIFF/image_tiff.c index 47c311dce1..4870465c15 100644 --- a/src/modules/_Image_TIFF/image_tiff.c +++ b/src/modules/_Image_TIFF/image_tiff.c @@ -6,14 +6,8 @@ **! */ - - - - - - #ifdef HAVE_LIBTIFF -RCSID("$Id: image_tiff.c,v 1.14 2000/07/07 13:57:27 grubba Exp $"); +RCSID("$Id: image_tiff.c,v 1.15 2000/07/28 07:15:29 hubbe Exp $"); #include "global.h" #include "machine.h" @@ -40,6 +34,9 @@ RCSID("$Id: image_tiff.c,v 1.14 2000/07/07 13:57:27 grubba Exp $"); #endif #include <tiffio.h> +/* This must be included last! */ +#include "module_magic.h" + #ifdef DYNAMIC_MODULE static struct program *image_program=NULL; static struct program *image_colortable_program=NULL; @@ -774,11 +771,15 @@ static void image_tiff_encode( INT32 args ) void my_tiff_warning_handler(const char* module, const char* fmt, ...){} void my_tiff_error_handler(const char* module, const char* fmt, ...){} +#else + +/* This must be included last! */ +#include "module_magic.h" + #endif /* HAVE_LIBTIFF */ void pike_module_init(void) { - extern void f_index(INT32); #ifdef HAVE_LIBTIFF #ifdef DYNAMIC_MODULE push_string(make_shared_string("Image")); push_int(0); diff --git a/src/modules/_Image_TTF/image_ttf.c b/src/modules/_Image_TTF/image_ttf.c index 4da2ab3a8d..445de32fef 100644 --- a/src/modules/_Image_TTF/image_ttf.c +++ b/src/modules/_Image_TTF/image_ttf.c @@ -1,12 +1,12 @@ /* - * $Id: image_ttf.c,v 1.30 2000/07/07 13:57:44 grubba Exp $ + * $Id: image_ttf.c,v 1.31 2000/07/28 07:15:35 hubbe Exp $ */ #include "config.h" #include "global.h" -RCSID("$Id: image_ttf.c,v 1.30 2000/07/07 13:57:44 grubba Exp $"); +RCSID("$Id: image_ttf.c,v 1.31 2000/07/28 07:15:35 hubbe Exp $"); #ifdef HAVE_LIBTTF #if defined(HAVE_FREETYPE_FREETYPE_H) && defined(HAVE_FREETYPE_FTXKERN_H) @@ -37,6 +37,7 @@ RCSID("$Id: image_ttf.c,v 1.30 2000/07/07 13:57:44 grubba Exp $"); #ifdef HAVE_LIBTTF #include "../Image/image.h" + #ifdef DYNAMIC_MODULE static struct program *image_program=NULL; #else @@ -48,6 +49,9 @@ static TT_Engine engine; #endif /* HAVE_LIBTTF */ +/* This must be included last! */ +#include "module_magic.h" + static struct pike_string *param_baseline; static struct pike_string *param_quality; @@ -1216,7 +1220,6 @@ static void image_ttf_faceinstance_face(INT32 args) /*** module init & exit & stuff *****************************************/ -void f_index(INT32 args); void pike_module_exit(void) { diff --git a/src/modules/_Image_XFace/image_xface.c b/src/modules/_Image_XFace/image_xface.c index 61acea8b10..acb547a9f0 100644 --- a/src/modules/_Image_XFace/image_xface.c +++ b/src/modules/_Image_XFace/image_xface.c @@ -1,5 +1,5 @@ #include "global.h" -RCSID("$Id: image_xface.c,v 1.8 1999/08/08 13:15:16 grubba Exp $"); +RCSID("$Id: image_xface.c,v 1.9 2000/07/28 07:15:41 hubbe Exp $"); #include "config.h" @@ -38,6 +38,9 @@ RCSID("$Id: image_xface.c,v 1.8 1999/08/08 13:15:16 grubba Exp $"); #include "../Image/image.h" +/* This must be included last! */ +#include "module_magic.h" + #ifdef DYNAMIC_MODULE static struct program *image_program=NULL; #else diff --git a/src/modules/dynamic_module_makefile.in b/src/modules/dynamic_module_makefile.in index 1b473e345e..8a5757a2b3 100644 --- a/src/modules/dynamic_module_makefile.in +++ b/src/modules/dynamic_module_makefile.in @@ -1,5 +1,5 @@ # -# $Id: dynamic_module_makefile.in,v 1.66 2000/04/11 20:59:03 grubba Exp $ +# $Id: dynamic_module_makefile.in,v 1.67 2000/07/28 07:11:41 hubbe Exp $ # @@ -16,7 +16,7 @@ BUILD_BASE=../.. MODULE_BASE=.. PIKE_INCLUDES=-I$(PIKE_SRC_DIR) -I$(BUILD_BASE) -PREFLAGS=-I. -I$(SRCDIR) $(PIKE_INCLUDES) -I. $(MODULE_CPPFLAGS) $(DEFINES) -DDYNAMIC_MODULE +PREFLAGS=-I. -I$(SRCDIR) $(PIKE_INCLUDES) -I. $(MODULE_CPPFLAGS) $(DEFINES) CFLAGS=$(MODULE_CFLAGS) $(PREFLAGS) $(OTHERFLAGS) @CCSHARED@ NOOPT_CFLAGS=$(PREFLAGS) $(NOOPTFLAGS) @CCSHARED@ $(MODULE_CFLAGS) diff --git a/src/modules/spider/discdate.c b/src/modules/spider/discdate.c index df8905cd38..47680f9a6d 100644 --- a/src/modules/spider/discdate.c +++ b/src/modules/spider/discdate.c @@ -23,7 +23,10 @@ #include <string.h> #include <stdio.h> -RCSID("$Id: discdate.c,v 1.6 1998/03/28 13:51:48 grubba Exp $"); +/* This must be included last! */ +#include "module_magic.h" + +RCSID("$Id: discdate.c,v 1.7 2000/07/28 07:15:49 hubbe Exp $"); struct disc_time { diff --git a/src/modules/spider/spider.c b/src/modules/spider/spider.c index 5fc642bf59..0f1e3924d7 100644 --- a/src/modules/spider/spider.c +++ b/src/modules/spider/spider.c @@ -43,7 +43,7 @@ #include "threads.h" #include "operators.h" -RCSID("$Id: spider.c,v 1.93 2000/06/29 09:55:04 per Exp $"); +RCSID("$Id: spider.c,v 1.94 2000/07/28 07:15:49 hubbe Exp $"); #ifdef HAVE_PWD_H #include <pwd.h> @@ -86,6 +86,10 @@ RCSID("$Id: spider.c,v 1.93 2000/06/29 09:55:04 per Exp $"); #include "dmalloc.h" + +/* This must be included last! */ +#include "module_magic.h" + #define MAX_PARSE_RECURSE 102 void do_html_parse(struct pike_string *ss, @@ -972,7 +976,6 @@ void f_get_all_active_fd(INT32 args) { int i,fds,q, ne; struct stat foo; - extern int fds_size; ne = fds_size; if( MAX_OPEN_FILEDESCRIPTORS > ne ) diff --git a/src/modules/spider/stardate.c b/src/modules/spider/stardate.c index 9396f5546c..3816f9ae91 100644 --- a/src/modules/spider/stardate.c +++ b/src/modules/spider/stardate.c @@ -1,5 +1,5 @@ /* - * $Id: stardate.c,v 1.8 1998/07/04 17:04:08 grubba Exp $ + * $Id: stardate.c,v 1.9 2000/07/28 07:15:49 hubbe Exp $ */ #include "global.h" @@ -17,7 +17,7 @@ #include "builtin_functions.h" #include "error.h" -RCSID("$Id: stardate.c,v 1.8 1998/07/04 17:04:08 grubba Exp $"); +RCSID("$Id: stardate.c,v 1.9 2000/07/28 07:15:49 hubbe Exp $"); #ifdef HAVE_SYS_TIME_H #include <sys/time.h> @@ -25,6 +25,9 @@ RCSID("$Id: stardate.c,v 1.8 1998/07/04 17:04:08 grubba Exp $"); #include <time.h> #define FIT(x,y) while((x)<0)(x)+=(y);while((x)>(y))(x)-=(y) +/* This must be included last! */ +#include "module_magic.h" + #define MAXPRECISION 7 #define OUTPUTFORMAT "%%%03d.%df" diff --git a/src/modules/spider/streamed_parser.c b/src/modules/spider/streamed_parser.c index 9dde903092..32938e1f49 100644 --- a/src/modules/spider/streamed_parser.c +++ b/src/modules/spider/streamed_parser.c @@ -1,5 +1,5 @@ /* - * $Id: streamed_parser.c,v 1.11 1998/07/04 17:04:49 grubba Exp $ + * $Id: streamed_parser.c,v 1.12 2000/07/28 07:15:49 hubbe Exp $ */ #include "global.h" @@ -24,7 +24,10 @@ #include "streamed_parser.h" -RCSID("$Id: streamed_parser.c,v 1.11 1998/07/04 17:04:49 grubba Exp $"); +/* This must be included last! */ +#include "module_magic.h" + +RCSID("$Id: streamed_parser.c,v 1.12 2000/07/28 07:15:49 hubbe Exp $"); #ifdef ENABLE_STREAMED_PARSER diff --git a/src/modules/spider/xml.c b/src/modules/spider/xml.c index b6ec6f9d1c..0e797455cd 100644 --- a/src/modules/spider/xml.c +++ b/src/modules/spider/xml.c @@ -18,6 +18,9 @@ #include "opcodes.h" #include "block_alloc.h" +/* This must be included last! */ +#include "module_magic.h" + /* FIXME: * recursive parsing will lock make the parser lock or * use up all memory and then crash... diff --git a/src/modules/sybase/.cvsignore b/src/modules/sybase/.cvsignore index 4883e34940..e5276b3700 100644 --- a/src/modules/sybase/.cvsignore +++ b/src/modules/sybase/.cvsignore @@ -1,4 +1,14 @@ +Makefile +config.log +config.status configure dependencies +linker_options +make_variables +modlist_headers +modlist_segment +module_testsuite +stamp-h stamp-h.in +sybase_config.h sybase_config.h.in diff --git a/src/modules/sybase/.gitignore b/src/modules/sybase/.gitignore index 25c610e638..20441abdc3 100644 --- a/src/modules/sybase/.gitignore +++ b/src/modules/sybase/.gitignore @@ -1,4 +1,14 @@ +/Makefile +/config.log +/config.status /configure /dependencies +/linker_options +/make_variables +/modlist_headers +/modlist_segment +/module_testsuite +/stamp-h /stamp-h.in +/sybase_config.h /sybase_config.h.in diff --git a/src/modules/sybase/sybase.c b/src/modules/sybase/sybase.c index ee97be64dc..29a43817f1 100644 --- a/src/modules/sybase/sybase.c +++ b/src/modules/sybase/sybase.c @@ -24,7 +24,7 @@ #include "sybase_config.h" #include "global.h" -RCSID("$Id: sybase.c,v 1.3 2000/05/09 23:13:34 neotron Exp $"); +RCSID("$Id: sybase.c,v 1.4 2000/07/28 07:15:57 hubbe Exp $"); #ifdef HAVE_SYBASE @@ -44,6 +44,8 @@ RCSID("$Id: sybase.c,v 1.3 2000/05/09 23:13:34 neotron Exp $"); #include "sybase.h" +/* This must be included last! */ +#include "module_magic.h" /* define this to enable debugging */ /* #define SYBDEBUG */ @@ -1249,6 +1251,9 @@ void pike_module_init (void) { #else /* HAVE_SYBASE */ +/* This must be included last! */ +#include "module_magic.h" + void pike_module_init (void) {} void pike_module_exit (void) {} #endif /* HAVE_SYBASE */ diff --git a/src/modules/system/configure.in b/src/modules/system/configure.in index e05af47eca..b7b0f9d7ec 100644 --- a/src/modules/system/configure.in +++ b/src/modules/system/configure.in @@ -1,4 +1,4 @@ -# $Id: configure.in,v 1.34 2000/01/17 02:34:04 hubbe Exp $ +# $Id: configure.in,v 1.35 2000/07/28 07:16:04 hubbe Exp $ AC_INIT(system.c) AC_CONFIG_HEADER(system_machine.h) @@ -8,6 +8,12 @@ AC_CHECK_LIB(bind, __inet_ntoa) AC_CHECK_LIB(socket, socket) AC_CHECK_LIB(nsl, gethostbyname) +if test x"$pike_cv_sys_os" = xWindows_NT ; then + # FIXME: These look suspiciouly much like 32bit versions. + # We probably want to use 64bit versions on IA64. + LIBS="-lkernel32 -lws2_32 -ladvapi32 $LIBS" +fi + AC_HAVE_HEADERS(syslog.h sys/syslog.h sys/types.h errno.h unistd.h pwd.h \ sys/conf.h sys/socket.h netinet/in.h arpa/inet.h netdb.h stdarg.h \ sys/utsname.h pwd.h passwd.h shadow.h grp.h sys/stat.h winsock.h \ diff --git a/src/post_modules/GL/auto.c.in b/src/post_modules/GL/auto.c.in index 028febd039..82dcdd5c54 100644 --- a/src/post_modules/GL/auto.c.in +++ b/src/post_modules/GL/auto.c.in @@ -1,5 +1,5 @@ /* - * $Id: auto.c.in,v 1.13 1999/11/07 01:43:31 per fake $ + * $Id: auto.c.in,v 1.14 2000/07/28 07:16:09 hubbe Exp $ * */ @@ -7,7 +7,7 @@ #include "config.h" -RCSID("$Id: auto.c.in,v 1.13 1999/11/07 01:43:31 per fake $"); +RCSID("$Id: auto.c.in,v 1.14 2000/07/28 07:16:09 hubbe Exp $"); #include "stralloc.h" #include "pike_macros.h" #include "object.h" @@ -29,6 +29,8 @@ RCSID("$Id: auto.c.in,v 1.13 1999/11/07 01:43:31 per fake $"); #include <GL/gl.h> #endif /* HAVE_GL_GL_H */ +#include "module_magic.h" + #define ZT_INT 1 #define ZT_FLOAT 2 #define ZT_DOUBLE 4 diff --git a/src/post_modules/GL/top.c b/src/post_modules/GL/top.c index ae5e1c700e..5062f746a2 100644 --- a/src/post_modules/GL/top.c +++ b/src/post_modules/GL/top.c @@ -1,5 +1,5 @@ /* - * $Id: top.c,v 1.11 1999/11/07 01:43:31 per fake $ + * $Id: top.c,v 1.12 2000/07/28 07:16:09 hubbe Exp $ * */ @@ -22,10 +22,11 @@ #endif /* HAVE_GL */ +#include "module_magic.h" #include "global.h" -RCSID("$Id: top.c,v 1.11 1999/11/07 01:43:31 per fake $"); +RCSID("$Id: top.c,v 1.12 2000/07/28 07:16:09 hubbe Exp $"); #include "stralloc.h" #include "pike_macros.h" #include "object.h" diff --git a/src/post_modules/GLUT/auto.c.in b/src/post_modules/GLUT/auto.c.in index 3a4fcb3e7f..af1dd1055a 100644 --- a/src/post_modules/GLUT/auto.c.in +++ b/src/post_modules/GLUT/auto.c.in @@ -1,5 +1,5 @@ /* - * $Id: auto.c.in,v 1.1 1999/11/14 00:01:49 per Exp $ + * $Id: auto.c.in,v 1.2 2000/07/28 07:16:16 hubbe Exp $ * */ @@ -7,7 +7,7 @@ #include "config.h" -RCSID("$Id: auto.c.in,v 1.1 1999/11/14 00:01:49 per Exp $"); +RCSID("$Id: auto.c.in,v 1.2 2000/07/28 07:16:16 hubbe Exp $"); #include "stralloc.h" #include "pike_macros.h" #include "object.h" @@ -24,6 +24,8 @@ RCSID("$Id: auto.c.in,v 1.1 1999/11/14 00:01:49 per Exp $"); #include <GL/glut.h> #endif +#include "module_magic.h" + static void pre_init() { } diff --git a/src/post_modules/GLUT/top.c b/src/post_modules/GLUT/top.c index e69d35a653..a72892e500 100644 --- a/src/post_modules/GLUT/top.c +++ b/src/post_modules/GLUT/top.c @@ -1,5 +1,5 @@ /* - * $Id: top.c,v 1.2 1999/12/12 21:51:31 per Exp $ + * $Id: top.c,v 1.3 2000/07/28 07:16:16 hubbe Exp $ * */ @@ -7,7 +7,7 @@ #include "config.h" -RCSID("$Id: top.c,v 1.2 1999/12/12 21:51:31 per Exp $"); +RCSID("$Id: top.c,v 1.3 2000/07/28 07:16:16 hubbe Exp $"); #include "stralloc.h" #include "pike_macros.h" #include "object.h" @@ -16,6 +16,8 @@ RCSID("$Id: top.c,v 1.2 1999/12/12 21:51:31 per Exp $"); #include "builtin_functions.h" #include "error.h" +#include "module_magic.h" + #ifdef HAVE_LIBGLUT #ifdef HAVE_GL_GLUT_H #define GLUT_API_VERSION 4 diff --git a/src/post_modules/GTK/dummy.c b/src/post_modules/GTK/dummy.c index 4d71c29d2d..8304682217 100644 --- a/src/post_modules/GTK/dummy.c +++ b/src/post_modules/GTK/dummy.c @@ -1,9 +1,11 @@ #include "global.h" #include "config.h" +#include "module_magic.h" -RCSID("$Id: dummy.c,v 1.1 1999/11/07 01:38:48 per Exp $"); +RCSID("$Id: dummy.c,v 1.2 2000/07/28 07:16:22 hubbe Exp $"); /* Well... Sort of basic, right? :-) */ + void pike_module_init() { } diff --git a/src/post_modules/GTK/pgtk.h b/src/post_modules/GTK/pgtk.h index e36fdabc54..84cd775feb 100644 --- a/src/post_modules/GTK/pgtk.h +++ b/src/post_modules/GTK/pgtk.h @@ -40,6 +40,8 @@ #define GTK_ACCEL_GROUP(X) ((void *)X) #include "../../modules/Image/image.h" +#include "module_magic.h" + struct object_wrapper { GtkObject *obj; -- GitLab