Mercurial > hg > dmlib
view testfs.c @ 81:ba1987562a73
Fix 8to8 saturated scaled blit function.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Tue, 02 Oct 2012 09:44:18 +0300 |
parents | 32250b436bca |
children |
line wrap: on
line source
#include "d_fs.h" #include <stdarg.h> #include <stdio.h> void dream_error(const char *pFmt, ...) { va_list myAP; fprintf(stderr, "testfs: "); va_start(myAP, pFmt); vfprintf(stderr, pFmt, myAP); va_end(myAP); fprintf(stderr, "\n"); } int main(void) { DINT iResult; t_d_file *f; /* Initialize dreamFS */ iResult = dream_fs_init(DTRUE, DFALSE); fprintf(stderr, "dream_fs_init(): %i\n", iResult); if (iResult != DREAM_ERR_OK) return 1; /* File reading test, output "README" to stdout */ f = dfopen("README"); if (!f) fprintf(stderr, "dfopen() failed\n"); else { fprintf(stderr, "dfopen(%s) ok, fops = %p\n", f->pcFilename, f->fops); dfclose(f); } /* Try opening a file which is not in the PACK */ f = dfopen("jeejee.jpg"); if (!f) fprintf(stderr, "dfopen() failed\n"); else { fprintf(stderr, "dfopen(%s) ok, fops = %p\n", f->pcFilename, f->fops); dfclose(f); } f = dfopen("jeejee.jpgz"); if (!f) fprintf(stderr, "dfopen() failed (as expected)\n"); else { fprintf(stderr, "dfopen(%s) ok, fops = %p\n", f->pcFilename, f->fops); dfclose(f); } fprintf(stderr, "dream_fs_close()\n"); dream_fs_close(); return 0; }