1 /*--------------------------------------------------------------------- 2 Implement Image Saving 3 ---------------------------------------------------------------------*/ 4 io_image()5void io_image() { 6 FILE *fp; 7 char *f = string_extract(stack_pop()); 8 if ((fp = fopen(f, "wb")) == NULL) { 9 printf("\nERROR (nga/io_image): Unable to save the image: %s!\n", f); 10 exit(2); 11 } 12 fwrite(&memory, sizeof(CELL), memory[3] + 1, fp); 13 fclose(fp); 14 } 15 io_image_query()16void io_image_query() { 17 stack_push(0); 18 stack_push(1000); 19 } 20