ftp://ftp.uni-heidelberg.de/pub/X11/contrib/applications/xscreensaver-1.27.tar.Z
[xscreensaver] / utils / spline.c
index ed5a224a8ac41bf6497d4d27adf082ee1c8e1e0f..d242d63f777b32d9be4382628dc0191ddab2a5de 100644 (file)
@@ -1,3 +1,29 @@
+/*
+ * Copyright (c) 1987, 1988, 1989 Stanford University
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided
+ * that the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the name of Stanford not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission.  Stanford makes no representations about
+ * the suitability of this software for any purpose.  It is provided "as is"
+ * without express or implied warranty.
+ *
+ * STANFORD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.
+ * IN NO EVENT SHALL STANFORD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
+ * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
+ * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* This code came with the InterViews distribution, and was translated
+   from C++ to C by Matthieu Devin <devin@lucid.com> some time in 1992.
+ */
+
 #include <stdio.h>
 #include "spline.h"
 #if __STDC__
@@ -8,6 +34,25 @@
 /* Lifted from InterViews */
 #define SMOOTHNESS 1.0
 
+#if __STDC__
+static void no_more_memory (void);
+static void grow_spline_points (spline* s);
+static void mid_point (double x0, double y0, double x1, double y1,
+                      double *mx, double *my);
+static int can_approx_with_line (double x0, double y0, double x2,
+                                double y2, double x3, double y3);
+static void add_line (spline* s, double x0, double y0, double x1, double y1);
+static void add_bezier_arc (spline* s,
+                           double x0, double y0, double x1, double y1,
+                           double x2, double y2, double x3, double y3);
+static void third_point (double x0, double y0, double x1, double y1,
+                        double *tx, double *ty);
+static void calc_section (spline* s, double cminus1x, double cminus1y,
+                         double cx, double cy, double cplus1x, double cplus1y,
+                         double cplus2x, double cplus2y);
+
+#endif
+
 static void
 no_more_memory ()
 {