/* Close the library by exiting the emulation engine (free ressources). */ int ti68k_exit(void) { TRY(hw_exit()); ticables_library_exit(); tifiles_library_exit(); ticalcs_library_exit(); return 0; }
int main(void) { Vstr_base *s1 = hw_init(); vstr_add_cstr_ptr(s1, s1->len, "Hello"); vstr_add_cstr_ptr(s1, s1->len, " "); vstr_add_cstr_ptr(s1, s1->len, "World\n"); /* we are checking whether any of the above three functions failed here */ if (s1->conf->malloc_bad) errno = ENOMEM, err(EXIT_FAILURE, "Add string data"); /* loop until all data is output... */ while (io_put(s1, STDOUT_FILENO) != IO_NONE) {} exit (hw_exit(s1)); }