Source code for the RDM core10 example. More...
#include <stdio.h>
#include <string.h>
#include "rdm.h"
#include "core10_db_structs.h"
#include "core10_db_cat.h"
Macros | |
#define | print_error(rc) print_errorEx (rc, __FILE__, __LINE__) |
Standard error print macro. | |
#define | RLEN(x) (sizeof(x)/sizeof(x[0])) |
Macro to determine number of elements in an array of ptrs. | |
Functions | |
void | print_errorEx (RDM_RETCODE rc, const char *file, int line) |
Standard error print format for popcorn examples. More... | |
RDM_RETCODE | insertArtist (RDM_DB hDB, int artistID, const char *artistName) |
Insert an artis. More... | |
RDM_RETCODE | insertAlbum (RDM_DB hDB, const char *artistName, int albumID, const char *albumTitle, const char **trackList, size_t listSize) |
Insert an artist and all of the albums associated with the artist. More... | |
RDM_RETCODE | openPopulatedDatabase (RDM_DB *pDB) |
Initialize the RDM runtime library for use in the core10 example. More... | |
int | main (void) |
Main function for core10 example. More... | |
Source code for the RDM core10 example.
RDM_RETCODE insertAlbum | ( | RDM_DB | hDB, |
const char * | artistName, | ||
int | albumID, | ||
const char * | albumTitle, | ||
const char ** | trackList, | ||
size_t | listSize | ||
) |
Insert an artist and all of the albums associated with the artist.
This function adds one more row to the ARTIST table in the core03 database and one to many rows to the ALBUM table associated with the given artist.
[in] | hDB | Database handle to open database |
[in] | artistName | Name of the artist |
[in] | albumID | Unique albumID number |
[in] | albumTitle | Artist name to insert |
[in] | trackList | List of album names for the artist |
[in] | listSize | Number of album names in the list |
RDM_RETCODE insertArtist | ( | RDM_DB | hDB, |
int | artistID, | ||
const char * | artistName | ||
) |
Insert an artis.
This function adds one more row to the ARTIST table in the core03 database.
[in] | hDB | Database handle to open database |
[in] | artistID | Unique ID for artist |
[in] | artistName | Artist name to insert |
int main | ( | void | ) |
Main function for core10 example.
The function initializes the RDM environment and runs the create, read operations.
RDM_RETCODE openPopulatedDatabase | ( | RDM_DB * | pDB | ) |
Initialize the RDM runtime library for use in the core10 example.
This function initializes the RDM Transactional File Server (TFS) to use the EMBEDED TFS implementation. It also allocates a database handle and opens the "core10" database in exclusive mode. Exclusve mode does not require database locks or transactions.
[out] | pDB | Pointer to the RDM database handle |
void print_errorEx | ( | RDM_RETCODE | rc, |
const char * | file, | ||
int | line | ||
) |
Standard error print format for popcorn examples.
This demonstrates the usage of the rdm_retcodeGetName() and rdm_retcodeGetDescription() functions.
[in] | rc | RDM_RETCODE to analyze |
[in] | file | Sourcec filename |
[in] | line | Lineno in source file |