|
|
Author: bernhard
Date: Wed Feb 27 12:03:10 2008
New Revision: 26110
Modified:
trunk/config/gen/platform/win32/dl.c
trunk/config/gen/platform/win32/env.c
trunk/config/gen/platform/win32/exec.c
trunk/config/gen/platform/win32/misc.c
trunk/config/gen/platform/win32/stat.c
Log:
#50768: [PATCH] Update Win32 platform documentation.
Courtesy of Andrew Whitworth
Modified: trunk/config/gen/platform/win32/dl.c
==============================================================================
--- trunk/config/gen/platform/win32/dl.c (original)
+++ trunk/config/gen/platform/win32/dl.c Wed Feb 27 12:03:10 2008
@@ -1,6 +1,6 @@
/*
* $Id$
- * Copyright (C) 2004-2006, The Perl Foundation.
+ * Copyright (C) 2004-2008, The Perl Foundation.
*/
/*
@@ -11,7 +11,7 @@
=head1 DESCRIPTION
-RT#48264
+Functions for working with dynamic libraries under windows.
=head2 Functions
@@ -25,7 +25,8 @@
=item C<void * Parrot_dlopen(const char *filename)>
-RT#48260: Not yet documented!!!
+Opens a dynamic library, and returns a system handle to that library.
+Returns Parrot_dlerror() on failure.
=cut
@@ -41,7 +42,7 @@
=item C<const char * Parrot_dlerror(void)>
-RT#48260: Not yet documented!!!
+System-dependant error code that indicates failure in opening a DL.
=cut
@@ -57,7 +58,16 @@
=item C<void * Parrot_dlsym(void *handle, const char *symbol)>
-RT#48260: Not yet documented!!!
+Returns a pointer to the specified function in the given library. The library
must have been opened already with
+Parrot_dlopen(). To call the function "int Foo(int)" from the library "Bar" ,
you would write something similar to:
+
+ void *lib;
+ int (*Foo_ptr)(int);
+ lib = Parrot_dlopen("Bar");
+ if(lib != Parrot_dlerror())
+ {
+ Foo_ptr = Parrot_dlsym(lib, "Foo");
+ }
=cut
@@ -73,8 +83,16 @@
=item C<int Parrot_dlclose(void *handle)>
-RT#48260: Not yet documented!!!
-
+Closes a dynamic library handle.
+
+ void *lib;
+ lib = Parrot_dlopen("Foo");
+ if(lib != Parrot_dlerror())
+ {
+ ...
+ Parrot_dlclose(lib);
+ }
+
=cut
*/
Modified: trunk/config/gen/platform/win32/env.c
==============================================================================
--- trunk/config/gen/platform/win32/env.c (original)
+++ trunk/config/gen/platform/win32/env.c Wed Feb 27 12:03:10 2008
@@ -35,7 +35,8 @@
=item C<void Parrot_setenv(const char *name, const char *value)>
-RT#48260: Not yet documented!!!
+Sets the environment variable C<name> to the value C<value>. Creates the
environment variable if it
+does not exist, and silently overwrite a variable if it does exist.
=cut
@@ -85,7 +86,10 @@
=item C<char *
Parrot_getenv(ARGIN(const char *name), NOTNULL(int *free_it))>
-RT#48260: Not yet documented!!!
+Gets the environment variable C<name>, if it exists. Returns status in
C<free_it>. C<free_it> must
+be a non-null pointer to an integer to receive the status. Status code is 1 on
success, 0 on
+failure. Returns the contents of the environment variable in a C<malloc>'d
memory location that
+needs to be freed later.
=cut
@@ -114,7 +118,7 @@
=item C<void Parrot_unsetenv(const char *name)>
-RT#48260: Not yet documented!!!
+Deletes an environment variable by assigning an empty string to the specified
variable.
=cut
Modified: trunk/config/gen/platform/win32/exec.c
==============================================================================
--- trunk/config/gen/platform/win32/exec.c (original)
+++ trunk/config/gen/platform/win32/exec.c Wed Feb 27 12:03:10 2008
@@ -1,6 +1,6 @@
/*
* $Id$
- * Copyright (C) 2004-2006, The Perl Foundation.
+ * Copyright (C) 2004-2008, The Perl Foundation.
*/
/*
@@ -11,7 +11,7 @@
=head1 DESCRIPTION
-RT#48264
+Functions for dealing with child processes and Execs.
=head2 Functions
@@ -28,7 +28,8 @@
=item C<INTVAL
Parrot_Run_OS_Command(Parrot_Interp interp, STRING *command)>
-Spawn a subprocess
+Spawn the subprocess specified in C<command>. Waits for the process to
complete, and then returns the exit code
+in POSIX-compatibility mode.
=cut
@@ -79,7 +80,9 @@
=item C<INTVAL
Parrot_Run_OS_Command_Argv(Parrot_Interp interp, PMC *cmdargs)>
-RT#48260: Not yet documented!!!
+Spawns a subprocess with the arguments provided in the C<cmdargs> PMC array.
The first array element should
+be the name of the process to spawn, and the remainder of the array elements
should be arguments. Waits until
+the child process completes, and returns the exit code in POSIX-compatibility
mode.
=cut
@@ -148,7 +151,8 @@
=item C<void
Parrot_Exec_OS_Command(Parrot_Interp interp, STRING *command)>
-RT#48260: Not yet documented!!!
+Exits parrot and passes control to the specified process. Does not return.
Raises an exception
+if the exec fails.
=cut
Modified: trunk/config/gen/platform/win32/misc.c
==============================================================================
--- trunk/config/gen/platform/win32/misc.c (original)
+++ trunk/config/gen/platform/win32/misc.c Wed Feb 27 12:03:10 2008
@@ -34,7 +34,7 @@
void
Parrot_platform_init_code(void)
{
- SetErrorMode(SEM_NOGPFAULTERRORBOX);
+ SetErrorMode(SEM_NOGPFAULTERRORBOX);
}
/*
Modified: trunk/config/gen/platform/win32/stat.c
==============================================================================
--- trunk/config/gen/platform/win32/stat.c (original)
+++ trunk/config/gen/platform/win32/stat.c Wed Feb 27 12:03:10 2008
@@ -59,7 +59,15 @@
=item C<INTVAL
Parrot_stat_info_intval(Parrot_Interp interp, STRING *file, INTVAL thing)>
-RT#48260: Not yet documented!!!
+Stats the file, and returns the information specified by C<thing>. C<thing>
can be one of:
+C<STAT_EXISTS>, C<STAT_FILESIZE>, C<STAT_ISDIR>, C<STAT_ISDEV>,
C<STAT_ACCESSTIME>,
+C<STAT_MODIFYTIME>, C<STAT_CHANGETIME>, C<STAT_UID>, C<STAT_GID>,
C<STAT_PLATFORM_DEV>,
+C<STAT_PLATFORM_INODE>, C<STAT_PLATFORM_NLINKS>, C<STAT_PLATFORM_DEVTYPE>.
+
+C<STAT_BACKUPTIME> and C<STAT_CREATETIME> are not supported on Win32, so will
return -1.
+
+C<STAT_PLATFORM_BLOCKS> and C<STAT_PLATFORM_BLOCKSIZE> are not supported by
Win32 and will throw an
+exception.
=cut
@@ -147,7 +155,15 @@
=item C<INTVAL
Parrot_fstat_info_intval(Parrot_Interp interp, INTVAL file, INTVAL thing)>
-RT#48260: Not yet documented!!!
+Fstats the file, and returns the information specified by C<thing>. C<thing>
can be one of:
+C<STAT_EXISTS>, C<STAT_FILESIZE>, C<STAT_ISDIR>, C<STAT_ISDEV>,
C<STAT_ACCESSTIME>,
+C<STAT_MODIFYTIME>, C<STAT_CHANGETIME>, C<STAT_UID>, C<STAT_GID>,
C<STAT_PLATFORM_DEV>,
+C<STAT_PLATFORM_INODE>, C<STAT_PLATFORM_NLINKS>, C<STAT_PLATFORM_DEVTYPE>.
+
+C<STAT_BACKUPTIME> and C<STAT_CREATETIME> are not supported on Win32, so will
return -1.
+
+C<STAT_PLATFORM_BLOCKS> and C<STAT_PLATFORM_BLOCKSIZE> are not supported by
Win32 and will throw an
+exception.
=cut
|
|