CFLAGS = -Wall -g -O0
-test: inkpot_scheme.o inkpot_value.o inkpot_xlate.o test.o
+LIBINKPOT = inkpot_scheme.o inkpot_xlate.o inkpot_value.o
-inkpot_scheme.o: inkpot_scheme.c inkpot.h inkpot_define.h \
- inkpot_scheme.h inkpot_value.h inkpot_xlate.h \
- inkpot_scheme_table.h
+inkpot: inkpot.o $(LIBINKPOT)
-inkpot_value.o: inkpot_value.c inkpot.h inkpot_define.h \
- inkpot_value.h inkpot_value_table.h
+inkpot.o: inkpot.c inkpot.h
-inkpot_xlate.o: inkpot_xlate.c inkpot.h inkpot_xlate.h
+inkpot_scheme.o: inkpot_scheme.c inkpot_scheme.h inkpot.h inkpot_define.h \
+ inkpot_value.h inkpot_xlate.h inkpot_scheme_table.h
-test.o: test.c inkpot.h
+inkpot_xlate.o: inkpot_xlate.c inkpot_xlate.h inkpot.h
+inkpot_value.o: inkpot_value.c inkpot_value.h inkpot.h inkpot_value_table.h
-
-inkpot_scheme.c: ../inkpot_scheme.c
+inkpot.c:
+ ln -s ../inkpot.c
+inkpot.h:
+ ln -s ../inkpot.h
+inkpot_scheme.c:
ln -s ../inkpot_scheme.c
-
-inkpot_value.c: ../inkpot_value.c
- ln -s ../inkpot_value.c
-
-inkpot_xlate.c: ../inkpot_xlate.c
- ln -s ../inkpot_xlate.c
-
-inkpot_scheme.h: ../inkpot_scheme.h
+inkpot_scheme.h:
ln -s ../inkpot_scheme.h
-
-inkpot_value.h: ../inkpot_value.h
+inkpot_value.c:
+ ln -s ../inkpot_value.c
+inkpot_value.h:
ln -s ../inkpot_value.h
-
-inkpot_xlate.h: ../inkpot_xlate.h
+inkpot_xlate.c:
+ ln -s ../inkpot_xlate.c
+inkpot_xlate.h:
ln -s ../inkpot_xlate.h
-inkpot.h: ../inkpot.h
- ln -s ../inkpot.h
+clean:
+ rm -rf *.o inkpot inkpot.[ch] inkpot_scheme.[ch] \
+ inkpot_value.[ch] inkpot_xlate.[ch]
-clean:
- rm -rf *.o test inkpot_xlate.h inkpot_value.h inkpot_scheme.h \
- inkpot_xlate.c inkpot_value.c inkpot_scheme.c inkpot.h
+++ /dev/null
-/* $Id$ $Revision$ */
-/* vim:set shiftwidth=4 ts=8: */
-
-/***********************************************************
- * This software is part of the graphviz package *
- * http://www.graphviz.org/ *
- * *
- * Copyright (c) 1994-2008 AT&T Corp. *
- * and is licensed under the *
- * Common Public License, Version 1.0 *
- * by AT&T Corp. *
- * *
- * Information and Software Systems Research *
- * AT&T Research, Florham Park NJ *
- **********************************************************/
-
-#include <stdio.h>
-#include <assert.h>
-
-#include "inkpot.h"
-
-int main (int argc, char *argv[])
-{
- inkpot_t *inkpot;
- inkpot_status_t rc;
- char *color;
- double rgba[4], hsva[4], cmyk[4];
-
- inkpot = inkpot_init();
- if (!inkpot) {
- fprintf(stderr, "failure to initialize inkpot\n");
- return 0;
- }
-
- /* requested color */
- if (argc < 2)
- color = NULL;
- else
- color = argv[1];
-
- /* requested schemes (comma-separated) */
- if (argc < 3) {
- rc = inkpot_schemes(inkpot, "x11");
- assert(rc == INKPOT_SUCCESS);
- }
- else {
- rc = inkpot_schemes(inkpot, argv[2]);
- if (rc == INKPOT_SCHEME_UNKNOWN)
- inkpot_debug_error(inkpot);
- else
- assert(rc == INKPOT_SUCCESS);
- }
-
- /* target scheme */
- if (argc < 4) {
- rc = inkpot_translate(inkpot, "x11");
- assert(rc == INKPOT_SUCCESS);
- }
- else {
- rc = inkpot_translate(inkpot, argv[3]);
- if (rc == INKPOT_SCHEME_UNKNOWN)
- inkpot_debug_error(inkpot);
- else
- assert(rc == INKPOT_SUCCESS);
- }
-
- inkpot_debug_schemes(inkpot);
-
-#if 0
- inkpot_debug_names(inkpot);
-
- inkpot_debug_out_names(inkpot);
-
- inkpot_debug_values(inkpot);
-#endif
-
- fprintf(stdout, "%s ", color); /* ' ' after %s so it doesn't crash on NULL */
- rc = inkpot_set(inkpot, color);
- if (rc == INKPOT_COLOR_UNKNOWN)
- fprintf(stdout, "(unknown)");
- fprintf(stdout, "\n text: ");
-
- rc = inkpot_write(inkpot);
- if (rc == INKPOT_COLOR_NONAME || rc == INKPOT_NOPALETTE) {
- fprintf(stdout, "#");
- rc = inkpot_write_rgba8(inkpot);
- }
- assert (rc == INKPOT_SUCCESS);
-
- rc = inkpot_get_rgba(inkpot, rgba);
- assert (rc == INKPOT_SUCCESS);
- fprintf(stdout, "\n rgba: %.3f,%.3f,%.3f,%.3f\n",
- rgba[0], rgba[1], rgba[2], rgba[3]);
-
- rc = inkpot_get_hsva(inkpot, hsva);
- assert (rc == INKPOT_SUCCESS);
- fprintf(stdout, " hsva: %.3f,%.3f,%.3f,%.3f\n",
- hsva[0], hsva[1], hsva[2], hsva[3]);
-
- rc = inkpot_get_cmyk(inkpot, cmyk);
- assert (rc == INKPOT_SUCCESS);
- fprintf(stdout, " cmyk: %.3f,%.3f,%.3f,%.3f\n",
- cmyk[0], cmyk[1], cmyk[2], cmyk[3]);
-
- inkpot_destroy(inkpot);
- return 0;
-}