Search
lxdream.org :: lxdream/src/loader.h :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/loader.h
changeset 26:ad258e3daaa5
next427:00270806b4cf
author nkeynes
date Sun Dec 25 08:24:11 2005 +0000 (18 years ago)
permissions -rw-r--r--
last change Finish adding header blocks to all files
file annotate diff log raw
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/src/loader.h Sun Dec 25 08:24:11 2005 +0000
1.3 @@ -0,0 +1,72 @@
1.4 +/**
1.5 + * $Id: loader.h,v 1.1 2005-12-24 08:02:14 nkeynes Exp $
1.6 + *
1.7 + * Interface declarations for the binary loader routines (loader.c, elf.c)
1.8 + *
1.9 + * Copyright (c) 2005 Nathan Keynes.
1.10 + *
1.11 + * This program is free software; you can redistribute it and/or modify
1.12 + * it under the terms of the GNU General Public License as published by
1.13 + * the Free Software Foundation; either version 2 of the License, or
1.14 + * (at your option) any later version.
1.15 + *
1.16 + * This program is distributed in the hope that it will be useful,
1.17 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
1.18 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1.19 + * GNU General Public License for more details.
1.20 + */
1.21 +
1.22 +#ifndef dreamcast_loader_H
1.23 +#define dreamcast_loader_H 1
1.24 +
1.25 +#include <stdio.h>
1.26 +#include <glib/gtypes.h>
1.27 +
1.28 +#ifdef __cplusplus
1.29 +extern "C" {
1.30 +#endif
1.31 +
1.32 +/**
1.33 + * NULL-terminated list of file extension/name pairs,
1.34 + * supported by the loader
1.35 + */
1.36 +extern char *file_loader_extensions[][2];
1.37 +
1.38 +/**
1.39 + * Load the CD bootstrap, aka IP.BIN. Identified by "SEGA SEGAKATANA" at
1.40 + * start of file. IP.BIN is loaded as-is at 8C008000.
1.41 + * This is mainly for testing as it's unlikely anyone would want to do this
1.42 + * for any other reason.
1.43 + * @return TRUE on success, otherwise FALSE and errno
1.44 + */
1.45 +gboolean file_load_bootstrap( gchar *filename );
1.46 +
1.47 +/**
1.48 + * Load a miscellaneous .bin file, as commonly used in demos. No magic
1.49 + * applies, file is loaded as is at 8C010000
1.50 + */
1.51 +gboolean file_load_binary( gchar *filename );
1.52 +
1.53 +/**
1.54 + * Load a "Self Boot Inducer" .sbi file, also commonly used to package
1.55 + * demos. (Actually a ZIP file with a predefined structure
1.56 + */
1.57 +gboolean file_load_sbi( gchar *filename );
1.58 +
1.59 +/**
1.60 + * Load an ELF executable binary file. Origin is file-dependent.
1.61 + */
1.62 +gboolean file_load_elf( gchar *filename );
1.63 +
1.64 +/**
1.65 + * Load any of the above file types, using the appropriate magic to determine
1.66 + * which is actually applicable
1.67 + */
1.68 +gboolean file_load_magic( gchar *filename );
1.69 +
1.70 +#ifdef __cplusplus
1.71 +}
1.72 +#endif
1.73 +
1.74 +#endif /* !dream_loader_H */
1.75 +
.