mirror of
git://projects.qi-hardware.com/cae-tools.git
synced 2025-04-21 12:27:27 +03:00
Initial commit. For older history, see project ben-scans.
http://projects.qi-hardware.com/index.php/p/ben-scans/
This commit is contained in:
38
solidify/util.h
Normal file
38
solidify/util.h
Normal file
@@ -0,0 +1,38 @@
|
||||
/*
|
||||
* 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 */
|
||||
Reference in New Issue
Block a user