[Mono-list] Wrapper additions

Jim Richardson develop@wtfo.wtfo-guru.com
Tue, 18 Sep 2001 22:29:21 -0500


I need the opendir, readdir, closedir in the Directory/DirectoryInfo
classes,
and the getenv, environ in the Environment class.

===================================================================
RCS file: /cvs/public/mono/mono/wrapper/genwrapper.pl,v
retrieving revision 1.4
diff -r1.4 genwrapper.pl
73a74,88
> create_func ($lib, "", "opendir", "IntPtr",
>            "string", "path");
>
> create_func ($lib, "", "readdir", "IntPtr",
>            "IntPtr", "dir");
>
> create_func ($lib, "", "closedir", "int",
>            "IntPtr", "dir");
>
> create_func ($lib, "", "getenv", "IntPtr",
>            "string", "variable");
>
> create_func ($lib, "", "environ", "IntPtr");
>
>
Index: wrapper.c
===================================================================
RCS file: /cvs/public/mono/mono/wrapper/wrapper.c,v
retrieving revision 1.2
diff -r1.2 wrapper.c
2a3,4
> #include <dirent.h>
> #include <stdlib.h>
95a98,128
> int
> mono_wrapper_opendir (const char * path)
> {
>       return (int)opendir(path);
> }
>
> int
> mono_wrapper_readdir (int dir)
> {
>       /* WARNING: Not thread safe */
>       return (int)readdir((DIR*)dir);
> }
>
> gint32
> mono_wrapper_closedir (int dir)
> {
>       return closedir((DIR*)dir);
> }
>
> int
> mono_wrapper_getenv (const char * variable)
> {
>       /* WARNING: Not thread safe */
>       return (int)getenv(variable);
> }
>
> int
> mono_wrapper_environ ()
> {
>       return (int)environ;
> }
\ No newline at end of file
cvs server: I know nothing about wrapper.h

jrichardson@JIMR-LAPTOP ~/cvsmono/mono/mono/wrapper
$ cvs diff genwrapper.pl wrapper.c
Enter passphrase for key '/home/jrichardson/.ssh/id_rsa':
Index: genwrapper.pl
===================================================================
RCS file: /cvs/public/mono/mono/wrapper/genwrapper.pl,v
retrieving revision 1.4
diff -r1.4 genwrapper.pl
73a74,88
> create_func ($lib, "", "opendir", "IntPtr",
>            "string", "path");
>
> create_func ($lib, "", "readdir", "IntPtr",
>            "IntPtr", "dir");
>
> create_func ($lib, "", "closedir", "int",
>            "IntPtr", "dir");
>
> create_func ($lib, "", "getenv", "IntPtr",
>            "string", "variable");
>
> create_func ($lib, "", "environ", "IntPtr");
>
>
Index: wrapper.c
===================================================================
RCS file: /cvs/public/mono/mono/wrapper/wrapper.c,v
retrieving revision 1.2
diff -r1.2 wrapper.c
2a3,4
> #include <dirent.h>
> #include <stdlib.h>
95a98,128
> int
> mono_wrapper_opendir (const char * path)
> {
>       return (int)opendir(path);
> }
>
> int
> mono_wrapper_readdir (int dir)
> {
>       /* WARNING: Not thread safe */
>       return (int)readdir((DIR*)dir);
> }
>
> gint32
> mono_wrapper_closedir (int dir)
> {
>       return closedir((DIR*)dir);
> }
>
> int
> mono_wrapper_getenv (const char * variable)
> {
>       /* WARNING: Not thread safe */
>       return (int)getenv(variable);
> }
>
> int
> mono_wrapper_environ ()
> {
>       return (int)environ;
> }