Source code for the RDM core03 example. More...
#include <stdio.h>
#include <string.h>
#include "rdm.h"
#include "core03_db_structs.h"
#include "core03_db_cat.h"
Data Structures | |
struct | CORE03_CTX |
Macros | |
#define | PRINTERROR(rc) |
Standard error print format for popcorn examples. More... | |
Functions | |
RDM_RETCODE | open_and_initialize (CORE03_CTX *ctx) |
Initialize the RDM runtime library for use in the core03 example. More... | |
void | cleanup (CORE03_CTX *ctx) |
Cleanup the RDM runtime library. More... | |
RDM_RETCODE | insertArtists (CORE03_CTX *ctx, const char *artistName, const char **albumList, size_t listSize) |
Insert an artist and all of the albums associated with the artist. More... | |
RDM_RETCODE | readAllAlbums (CORE03_CTX *ctx) |
Reads and displays all rows in the core03 database. More... | |
int | main (void) |
Main function for core03 example. More... | |
Source code for the RDM core03 example.
#define PRINTERROR | ( | rc | ) |
Standard error print format for popcorn examples.
This macro demonstrates the usage of the rdm_retcodeGetName() and rdm_retcodeGetDescription() functions
void cleanup | ( | CORE03_CTX * | ctx | ) |
Cleanup the RDM runtime library.
This functions closes all open databases and cleans up the RDM db handle used in the core03 example. It also terminates the TFS used in the example.
[in] | ctx | Pointer to the application context |
RDM_RETCODE insertArtists | ( | CORE03_CTX * | ctx, |
const char * | artistName, | ||
const char ** | albumList, | ||
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] | ctx | Pointer to the application context |
[in] | artistName | Artist name to insert |
[in] | albumList | List of album names for the artist |
[in] | listSize | Number of album names in the list |
int main | ( | void | ) |
Main function for core03 example.
The function initializes the RDM environment and runs the create, read operations.
RDM_RETCODE open_and_initialize | ( | CORE03_CTX * | ctx | ) |
Initialize the RDM runtime library for use in the core03 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 "core03" database in exclusive mode. Exclusve mode does not require database locks or transactions.
[in,out] | ctx | Pointer to the application context |
RDM_RETCODE readAllAlbums | ( | CORE03_CTX * | ctx | ) |
Reads and displays all rows in the core03 database.
This function reads and displays each row from the ARTIST table in the core03 database and the ALBUMS associated with the artist.
[in] | ctx | Pointer to the application context |