#include "unique_key_structs.h"
#include "unique_key_cat.h"
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
static const char szData[][34] = {
"John", "James", "Duncan",
"Bill", "John",
"Paul", "David"};
int32_t main_unique_keyTutorial (int32_t argc, const char *const *argv)
{
uint32_t ii;
INFO sInfo;
{
{
{
}
{
{
{
printf ("Can't open the unique_key database.");
}
}
{
db, tables,
RDM_LEN (tables), NULL, 0, NULL);
}
{
{
}
else
{
}
}
{
db, tables,
RDM_LEN (tables), NULL, 0, NULL);
}
{
{
strcpy (sInfo.mychar, szData[ii]);
db, TABLE_INFO, &sInfo, sizeof (sInfo), NULL);
{
printf (
"%s is a duplicate record.\n", sInfo.mychar);
}
}
}
{
}
{
strcpy (keyVal.mychar, szData[3]);
db, KEY_INFO_MYCHAR, &keyVal, sizeof (keyVal), &cursor);
{
cursor, &sInfo, sizeof (sInfo), NULL);
{
printf (
"Row found doing a key lookup: %s\n",
sInfo.mychar);
}
{
cursor, KEY_INFO_MYCHAR, &keyVal,
sizeof (keyVal));
{
}
{
cursor, &sInfo, sizeof (sInfo), NULL);
{
printf (
"Row found doing a key scan lookup: "
"%s\n",
sInfo.mychar);
}
}
{
}
}
}
}
}
}
}
{
printf (
"There was an error in this Tutorial (%s - %s)\n",
return EXIT_FAILURE;
}
return EXIT_SUCCESS;
}