-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdimension.h
More file actions
87 lines (71 loc) · 2.46 KB
/
dimension.h
File metadata and controls
87 lines (71 loc) · 2.46 KB
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
/*
* File: dimension.h
* Author: Sir Gee of Five
*
* Created on September 20, 2010, 10:33 AM
*/
#ifndef DIMENSION_H
#define DIMENSION_H
#include <stdio.h>
#include <pspkerneltypes.h>
#include <pspiofilemgr.h>
/** Indicates success. */
#define DIMENSION_SUCCESS (0)
/** Indicates failure. */
#define DIMENSION_FAILURE (-1)
/** Indicates a memory error. */
#define DIMENSION_MEMORY (-2)
/** Indicates a NULL pointer. */
#define DIMENSION_NULLPTR (-3)
/** Indicates an I/O error. */
#define DIMENSION_IOERROR (-4)
#ifdef __cplusplus
extern "C" {
#endif
typedef struct _Dimension {
/** The width in columns. */
int width;
/** The height in rows. */
int height;
}
/** The Dimension struct is used to represent a Screen Dimension. */
Dimension;
/** Copy a Dimension struct.
*
* @param prDest Pointer to a Dimension struct representing the destination.
* @param prSrc Pointer to a Dimension struct representing the source.
* @return 0 indicates success, <0 indicates failure.
*/
int dimension_copy(Dimension* prDest, Dimension* prSrc);
/** Initialize a Dimension.
*
* @param prDim Pointer to the Dimension struct to initialize.
* @return 0 indicates success, <0 indicates failure.
*/
int dimension_init(Dimension* prDim);
/** Read a Dimension struct from the specified file descriptor.
*
* @param prDim Pointer to a Dimension struct representing the Dimension.
* @param fd SceUID representing the open file descriptor.
* @return 0 indicates success, <0 indicates failure.
*/
int dimension_read(Dimension* prDim, SceUID fd);
/** Assign the specified values to a Dimension.
*
* @param prDim Pointer to a Dimension struct representing the Dimension.
* @param width int containing the width in columns.
* @param height int containing the height in rows.
* @return 0 indicates success, <0 indicates failure.
*/
int dimension_set(Dimension* prDim, int width, int height);
/** Write a Dimension struct to the specified file descriptor.
*
* @param prDim Pointer to a Dimension struct representing the Dimension.
* @param fd SceUID representing the open file descriptor.
* @return 0 indicates success, <0 indicates failure.
*/
int dimension_write(Dimension* prDim, SceUID fd);
#ifdef __cplusplus
}
#endif
#endif /* DIMENSION_H */