[GRASS-SVN] r69523 - in grass-addons/grass7/raster3d: . r3.profile

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Sep 18 19:16:56 PDT 2016


Author: wenzeslaus
Date: 2016-09-18 19:16:56 -0700 (Sun, 18 Sep 2016)
New Revision: 69523

Added:
   grass-addons/grass7/raster3d/r3.profile/double_list.c
   grass-addons/grass7/raster3d/r3.profile/double_list.h
Modified:
   grass-addons/grass7/raster3d/Makefile
   grass-addons/grass7/raster3d/r3.profile/
Log:
r3.profile: add missing files, propset, add to parent makefile

Modified: grass-addons/grass7/raster3d/Makefile
===================================================================
--- grass-addons/grass7/raster3d/Makefile	2016-09-19 02:09:40 UTC (rev 69522)
+++ grass-addons/grass7/raster3d/Makefile	2016-09-19 02:16:56 UTC (rev 69523)
@@ -1,6 +1,7 @@
 MODULE_TOPDIR = ..
 
 SUBDIRS = \
+	r3.profile
 	r3.what
 
 include $(MODULE_TOPDIR)/include/Make/Dir.make


Property changes on: grass-addons/grass7/raster3d/r3.profile
___________________________________________________________________
Modified: svn:ignore
   - OBJ.*

   + OBJ.*
*.tmp.html


Added: grass-addons/grass7/raster3d/r3.profile/double_list.c
===================================================================
--- grass-addons/grass7/raster3d/r3.profile/double_list.c	                        (rev 0)
+++ grass-addons/grass7/raster3d/r3.profile/double_list.c	2016-09-19 02:16:56 UTC (rev 69523)
@@ -0,0 +1,61 @@
+/*
+ * Functionality to handle list of doubles
+ *
+ * Authors:
+ *   Vaclav Petras <wenzeslaus gmail com>
+ *
+ * Copyright 2015-2016 by Vaclav Petras, and the GRASS Development Team
+ *
+ * This program is free software licensed under the GPL (>=v2).
+ * Read the COPYING file that comes with GRASS for details.
+ *
+ */
+
+
+#include <stdio.h>
+#include <string.h>
+
+#include <grass/gis.h>
+#include <grass/glocale.h>
+
+#include "double_list.h"
+
+#define SIZE_INCREMENT 10
+
+int double_list_add_item(struct DoubleList *double_list, double item)
+{
+    int n = double_list->num_items++;
+
+    if (double_list->num_items >= double_list->max_items) {
+        double_list->max_items += SIZE_INCREMENT;
+        double_list->items = G_realloc(double_list->items,
+                                       (size_t) double_list->max_items *
+                                       sizeof(double));
+    }
+    /* n contains the index */
+    double_list->items[n] = item;
+    return n;
+}
+
+void double_list_from_one_item(struct DoubleList *double_list, double item)
+{
+    double_list->num_items = 0;
+    double_list->max_items = 0;
+    double_list->items = NULL;
+    double_list_add_item(double_list, item);
+}
+
+void double_list_init(struct DoubleList *double_list)
+{
+    double_list->num_items = 0;
+    double_list->max_items = 0;
+    double_list->items = NULL;
+}
+
+void double_list_free(struct DoubleList *double_list)
+{
+    G_free(double_list->items);
+    double_list->num_items = 0;
+    double_list->max_items = 0;
+    double_list->items = NULL;
+}


Property changes on: grass-addons/grass7/raster3d/r3.profile/double_list.c
___________________________________________________________________
Added: svn:mime-type
   + text/x-csrc
Added: svn:eol-style
   + native

Added: grass-addons/grass7/raster3d/r3.profile/double_list.h
===================================================================
--- grass-addons/grass7/raster3d/r3.profile/double_list.h	                        (rev 0)
+++ grass-addons/grass7/raster3d/r3.profile/double_list.h	2016-09-19 02:16:56 UTC (rev 69523)
@@ -0,0 +1,30 @@
+/*
+ * Functionality to handle list of doubles
+ *
+ * Authors:
+ *   Vaclav Petras <wenzeslaus gmail com>
+ *
+ * Copyright 2015-2016 by Vaclav Petras, and the GRASS Development Team
+ *
+ * This program is free software licensed under the GPL (>=v2).
+ * Read the COPYING file that comes with GRASS for details.
+ *
+ */
+
+
+#ifndef __DOUBLE_LIST_H__
+#define __DOUBLE_LIST_H__
+
+struct DoubleList
+{
+    int num_items;
+    int max_items;
+    double *items;
+};
+
+void double_list_init(struct DoubleList *double_list);
+void double_list_from_one_item(struct DoubleList *double_list, double item);
+void double_list_free(struct DoubleList *double_list);
+int double_list_add_item(struct DoubleList *double_list, double item);
+
+#endif /* __DOUBLE_LIST_H__ */


Property changes on: grass-addons/grass7/raster3d/r3.profile/double_list.h
___________________________________________________________________
Added: svn:mime-type
   + text/x-chdr
Added: svn:eol-style
   + native



More information about the grass-commit mailing list