]> Dogcows Code - chaz/rasterize/blobdiff - common.h
add external supersampling to animate script
[chaz/rasterize] / common.h
index dd6f034bc9171fa9dd67e5d73d52e0ef7550de13..33961a196ec680ea61d3176573f2510e7c52c159 100644 (file)
--- a/common.h
+++ b/common.h
@@ -15,6 +15,8 @@
 #include <stdlib.h>
 #include <string.h>
 
 #include <stdlib.h>
 #include <string.h>
 
+#include "config.h"
+
 
 /*
  * Define a keyword for use while defining small and fast functions.
 
 /*
  * Define a keyword for use while defining small and fast functions.
@@ -118,6 +120,16 @@ int imax(int a, int b)
     return a < b ? b : a;
 }
 
     return a < b ? b : a;
 }
 
+/*
+ * Define generic MIN and MAX macros.
+ */
+#ifndef MIN
+#define MIN(A,B) (((A) < (B)) ? (A) : (B))
+#endif
+#ifndef MAX
+#define MAX(A,B) (((A) > (B)) ? (A) : (B))
+#endif
+
 
 /*
  * Define some macros for packing and unpacking bytes to and from larger ints.
 
 /*
  * Define some macros for packing and unpacking bytes to and from larger ints.
@@ -132,11 +144,16 @@ int imax(int a, int b)
  * an error condition and an abort(3) occurs.
  * return.
  */
  * an error condition and an abort(3) occurs.
  * return.
  */
+#if VERBOSITY >= 1
 #define TRY_DO(L, K, ARGS...) \
 printf("* " L "... ", ##ARGS); \
 fflush(stdout); \
 if ((K) == 0) printf("done!\n"); \
 else abort()
 #define TRY_DO(L, K, ARGS...) \
 printf("* " L "... ", ##ARGS); \
 fflush(stdout); \
 if ((K) == 0) printf("done!\n"); \
 else abort()
+#else
+#define TRY_DO(L, K, ARGS...) \
+if ((K) != 0) abort()
+#endif
 
 
 /*
 
 
 /*
@@ -239,10 +256,11 @@ void ltrim(char *str);
  * Trim white space off of both sides of a string.
  */
 INLINE_MAYBE
  * Trim white space off of both sides of a string.
  */
 INLINE_MAYBE
-void trim(char *str)
+char* trim(char *str)
 {
     rtrim(str);
     ltrim(str);
 {
     rtrim(str);
     ltrim(str);
+    return str;
 }
 
 
 }
 
 
This page took 0.022223 seconds and 4 git commands to generate.