1
0
mirror of git://projects.qi-hardware.com/ben-scans.git synced 2024-11-22 06:03:08 +02:00
ben-scans/solidify/util.h
Werner Almesberger f6ed3bf762 solidify now stores the context of sessions in project description files.
- solidify/Makefile (OBJS): added project.o
- solidify/Makefile (new): new target to create a new project
- solidify/Makefile (run): changed to resume previously created project
- solidify/util.h (stralloc): added stralloc (from fped)
- solidify/project.h, solidify/project.c: create, load, and save project
  description files
- solidify/solidify.c (clicked, gui_buttons, gui, main): updated to use
  project instead of solid
- solidify/solidify.c (usage, main): new invocation: four arguments to start
  new project, one argument to resume old project
2010-09-24 21:01:59 -03:00

39 lines
877 B
C

/*
* util.h - Common utility functions
*
* Written 2009 by Werner Almesberger
* Copyright 2009 by Werner Almesberger
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*/
#ifndef UTIL_H
#define UTIL_H
#include <stdlib.h>
#include <string.h>
#include <gtk/gtk.h>
#define alloc_size(s) \
({ void *alloc_size_tmp = malloc(s); \
if (!alloc_size_tmp) \
abort(); \
alloc_size_tmp; })
#define alloc_type(t) ((t *) alloc_size(sizeof(t)))
#define stralloc(s) \
({ char *stralloc_tmp = strdup(s); \
if (!stralloc_tmp) \
abort(); \
stralloc_tmp; })
void draw_circle(GdkDrawable *da, GdkGC *gc, int x, int y, int r);
#endif /* !UTIL_H */