Browse Source

simplify wingrass LFS

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@56982 15284696-431f-4ddb-bdfa-cd5b030d7da7
Markus Metz 11 years ago
parent
commit
623c7b94ec

+ 1 - 2
display/d.font/main.c

@@ -17,7 +17,6 @@
  *               for details.
  *
  *****************************************************************************/
-#include <grass/config.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -99,7 +98,7 @@ int main(int argc, char **argv)
     }
 
     if (opt2->answer) {		/* Full path to freetype font */
-	STRUCT_STAT info;
+	struct stat info;
 
 	/* Check a valid filename has been supplied */
 	if (stat(opt2->answer, &info) != 0)

+ 2 - 2
general/g.access/get_perms.c

@@ -1,11 +1,11 @@
-#include <grass/config.h>
 #include <sys/types.h>
 #include <sys/stat.h>
+#include <grass/config.h>
 #include "access.h"
 
 int get_perms(char *path, int *perms, int *group, int *other)
 {
-    STRUCT_STAT buf;
+    struct stat buf;
 
     if (stat(path, &buf) != 0)
 	return -1;

+ 1 - 2
general/g.mkfontcap/freetype_fonts.c

@@ -14,7 +14,6 @@
  *
  *****************************************************************************/
 
-#include <grass/config.h>
 #include <stdio.h>
 #include <string.h>
 #include <sys/types.h>
@@ -84,7 +83,7 @@ static void find_fonts(const char *dirpath)
     char filepath[GPATH_MAX];
     DIR *curdir;
     struct dirent *cur_entry;
-    STRUCT_STAT info;
+    struct stat info;
 
     curdir = opendir(dirpath);
     if (curdir == NULL)

+ 0 - 8
include/config.h.in

@@ -297,20 +297,12 @@
 #include <sys/stat.h>
 #define stat _stati64
 #define fstat _fstati64
-#define _STRUCT_STAT_
-typedef struct _stati64 STRUCT_STAT;
 
 #endif /* MINGW32 LFS */
 
 #endif	/* HAVE_LARGEFILES */
 
 
-#ifndef _STRUCT_STAT_
-#define _STRUCT_STAT_
-#include <sys/stat.h>
-typedef struct stat STRUCT_STAT;
-#endif
-
 /* define if langinfo.h exists */
 #undef HAVE_LANGINFO_H
 

+ 2 - 2
include/defs/gis.h

@@ -498,8 +498,8 @@ int G_is_dirsep(char);
 int G_is_absolute_path(const char *);
 char *G_convert_dirseps_to_host(char *);
 char *G_convert_dirseps_from_host(char *);
-int G_lstat(const char *, STRUCT_STAT *);
-int G_stat(const char *, STRUCT_STAT *);
+int G_lstat(const char *, struct stat *);
+int G_stat(const char *, struct stat *);
 int G_owner(const char *);
 
 /* percent.c */

+ 1 - 1
include/iostream/ami_stream.h

@@ -412,7 +412,7 @@ off_t AMI_STREAM<T>::stream_len(void) {
 
   return (st_size / sizeof(T));
 #else
-  STRUCT_STAT buf;
+  struct stat buf;
   if (stat(path, &buf) == -1) {
     perror("AMI_STREAM::stream_len(): fstat failed ");
     DEBUG_ASSERT assert(0);

+ 1 - 1
lib/db/dbmi_base/isdir.c

@@ -28,7 +28,7 @@
 */
 int db_isdir(const char *path)
 {
-    STRUCT_STAT x;
+    struct stat x;
 
     if (stat(path, &x) != 0)
 	return DB_FAILED;

+ 1 - 1
lib/gis/copy_dir.c

@@ -63,7 +63,7 @@
 int G_recursive_copy(const char *src, const char *dst)
 {
     DIR *dirp;
-    STRUCT_STAT sb;
+    struct stat sb;
 
     if (G_lstat(src, &sb) < 0)
 	return 1;

+ 3 - 3
lib/gis/mapset_msc.c

@@ -88,7 +88,7 @@ int G__make_mapset_element_misc(const char *dir, const char *name)
     return G__make_mapset_element(buf);
 }
 
-static int check_owner(const STRUCT_STAT *info)
+static int check_owner(const struct stat *info)
 {
 #if defined(__MINGW32__) || defined(SKIP_MAPSET_OWN_CHK)
     return 1;
@@ -116,7 +116,7 @@ static int check_owner(const STRUCT_STAT *info)
 int G__mapset_permissions(const char *mapset)
 {
     char path[GPATH_MAX];
-    STRUCT_STAT info;
+    struct stat info;
 
     G_file_name(path, "", "", mapset);
 
@@ -146,7 +146,7 @@ int G__mapset_permissions2(const char *gisdbase, const char *location,
 			   const char *mapset)
 {
     char path[GPATH_MAX];
-    STRUCT_STAT info;
+    struct stat info;
 
     sprintf(path, "%s/%s/%s", gisdbase, location, mapset);
 

+ 1 - 1
lib/gis/mapset_nme.c

@@ -159,7 +159,7 @@ char **G_available_mapsets(void)
 
     while ((ent = readdir(dir))) {
 	char buf[GPATH_MAX];
-	STRUCT_STAT st;
+	struct stat st;
 
 	sprintf(buf, "%s/%s/WIND", G_location_path(), ent->d_name);
 

+ 7 - 7
lib/gis/paths.c

@@ -120,12 +120,12 @@ char *G_convert_dirseps_from_host(char *path)
  * Returns information about the specified file.
  *
  * \param file_name file name
- * \param stat
+ * \param stat pointer to structure filled with file information
  *
  * \return Return value from system lstat function
  **/
 
-int G_stat(const char *file_name, STRUCT_STAT *buf)
+int G_stat(const char *file_name, struct stat *buf)
 {
     return stat(file_name, buf);
 }
@@ -135,14 +135,14 @@ int G_stat(const char *file_name, STRUCT_STAT *buf)
  *
  * Returns information about the specified file.
  *
- * \param file_name file name
- * \param stat in the case of a symbolic link, the link itself is
- *             stat-ed, not the file that it refers to
+ * \param file_name file name, in the case of a symbolic link, the 
+ *                  link itself is stat-ed, not the file that it refers to
+ * \param stat pointer to structure filled with file information
  *
  * \return Return value from system lstat function
  **/
 
-int G_lstat(const char *file_name, STRUCT_STAT *buf)
+int G_lstat(const char *file_name, struct stat *buf)
 {
 #ifdef __MINGW32__
     return stat(file_name, buf);
@@ -165,7 +165,7 @@ int G_owner(const char *path)
 {
 
 #ifndef __MINGW32__
-    STRUCT_STAT info;
+    struct stat info;
 
     G_stat(path, &info);
 

+ 1 - 1
lib/gis/remove.c

@@ -106,7 +106,7 @@ static int recursive_remove(const char *path)
 {
     DIR *dirp;
     struct dirent *dp;
-    STRUCT_STAT sb;
+    struct stat sb;
     char path2[GPATH_MAX];
 
     if (G_lstat(path, &sb))

+ 2 - 2
lib/gis/user_config.c

@@ -59,7 +59,7 @@ static char *_make_toplevel(void)
     uid_t me;
     struct passwd *my_passwd;
 #endif
-    STRUCT_STAT buf;
+    struct stat buf;
     char *path;
 
     errno = 0;
@@ -194,7 +194,7 @@ static char *_make_sublevels(const char *elems)
 {
     int i, status;
     char *cp, *path, *top, *ptr;
-    STRUCT_STAT buf;
+    struct stat buf;
 
     /* Get top level path */
     if (NULL == (top = _make_toplevel()))

+ 1 - 1
lib/init/clean_temp.c

@@ -42,7 +42,7 @@ void clean_dir(const char *pathname, uid_t uid, pid_t pid, time_t now,
     char buf[BUF_MAX];
     DIR *curdir;
     struct dirent *cur_entry;
-    STRUCT_STAT info;
+    struct stat info;
     int n, pathlen;
 
     curdir = opendir(pathname);

+ 1 - 1
lib/vector/Vlib/open.c

@@ -894,7 +894,7 @@ int Vect_open_tmp_new(struct Map_info *Map, const char *name, int with_z)
 int Vect_coor_info(const struct Map_info *Map, struct Coor_info *Info)
 {
     char *path, file_path[GPATH_MAX];
-    STRUCT_STAT stat_buf;
+    struct stat stat_buf;
     
     switch (Map->format) {
     case GV_FORMAT_NATIVE:

+ 1 - 1
lib/vector/dglib/examples/parse.c

@@ -117,7 +117,7 @@ int main(int argc, char **argv)
 
     unsigned char *pbNodeAttr, *pbEdgeAttr, *pbToNodeAttr;
 
-    STRUCT_STAT statdata;
+    struct stat statdata;
 
     dglGraph_s graphOut;
 

+ 1 - 1
lib/vector/diglib/file.c

@@ -189,7 +189,7 @@ int dig_file_load(struct gvfile * file)
     int ret, mode, load;
     const char *cmode;
     size_t size;
-    STRUCT_STAT sbuf;
+    struct stat sbuf;
 
     G_debug(2, "dig_file_load ()");
 

+ 1 - 1
raster/r.li/r.li.daemon/daemon.c

@@ -181,7 +181,7 @@ int calculateIndex(char *file, int f(int, char **, struct area_entry *, double *
 
 int parseSetup(char *path, struct list *l, struct g_area *g, char *raster)
 {
-    STRUCT_STAT s;
+    struct stat s;
     struct Cell_head cellhd;
     char *buf;
     const char *token;

+ 1 - 1
vector/v.mapcalc/map.c

@@ -129,7 +129,7 @@ static void find_maps(void)
 	return;
 
     while ((ent = readdir(dir)) != NULL) {
-	STRUCT_STAT buf;
+	struct stat buf;
 
 	if (!strcmp(ent->d_name, ".") || !strcmp(ent->d_name, ".."))
 	    continue;