[51280] trunk/base/src/pextlib1.0
toby at macports.org
toby at macports.org
Thu May 21 23:27:46 PDT 2009
Revision: 51280
http://trac.macports.org/changeset/51280
Author: toby at macports.org
Date: 2009-05-21 23:27:45 -0700 (Thu, 21 May 2009)
Log Message:
-----------
Various header-related cleanup.
Remove a hack for Tcl <8.4
Modified Paths:
--------------
trunk/base/src/pextlib1.0/Pextlib.c
trunk/base/src/pextlib1.0/curl.c
trunk/base/src/pextlib1.0/fgetln.c
trunk/base/src/pextlib1.0/filemap.c
trunk/base/src/pextlib1.0/fs-traverse.c
trunk/base/src/pextlib1.0/md5cmd.c
trunk/base/src/pextlib1.0/readline.c
trunk/base/src/pextlib1.0/rmd160cmd.c
trunk/base/src/pextlib1.0/sha1cmd.c
trunk/base/src/pextlib1.0/strcasecmp.c
trunk/base/src/pextlib1.0/tty.c
trunk/base/src/pextlib1.0/tty.h
trunk/base/src/pextlib1.0/uid.c
trunk/base/src/pextlib1.0/vercomp.c
trunk/base/src/pextlib1.0/xinstall.c
Modified: trunk/base/src/pextlib1.0/Pextlib.c
===================================================================
--- trunk/base/src/pextlib1.0/Pextlib.c 2009-05-22 06:13:05 UTC (rev 51279)
+++ trunk/base/src/pextlib1.0/Pextlib.c 2009-05-22 06:27:45 UTC (rev 51280)
@@ -36,16 +36,13 @@
#include <config.h>
#endif
-#include <stdint.h>
-#include <stdio.h>
-#include <stdlib.h>
#include <ctype.h>
#include <errno.h>
#include <grp.h>
-
-#if HAVE_STRING_H
+#include <stdint.h>
+#include <stdio.h>
+#include <stdlib.h>
#include <string.h>
-#endif
#if HAVE_STRINGS_H
#include <strings.h>
Modified: trunk/base/src/pextlib1.0/curl.c
===================================================================
--- trunk/base/src/pextlib1.0/curl.c 2009-05-22 06:13:05 UTC (rev 51279)
+++ trunk/base/src/pextlib1.0/curl.c 2009-05-22 06:27:45 UTC (rev 51280)
@@ -34,14 +34,11 @@
#include <config.h>
#endif
-#include <stdio.h>
-#include <stdlib.h>
#include <ctype.h>
#include <errno.h>
-
-#if HAVE_STRING_H
+#include <stdio.h>
+#include <stdlib.h>
#include <string.h>
-#endif
#ifdef HAVE_UTIME_H
#include <utime.h>
@@ -50,18 +47,9 @@
#include <curl/curl.h>
#include <tcl.h>
-#include <tclDecls.h>
#include "curl.h"
-/* Avoid a warning with Tcl < 8.4, even if Tcl_GetIndexFromObj's tablePtr
-probably isn't modified. */
-#if (TCL_MAJOR_VERSION > 8) || (TCL_MINOR_VERSION >= 4)
-typedef CONST char* tableEntryString;
-#else
-typedef char* tableEntryString;
-#endif
-
/*
* Some compiled-in constants that we may wish to change later, given more
* empirical data. These represent "best guess" values for now.
@@ -81,6 +69,7 @@
int SetResultFromCurlErrorCode(Tcl_Interp* interp, CURLcode inErrorCode);
int CurlFetchCmd(Tcl_Interp* interp, int objc, Tcl_Obj* CONST objv[]);
int CurlIsNewerCmd(Tcl_Interp* interp, int objc, Tcl_Obj* CONST objv[]);
+int CurlGetSizeCmd(Tcl_Interp* interp, int objc, Tcl_Obj* CONST objv[]);
/* ========================================================================= **
* Entry points
@@ -829,7 +818,7 @@
kCurlGetSize
} EOption;
- static tableEntryString options[] = {
+ static const char *options[] = {
"fetch", "isnewer", "getsize", NULL
};
int theResult = TCL_OK;
Modified: trunk/base/src/pextlib1.0/fgetln.c
===================================================================
--- trunk/base/src/pextlib1.0/fgetln.c 2009-05-22 06:13:05 UTC (rev 51279)
+++ trunk/base/src/pextlib1.0/fgetln.c 2009-05-22 06:27:45 UTC (rev 51280)
@@ -35,10 +35,7 @@
#if !HAVE_FGETLN
#include <stdio.h>
#include <stdlib.h>
-
-#if HAVE_STRING_H
#include <string.h>
-#endif
#define BUFCHUNKS BUFSIZ
Modified: trunk/base/src/pextlib1.0/filemap.c
===================================================================
--- trunk/base/src/pextlib1.0/filemap.c 2009-05-22 06:13:05 UTC (rev 51279)
+++ trunk/base/src/pextlib1.0/filemap.c 2009-05-22 06:27:45 UTC (rev 51280)
@@ -34,15 +34,12 @@
#include <config.h>
#endif
-#include <stdio.h>
-#include <stdlib.h>
#include <ctype.h>
#include <errno.h>
#include <grp.h>
-
-#if HAVE_STRING_H
+#include <stdio.h>
+#include <stdlib.h>
#include <string.h>
-#endif
#if HAVE_STRINGS_H
#include <strings.h>
@@ -222,6 +219,7 @@
int SetResultFromErrorCode(Tcl_Interp* interp, int inErrorCode);
SFilemapObject* GetObjectFromVarName(Tcl_Interp* interp, Tcl_Obj* inVarName);
int FilemapCloseCmd(Tcl_Interp* interp, int objc, Tcl_Obj* CONST objv[]);
+int FilemapCreateCmd(Tcl_Interp* interp, int objc, Tcl_Obj* CONST objv[]);
int FilemapExistsCmd(Tcl_Interp* interp, int objc, Tcl_Obj* CONST objv[]);
int FilemapGetCmd(Tcl_Interp* interp, int objc, Tcl_Obj* CONST objv[]);
int FilemapIsReadOnlyCmd(Tcl_Interp* interp, int objc, Tcl_Obj* CONST objv[]);
Modified: trunk/base/src/pextlib1.0/fs-traverse.c
===================================================================
--- trunk/base/src/pextlib1.0/fs-traverse.c 2009-05-22 06:13:05 UTC (rev 51279)
+++ trunk/base/src/pextlib1.0/fs-traverse.c 2009-05-22 06:27:45 UTC (rev 51280)
@@ -58,6 +58,8 @@
#include <tcl.h>
+#include "fs-traverse.h"
+
static int do_traverse(Tcl_Interp *interp, int flags, char * CONST *targets, Tcl_Obj *varname, Tcl_Obj *body);
#define F_DEPTH 0x1
Modified: trunk/base/src/pextlib1.0/md5cmd.c
===================================================================
--- trunk/base/src/pextlib1.0/md5cmd.c 2009-05-22 06:13:05 UTC (rev 51279)
+++ trunk/base/src/pextlib1.0/md5cmd.c 2009-05-22 06:27:45 UTC (rev 51280)
@@ -34,12 +34,10 @@
#include <config.h>
#endif
-#include <tcl.h>
-
-#if HAVE_STRING_H
#include <string.h>
-#endif
+#include <tcl.h>
+
#if defined(HAVE_LIBCRYPTO) && !defined(HAVE_LIBMD)
/* Minimal wrapper around OpenSSL's libcrypto, as a compatibility
Modified: trunk/base/src/pextlib1.0/readline.c
===================================================================
--- trunk/base/src/pextlib1.0/readline.c 2009-05-22 06:13:05 UTC (rev 51279)
+++ trunk/base/src/pextlib1.0/readline.c 2009-05-22 06:27:45 UTC (rev 51280)
@@ -12,16 +12,13 @@
#include <config.h>
#endif
+#include <stdio.h>
+#include <string.h>
+
#if HAVE_STDLIB_H
#include <stdlib.h>
#endif
-#if HAVE_STRING_H
-#include <string.h>
-#endif
-
-#include <stdio.h>
-
#if HAVE_READLINE_READLINE_H
#include <readline/readline.h>
#endif
@@ -31,9 +28,9 @@
#endif
#include <tcl.h>
+
#include "readline.h"
-
/* Globals */
#if HAVE_READLINE_READLINE_H
Tcl_Interp* completion_interp = NULL;
Modified: trunk/base/src/pextlib1.0/rmd160cmd.c
===================================================================
--- trunk/base/src/pextlib1.0/rmd160cmd.c 2009-05-22 06:13:05 UTC (rev 51279)
+++ trunk/base/src/pextlib1.0/rmd160cmd.c 2009-05-22 06:27:45 UTC (rev 51280)
@@ -34,12 +34,10 @@
#include <config.h>
#endif
-#include <tcl.h>
-
-#if HAVE_STRING_H
#include <string.h>
-#endif
+#include <tcl.h>
+
#if !defined(HAVE_LIBMD)
/* We do not have libmd.
Modified: trunk/base/src/pextlib1.0/sha1cmd.c
===================================================================
--- trunk/base/src/pextlib1.0/sha1cmd.c 2009-05-22 06:13:05 UTC (rev 51279)
+++ trunk/base/src/pextlib1.0/sha1cmd.c 2009-05-22 06:27:45 UTC (rev 51280)
@@ -35,12 +35,10 @@
#include <config.h>
#endif
-#include <tcl.h>
-
-#if HAVE_STRING_H
#include <string.h>
-#endif
+#include <tcl.h>
+
#if defined(HAVE_LIBCRYPTO) && !defined(HAVE_LIBMD)
/* Minimal wrapper around OpenSSL's libcrypto, as a compatibility
Modified: trunk/base/src/pextlib1.0/strcasecmp.c
===================================================================
--- trunk/base/src/pextlib1.0/strcasecmp.c 2009-05-22 06:13:05 UTC (rev 51279)
+++ trunk/base/src/pextlib1.0/strcasecmp.c 2009-05-22 06:27:45 UTC (rev 51280)
@@ -30,9 +30,11 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
+#include <ctype.h>
#include <string.h>
-#include <ctype.h>
+#include "strcasecmp.h"
+
/* ------------------------------------------------------------------------- **
* xstrcasecmp
* ------------------------------------------------------------------------- */
Modified: trunk/base/src/pextlib1.0/tty.c
===================================================================
--- trunk/base/src/pextlib1.0/tty.c 2009-05-22 06:13:05 UTC (rev 51279)
+++ trunk/base/src/pextlib1.0/tty.c 2009-05-22 06:27:45 UTC (rev 51280)
@@ -45,6 +45,8 @@
#include <tcl.h>
+#include "tty.h"
+
int IsattyCmd(ClientData clientData UNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])
{
Tcl_Obj *tcl_result;
Modified: trunk/base/src/pextlib1.0/tty.h
===================================================================
--- trunk/base/src/pextlib1.0/tty.h 2009-05-22 06:13:05 UTC (rev 51279)
+++ trunk/base/src/pextlib1.0/tty.h 2009-05-22 06:27:45 UTC (rev 51280)
@@ -36,8 +36,6 @@
#ifndef _PEXTLIB_TTY_H
#define _PEXTLIB_TTY_H
-#include <tcl.h>
-
/**
* A wrapper for isatty(3)
*/
Modified: trunk/base/src/pextlib1.0/uid.c
===================================================================
--- trunk/base/src/pextlib1.0/uid.c 2009-05-22 06:13:05 UTC (rev 51279)
+++ trunk/base/src/pextlib1.0/uid.c 2009-05-22 06:27:45 UTC (rev 51280)
@@ -8,21 +8,17 @@
*
*/
-#include "uid.h"
-#include "grp.h"
-
#if HAVE_CONFIG_H
#include <config.h>
#endif
+#include <grp.h>
+#include <string.h>
+
#if HAVE_STDLIB_H
#include <stdlib.h>
#endif
-#if HAVE_STRING_H
-#include <string.h>
-#endif
-
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
@@ -41,6 +37,8 @@
#include <tcl.h>
+#include "uid.h"
+
/*
getuid
Modified: trunk/base/src/pextlib1.0/vercomp.c
===================================================================
--- trunk/base/src/pextlib1.0/vercomp.c 2009-05-22 06:13:05 UTC (rev 51279)
+++ trunk/base/src/pextlib1.0/vercomp.c 2009-05-22 06:27:45 UTC (rev 51280)
@@ -38,18 +38,13 @@
#include <config.h>
#endif
-#include <stdlib.h>
#include <ctype.h>
-#include <tcl.h>
-
-#if HAVE_STRING_H
#include <string.h>
-#endif
-#if HAVE_STRINGS_H
-#include <strings.h>
-#endif
+#include <tcl.h>
+#include "vercomp.h"
+
/*
* If A is newer than B, return an integer > 0
* If A and B are equal, return 0
Modified: trunk/base/src/pextlib1.0/xinstall.c
===================================================================
--- trunk/base/src/pextlib1.0/xinstall.c 2009-05-22 06:13:05 UTC (rev 51279)
+++ trunk/base/src/pextlib1.0/xinstall.c 2009-05-22 06:27:45 UTC (rev 51280)
@@ -78,6 +78,8 @@
#define _PATH_DEVNULL "/dev/null"
#endif
+#include "xinstall.h"
+
#ifndef MAXBSIZE
#define MAXBSIZE 65536
#endif
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20090521/07fe3df7/attachment-0001.html>
More information about the macports-changes
mailing list