2022-12-27 02:31:08 -05:00
|
|
|
#include "../src/text.h"
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <stdio.h>
|
2023-03-10 23:06:11 -05:00
|
|
|
#include <errno.h>
|
2022-12-27 02:31:08 -05:00
|
|
|
|
|
|
|
int main(void) {
|
2023-03-18 23:41:40 -04:00
|
|
|
struct char_array t = text();
|
2022-12-27 02:31:08 -05:00
|
|
|
char *content;
|
|
|
|
int success = EXIT_SUCCESS;
|
2023-03-10 23:06:11 -05:00
|
|
|
errno = 0; /* `errno` is not set correctly to 0 in some debug situations. */
|
2022-12-27 02:31:08 -05:00
|
|
|
if(!(content = text_append_file(&t, "Makefile"))) goto catch;
|
|
|
|
printf("%s", content);
|
|
|
|
goto finally;
|
|
|
|
catch:
|
|
|
|
success = EXIT_FAILURE;
|
|
|
|
perror("text");
|
|
|
|
finally:
|
|
|
|
text_(&t);
|
|
|
|
return success;
|
|
|
|
}
|