steamshim_child.h
author Ryan C. Gordon <icculus@icculus.org>
Wed, 16 Sep 2015 01:33:55 -0400
changeset 15 4018ba1b0e14
parent 7 591f5e984cc0
permissions -rw-r--r--
A couple README updates.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
3
6945d8e9267d Added child code.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
     1
#ifndef _INCL_STEAMSHIM_CHILD_H_
6945d8e9267d Added child code.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
     2
#define _INCL_STEAMSHIM_CHILD_H_
6945d8e9267d Added child code.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
     3
6945d8e9267d Added child code.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
     4
#ifdef __cplusplus
6945d8e9267d Added child code.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
     5
extern "C" {
6945d8e9267d Added child code.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
     6
#endif
6945d8e9267d Added child code.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
     7
6945d8e9267d Added child code.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
     8
typedef enum STEAMSHIM_EventType
6945d8e9267d Added child code.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
     9
{
6945d8e9267d Added child code.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    10
    SHIMEVENT_BYE,
6945d8e9267d Added child code.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    11
    SHIMEVENT_STATSRECEIVED,
6945d8e9267d Added child code.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    12
    SHIMEVENT_STATSSTORED,
6945d8e9267d Added child code.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    13
    SHIMEVENT_SETACHIEVEMENT,
6945d8e9267d Added child code.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    14
    SHIMEVENT_GETACHIEVEMENT,
6945d8e9267d Added child code.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    15
    SHIMEVENT_RESETSTATS,
6945d8e9267d Added child code.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    16
    SHIMEVENT_SETSTATI,
6945d8e9267d Added child code.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    17
    SHIMEVENT_GETSTATI,
6945d8e9267d Added child code.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    18
    SHIMEVENT_SETSTATF,
6945d8e9267d Added child code.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    19
    SHIMEVENT_GETSTATF,
6945d8e9267d Added child code.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    20
} STEAMSHIM_EventType;
6945d8e9267d Added child code.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    21
6945d8e9267d Added child code.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    22
/* not all of these fields make sense in a given event. */
6945d8e9267d Added child code.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    23
typedef struct STEAMSHIM_Event
6945d8e9267d Added child code.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    24
{
6945d8e9267d Added child code.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    25
    STEAMSHIM_EventType type;
6945d8e9267d Added child code.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    26
    int okay;
6945d8e9267d Added child code.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    27
    int ivalue;
6945d8e9267d Added child code.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    28
    float fvalue;
6945d8e9267d Added child code.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    29
    unsigned long long epochsecs;
6945d8e9267d Added child code.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    30
    char name[256];
6945d8e9267d Added child code.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    31
} STEAMSHIM_Event;
6945d8e9267d Added child code.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    32
6945d8e9267d Added child code.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    33
int STEAMSHIM_init(void);  /* non-zero on success, zero on failure. */
6945d8e9267d Added child code.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    34
void STEAMSHIM_deinit(void);
6945d8e9267d Added child code.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    35
int STEAMSHIM_alive(void);
6945d8e9267d Added child code.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    36
const STEAMSHIM_Event *STEAMSHIM_pump(void);
5
edd9f2f020eb A bunch of work. Seems...complete and largely debugged, now?
Ryan C. Gordon <icculus@icculus.org>
parents: 3
diff changeset
    37
void STEAMSHIM_requestStats(void);
edd9f2f020eb A bunch of work. Seems...complete and largely debugged, now?
Ryan C. Gordon <icculus@icculus.org>
parents: 3
diff changeset
    38
void STEAMSHIM_storeStats(void);
edd9f2f020eb A bunch of work. Seems...complete and largely debugged, now?
Ryan C. Gordon <icculus@icculus.org>
parents: 3
diff changeset
    39
void STEAMSHIM_setAchievement(const char *name, const int enable);
edd9f2f020eb A bunch of work. Seems...complete and largely debugged, now?
Ryan C. Gordon <icculus@icculus.org>
parents: 3
diff changeset
    40
void STEAMSHIM_getAchievement(const char *name);
edd9f2f020eb A bunch of work. Seems...complete and largely debugged, now?
Ryan C. Gordon <icculus@icculus.org>
parents: 3
diff changeset
    41
void STEAMSHIM_resetStats(const int bAlsoAchievements);
edd9f2f020eb A bunch of work. Seems...complete and largely debugged, now?
Ryan C. Gordon <icculus@icculus.org>
parents: 3
diff changeset
    42
void STEAMSHIM_setStatI(const char *name, const int _val);
edd9f2f020eb A bunch of work. Seems...complete and largely debugged, now?
Ryan C. Gordon <icculus@icculus.org>
parents: 3
diff changeset
    43
void STEAMSHIM_getStatI(const char *name);
edd9f2f020eb A bunch of work. Seems...complete and largely debugged, now?
Ryan C. Gordon <icculus@icculus.org>
parents: 3
diff changeset
    44
void STEAMSHIM_setStatF(const char *name, const float val);
edd9f2f020eb A bunch of work. Seems...complete and largely debugged, now?
Ryan C. Gordon <icculus@icculus.org>
parents: 3
diff changeset
    45
void STEAMSHIM_getStatF(const char *name);
3
6945d8e9267d Added child code.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    46
6945d8e9267d Added child code.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    47
#ifdef __cplusplus
6945d8e9267d Added child code.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    48
}
6945d8e9267d Added child code.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    49
#endif
6945d8e9267d Added child code.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    50
6945d8e9267d Added child code.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    51
#endif  /* include-once blocker */
6945d8e9267d Added child code.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    52
6945d8e9267d Added child code.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    53
/* end of steamshim_child.h ... */
6945d8e9267d Added child code.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    54