| Revision 208,
556 bytes
checked in by xi, 7 years ago
(diff) |
|
Refactor internal and external API.
|
| Line | |
|---|
| 1 | #include <yaml.h> |
|---|
| 2 | |
|---|
| 3 | #include <stdlib.h> |
|---|
| 4 | #include <stdio.h> |
|---|
| 5 | #include <assert.h> |
|---|
| 6 | |
|---|
| 7 | int |
|---|
| 8 | main(void) |
|---|
| 9 | { |
|---|
| 10 | int major = -1; |
|---|
| 11 | int minor = -1; |
|---|
| 12 | int patch = -1; |
|---|
| 13 | char buf[64]; |
|---|
| 14 | |
|---|
| 15 | yaml_get_version(&major, &minor, &patch); |
|---|
| 16 | sprintf(buf, "%d.%d.%d", major, minor, patch); |
|---|
| 17 | assert(strcmp(buf, yaml_get_version_string()) == 0); |
|---|
| 18 | |
|---|
| 19 | /* Print structure sizes. */ |
|---|
| 20 | printf("sizeof(token) = %d\n", sizeof(yaml_token_t)); |
|---|
| 21 | printf("sizeof(event) = %d\n", sizeof(yaml_event_t)); |
|---|
| 22 | printf("sizeof(parser) = %d\n", sizeof(yaml_parser_t)); |
|---|
| 23 | |
|---|
| 24 | return 0; |
|---|
| 25 | } |
|---|
Note: See
TracBrowser
for help on using the repository browser.