Ben NanoNote 3D scans
Sign in or create your account | Project List | Help
Ben NanoNote 3D scans Git Source Tree
Root/
Source at commit 98b6050e8369bfac26c57d7e6dee847ba2e0c074 created 13 years 6 months ago. By Werner Almesberger, Fix our trigonometry: the z0 inclination is expressed as a tangent, not a sine. | |
---|---|
1 | /* |
2 | * util.h - Common utility functions |
3 | * |
4 | * Written 2009 by Werner Almesberger |
5 | * Copyright 2009 by Werner Almesberger |
6 | * |
7 | * This program is free software; you can redistribute it and/or modify |
8 | * it under the terms of the GNU General Public License as published by |
9 | * the Free Software Foundation; either version 2 of the License, or |
10 | * (at your option) any later version. |
11 | */ |
12 | |
13 | #ifndef UTIL_H |
14 | #define UTIL_H |
15 | |
16 | #include <stdlib.h> |
17 | #include <string.h> |
18 | #include <gtk/gtk.h> |
19 | |
20 | |
21 | #define alloc_size(s) \ |
22 | ({ void *alloc_size_tmp = malloc(s); \ |
23 | if (!alloc_size_tmp) \ |
24 | abort(); \ |
25 | alloc_size_tmp; }) |
26 | |
27 | #define alloc_type(t) ((t *) alloc_size(sizeof(t))) |
28 | |
29 | #define stralloc(s) \ |
30 | ({ char *stralloc_tmp = strdup(s); \ |
31 | if (!stralloc_tmp) \ |
32 | abort(); \ |
33 | stralloc_tmp; }) |
34 | |
35 | |
36 | void draw_circle(GdkDrawable *da, GdkGC *gc, int x, int y, int r); |
37 | |
38 | #endif /* !UTIL_H */ |
39 |
Branches:
master