Mercurial > mxe-octave
annotate src/geos-test.c @ 5947:09d3533acacf
* src/build-cmake.mk, src/cmake.mk: update v3.21.4
author | John Donoghue <john.donoghue@ieee.org> |
---|---|
date | Thu, 11 Nov 2021 09:49:11 -0500 |
parents | 99516e73b368 |
children |
rev | line source |
---|---|
2351
8a6c466753e2
Improve comment style of all test programs
Volker Grabsch <vog@notjusthosting.com>
parents:
2333
diff
changeset
|
1 /* |
8a6c466753e2
Improve comment style of all test programs
Volker Grabsch <vog@notjusthosting.com>
parents:
2333
diff
changeset
|
2 * This file is part of MXE. |
2353
99516e73b368
Move doc/index.html -> index.html
Volker Grabsch <vog@notjusthosting.com>
parents:
2351
diff
changeset
|
3 * See index.html for further information. |
2351
8a6c466753e2
Improve comment style of all test programs
Volker Grabsch <vog@notjusthosting.com>
parents:
2333
diff
changeset
|
4 */ |
1828
04215d0b04a9
test program for package geos
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
5 |
04215d0b04a9
test program for package geos
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
6 #include <stdarg.h> |
04215d0b04a9
test program for package geos
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
7 #include <stdio.h> |
04215d0b04a9
test program for package geos
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
8 #include <stdlib.h> |
04215d0b04a9
test program for package geos
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
9 |
04215d0b04a9
test program for package geos
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
10 #include <geos_c.h> |
04215d0b04a9
test program for package geos
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
11 |
04215d0b04a9
test program for package geos
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
12 static void notice(const char *fmt, ...) |
04215d0b04a9
test program for package geos
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
13 { |
04215d0b04a9
test program for package geos
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
14 va_list ap; |
04215d0b04a9
test program for package geos
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
15 va_start(ap, fmt); |
04215d0b04a9
test program for package geos
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
16 vprintf(fmt, ap); |
04215d0b04a9
test program for package geos
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
17 va_end(ap); |
04215d0b04a9
test program for package geos
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
18 printf("\n"); |
04215d0b04a9
test program for package geos
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
19 } |
04215d0b04a9
test program for package geos
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
20 |
04215d0b04a9
test program for package geos
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
21 static void error(const char *fmt, ...) |
04215d0b04a9
test program for package geos
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
22 { |
04215d0b04a9
test program for package geos
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
23 va_list ap; |
04215d0b04a9
test program for package geos
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
24 va_start(ap, fmt); |
04215d0b04a9
test program for package geos
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
25 vprintf(fmt, ap); |
04215d0b04a9
test program for package geos
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
26 va_end(ap); |
04215d0b04a9
test program for package geos
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
27 printf("\n"); |
04215d0b04a9
test program for package geos
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
28 |
04215d0b04a9
test program for package geos
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
29 exit(1); |
04215d0b04a9
test program for package geos
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
30 } |
04215d0b04a9
test program for package geos
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
31 |
04215d0b04a9
test program for package geos
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
32 int main(int argc, char *argv[]) |
04215d0b04a9
test program for package geos
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
33 { |
04215d0b04a9
test program for package geos
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
34 GEOSContextHandle_t handle; |
04215d0b04a9
test program for package geos
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
35 |
04215d0b04a9
test program for package geos
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
36 (void)argc; |
04215d0b04a9
test program for package geos
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
37 (void)argv; |
04215d0b04a9
test program for package geos
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
38 |
04215d0b04a9
test program for package geos
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
39 handle = initGEOS_r(notice, error); |
04215d0b04a9
test program for package geos
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
40 |
04215d0b04a9
test program for package geos
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
41 printf("GEOS version: %s\n", GEOSversion()); |
04215d0b04a9
test program for package geos
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
42 |
04215d0b04a9
test program for package geos
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
43 finishGEOS_r(handle); |
04215d0b04a9
test program for package geos
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
44 return 0; |
04215d0b04a9
test program for package geos
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
45 } |