int set_color(cairo_t *c, char *str) { if (strcmp("BLACK", str) == 0) { cairo_set_source_rgb (c, 0.0, 0.0, 0.0); } if (strcmp("BLUE", str) == 0) { cairo_set_source_rgb (c, 0.0, 0.0, 255.0); } return(0); }