File: dats3m.c

package info (click to toggle)
libdumb 1%3A0.9.3-6
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, buster, jessie, jessie-kfreebsd, sid, stretch, trixie
  • size: 1,056 kB
  • ctags: 1,270
  • sloc: ansic: 9,403; makefile: 290; sh: 23
file content (61 lines) | stat: -rw-r--r-- 1,842 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
/*  _______         ____    __         ___    ___
 * \    _  \       \    /  \  /       \   \  /   /       '   '  '
 *  |  | \  \       |  |    ||         |   \/   |         .      .
 *  |  |  |  |      |  |    ||         ||\  /|  |
 *  |  |  |  |      |  |    ||         || \/ |  |         '  '  '
 *  |  |  |  |      |  |    ||         ||    |  |         .      .
 *  |  |_/  /        \  \__//          ||    |  |
 * /_______/ynamic    \____/niversal  /__\  /____\usic   /|  .  . ibliotheque
 *                                                      /  \
 *                                                     / .  \
 * dats3m.c - Integration of S3M files with           / / \  \
 *            Allegro's datafiles.                   | <  /   \_
 *                                                   |  \/ /\   /
 * By entheh.                                         \_  /  > /
 *                                                      | \ / /
 *                                                      |  ' /
 *                                                       \__/
 */

#include <allegro.h>

#include "aldumb.h"
#include "internal/aldumb.h"



static void *dat_read_s3m(PACKFILE *f, long size)
{
	DUMBFILE *df;
	DUH *duh;

	(void)size;

	df = dumbfile_open_packfile(f);

	if (!df)
		return NULL;

	duh = dumb_read_s3m(df);

	dumbfile_close(df);

	return duh;
}



/* dumb_register_dat_s3m(): tells Allegro about the S3M datafile object. If
 * you intend to load a datafile containing an S3M object, you must call this
 * function first. It is recommended you pass DUMB_DAT_S3M, but you may have
 * a reason to use a different type (perhaps you already have a datafile with
 * S3M files in and they use a different type).
 */
void dumb_register_dat_s3m(long type)
{
	register_datafile_object(
		type,
		&dat_read_s3m,
		&_dat_unload_duh
	);
}