PageRenderTime 4ms CodeModel.GetById 2ms app.highlight 0ms RepoModel.GetById 1ms app.codeStats 0ms

/src/Core/objects/Version.xs

http://github.com/PerlGameDev/SDL
Unknown | 65 lines | 52 code | 13 blank | 0 comment | 0 complexity | 8237d76979fca70b2cf2c389a10358e0 MD5 | raw file
 1#include "EXTERN.h"
 2#include "perl.h"
 3#include "XSUB.h"
 4#include "ppport.h"
 5#include "helper.h"
 6
 7#ifndef aTHX_
 8#define aTHX_
 9#endif
10
11#include <SDL.h>
12#include <SDL_version.h>
13
14MODULE = SDL::Version 	PACKAGE = SDL::Version    PREFIX = version_
15
16=for documentation
17
18SDL_Version -- Version structure
19
20  typedef struct SDL_version {
21          Uint8 major;
22          Uint8 minor;
23          Uint8 patch;
24  } SDL_version;
25
26=cut
27
28SDL_version *
29version_new( CLASS )
30	char* CLASS
31	CODE:
32		RETVAL = safemalloc( sizeof( SDL_version) );
33	OUTPUT:
34		RETVAL
35		
36
37Uint8
38version_major ( version, ... )
39	SDL_version *version
40	CODE:
41		RETVAL = version->major;
42	OUTPUT:
43		RETVAL
44
45Uint8
46version_minor ( version, ... )
47	SDL_version *version
48	CODE:
49		RETVAL = version->minor;
50	OUTPUT:
51		RETVAL
52
53Uint8
54version_patch ( version, ... )
55	SDL_version *version
56	CODE:
57		RETVAL = version->patch;
58	OUTPUT:
59		RETVAL
60
61void
62version_DESTROY ( bag )
63	SV *bag
64	CODE:
65		objDESTROY(bag, safefree);