Picture

/* Gamelon API - C++ Language

 * Copyright (c) 1993-1997 Menai Corporation

 * All rights reserved.  U.S. Patent # 5,568,639 and patent pending.

 * Menai Corporation, Menlo Park, California

 */

 

/* Interfaces available for other computer languages, including

 * C, Delphi and Java.  Interface available also for ActiveX.

 */

 

/* Notes.

 *

 * 1.  A small number of functions can be called directly, rather than

 * through a CURSOR: these provide information about the library

 * and the computer node at which it is operating.

 *

 * 2.  Most functions are available in two formats, designed the

 * 'e prototype' and 'n prototype' formats.  The 'e' indicates that

 * the function returns a numeric indication of outcome in which

 * a "zero" value indicates success and a "non-zero" value indicates

 * some specific malfunction or failure.  The 'n' indicates that

 * the function is 'not' an 'e' format, and that it can be expected

 * to return a meaningful value that relates to the outcome of the

 * function call, such as a number that represents a count performed

 * by the function.  In both formats the same information is available,

 * but the 'n' prototype requires a follow-up call to ascertain the

 * error return value.  The 'e' format is very helpful for error

 * detection and self-documentation of code; the 'n' format is needed

 * for inline function calls.

 

/* Functions that do not require an open Cursor: */

 

/* Note: CursorQueryError will not return errors generated by the

 *       Local functions.

 */

 

/* n prototype functions */

 

  /* Node */

  void            DLL_LINKAGE nNodeSetTmpPath(const char *tmppath);

  char *          DLL_LINKAGE nNodeQueryTmpPath(char *tmppath, size_t size);

  char *          DLL_LINKAGE nNodeQueryProduct(char *product, size_t size);

  char *          DLL_LINKAGE nNodeQueryVersion(char *version, size_t size);

  char *          DLL_LINKAGE nNodeQueryErrorString(EC0 error, char *estr,

                                                    size_t size);

  unsigned long   DLL_LINKAGE nNodeQueryNodeIdentity(void);

 

  /* File Control */

  size_t          DLL_LINKAGE nFileQueryNameStrLen(void);

  char *          DLL_LINKAGE nFileQueryName(char *name, size_t size);

  ACCESSMODE      DLL_LINKAGE nFileQueryAccessMode(void);

  unsigned long   DLL_LINKAGE nFileQueryLength(void);

  unsigned long   DLL_LINKAGE nFileQueryNodeIdentity(void);

  int             DLL_LINKAGE nFileQueryForeign(void);

 

  /* Cursor Settings */

  void            DLL_LINKAGE nCursorSetDataObjectsOnly(int on);

  void            DLL_LINKAGE nCursorSetFollow(int on);

  void            DLL_LINKAGE nCursorSetValidate(int on);

  void            DLL_LINKAGE nCursorSetAutoIdentity(int on);

  int             DLL_LINKAGE nCursorQueryDataObjectsOnly(void);

  int             DLL_LINKAGE nCursorQueryFollow(void);

  int             DLL_LINKAGE nCursorQueryValidate(void);

  int             DLL_LINKAGE nCursorQueryAutoIdentity(void);

 

  /* Cursor Rights */

  void            DLL_LINKAGE nCursorSetRights(unsigned char rights);

  void            DLL_LINKAGE nCursorGrantRights(unsigned char rights);

  void            DLL_LINKAGE nCursorRevokeRights(unsigned char rights);

  unsigned char   DLL_LINKAGE nCursorQueryRights(void);

  int             DLL_LINKAGE nCursorQueryRights(unsigned char rights);

 

  /* Cursor Actions */

  void            DLL_LINKAGE nCursorMoveIn(void);

  void            DLL_LINKAGE nCursorMoveOut(void);

  void            DLL_LINKAGE nCursorMovePrior(OTYPE target=OT_OBJ);

  void            DLL_LINKAGE nCursorMoveNext(OTYPE target=OT_OBJ);

  void            DLL_LINKAGE nCursorMoveFirst(OTYPE target=OT_OBJ);

  void            DLL_LINKAGE nCursorMoveLast(OTYPE target=OT_OBJ);

  void            DLL_LINKAGE nCursorMovePreFirst(void);

  void            DLL_LINKAGE nCursorMovePostLast(void);

  void            DLL_LINKAGE nCursorMoveTo(CURSOR *dest);

  void            DLL_LINKAGE nCursorMoveTo(const char *position);

  void            DLL_LINKAGE nCursorMoveTo(unsigned long objectid);

  void            DLL_LINKAGE nCursorMoveTo(unsigned long objectid,

                                            CURSOR *index);

  void            DLL_LINKAGE nCursorMoveTo(const char *filename,

                                            ACCESSMODE accessmode,

                                            const void *key, size_t keysize);

  void            DLL_LINKAGE nCursorJumpTo(void);

  void            DLL_LINKAGE nCursorJumpTo(CURSOR *index);

  void            DLL_LINKAGE nCursorSeizeObject(void);

  void            DLL_LINKAGE nCursorUnseizeObject(void);

  void            DLL_LINKAGE nCursorUnseizeAllObjects(void);

  unsigned long   DLL_LINKAGE nCursorCountObjects(OTYPE otype=OT_OBJ);

 

  /* Cursor Index Actions */

  void            DLL_LINKAGE nCursorAssociate(CURSOR *index);

  void            DLL_LINKAGE nCursorDisassociate(CURSOR *index);

 

  /* Miscellaneous Cursor Queries */

  int             DLL_LINKAGE nCursorQueryValid(void);

  long            DLL_LINKAGE nCursorQueryLevel(void);

  long            DLL_LINKAGE nCursorQueryOffset(void);

  size_t          DLL_LINKAGE nCursorQueryPositionStrLen(void);

  char *          DLL_LINKAGE nCursorQueryPosition(char *position,

                                                   size_t size);

  int             DLL_LINKAGE nCursorQueryOnSamePosition(CURSOR *otherc);

  int             DLL_LINKAGE nCursorQueryOnObject(void);

  int             DLL_LINKAGE nCursorQueryOnNull(void);

  int             DLL_LINKAGE nCursorQueryOnPreFirst(void);

  int             DLL_LINKAGE nCursorQueryOnPostLast(void);

  int             DLL_LINKAGE nCursorQueryOnSeizedObject(void);

  EXTEC0          DLL_LINKAGE nCursorQueryError(void);

 

  /* Alteration Actions */

  void            DLL_LINKAGE nAltInsert(void);

  void            DLL_LINKAGE nAltAppend(void);

  void            DLL_LINKAGE nAltReplace(void);

  void            DLL_LINKAGE nAltModify(void);

  void            DLL_LINKAGE nAltRemove(void);

  void            DLL_LINKAGE nAltStartAggregating(void);

  void            DLL_LINKAGE nAltStartBuffering(void);

  void            DLL_LINKAGE nAltCommit(void);

  void            DLL_LINKAGE nAltAbandon(void);

  void            DLL_LINKAGE nAltAbandonPendingAnnotations(void);

  void            DLL_LINKAGE nAltBeginFixedTransaction(void);

  void            DLL_LINKAGE nAltCommitFixedTransaction(void);

  void            DLL_LINKAGE nAltAbandonFixedTransaction(void);

  void            DLL_LINKAGE nAltBeginWanderingTransaction(void);

  void            DLL_LINKAGE nAltCommitWanderingTransaction(void);

  void            DLL_LINKAGE nAltAbandonWanderingTransaction(void);

  unsigned short  DLL_LINKAGE nAltQueryAltState(void);

  void            DLL_LINKAGE nAltEncrypt(const unsigned char *key,

                                          size_t size);

  void            DLL_LINKAGE nAltDecrypt(const unsigned char *key,

                                          size_t size);

  void            DLL_LINKAGE nAltDecryptForeign(const unsigned char *key,

                                                 size_t size,

                                                 const char *logfilename);

 

  /* Object Read Actions */

  signed char     DLL_LINKAGE nObjReadSignedChar(void);

  short           DLL_LINKAGE nObjReadShort(void);

  long            DLL_LINKAGE nObjReadLong(void);

  unsigned char   DLL_LINKAGE nObjReadUnsignedChar(void);

  unsigned short  DLL_LINKAGE nObjReadUnsignedShort(void);

  unsigned long   DLL_LINKAGE nObjReadUnsignedLong(void);

  float           DLL_LINKAGE nObjReadFloat(void);

  double          DLL_LINKAGE nObjReadDouble(void);

  char            DLL_LINKAGE nObjReadChar(void);

  char *          DLL_LINKAGE nObjReadString(char *s, size_t size);

  unichar         DLL_LINKAGE nObjReadUnicodeChar(void);

  unichar *       DLL_LINKAGE nObjReadUnicodeString(unichar *unis,

                                                    size_t size);

  void *          DLL_LINKAGE nObjReadBinary(void *buffer, size_t *size,

                                             long offset=0);

 

  /* Object Write Actions */

  void            DLL_LINKAGE nObjWriteAggregate(void);

  void            DLL_LINKAGE nObjWriteAbsent(OTYPE otype);

  void            DLL_LINKAGE nObjWriteSignedChar(signed char sc);

  void            DLL_LINKAGE nObjWriteShort(short ss);

  void            DLL_LINKAGE nObjWriteLong(long sl);

  void            DLL_LINKAGE nObjWriteUnsignedChar(unsigned char uc);

  void            DLL_LINKAGE nObjWriteUnsignedShort(unsigned short us);

  void            DLL_LINKAGE nObjWriteUnsignedLong(unsigned long ul);

  void            DLL_LINKAGE nObjWriteFloat(float f);

  void            DLL_LINKAGE nObjWriteDouble(double d);

  void            DLL_LINKAGE nObjWriteChar(char c);

  void            DLL_LINKAGE nObjWriteString(const char *s);

  void            DLL_LINKAGE nObjWriteUnicodeChar(unichar unic);

  void            DLL_LINKAGE nObjWriteUnicodeString(const unichar *unis);

  void            DLL_LINKAGE nObjWriteBinary(const void *buffer, size_t size);

  void            DLL_LINKAGE nObjWritePrimaryIndex(const char *filename=NULL);

  void            DLL_LINKAGE nObjWriteSecondaryIndex(KEYTYPE keytype,

                                                      size_t keysize);

  void            DLL_LINKAGE nObjWriteReference(CURSOR *target);

  void            DLL_LINKAGE nObjWriteReference(unsigned long objectid);

 

  /* Import and Export */

  void            DLL_LINKAGE nObjImportBinary(const char *pathname);

  void            DLL_LINKAGE nObjExportBinary(const char *pathname,

                                               EXPORTMODE mode=EM_OVERWRITE);

  void            DLL_LINKAGE nObjImportOSFile(const char *pathname,

                                               unsigned long retain=OSF_ALL);

  void            DLL_LINKAGE nObjExportOSFile(const char *pathname,

                                               EXPORTMODE mode=EM_OVERWRITE);

  void            DLL_LINKAGE nObjImportObject(void *buffer, size_t size,

                                               const char *logfilename);

  void            DLL_LINKAGE nObjExportObject(void *buffer, size_t *size);

  void            DLL_LINKAGE nObjImportObject(const char *pathname,

                                               const char *logfilename);

  void            DLL_LINKAGE nObjExportObject(const char *pathname,

                                               EXPORTMODE mode=EM_OVERWRITE);

 

  /* Object Transfers between Cursors */

  void            DLL_LINKAGE nObjCopyFrom(CURSOR *source);

  void            DLL_LINKAGE nObjMoveFrom(CURSOR *source);

 

  /* Object Content Management */

  unsigned long   DLL_LINKAGE nObjApplyIdentity(void);

  void            DLL_LINKAGE nObjSetClass(unsigned long classnum);

  void            DLL_LINKAGE nObjSetName(const char *name);

  void            DLL_LINKAGE nObjSetComment(const char *comment);

  void            DLL_LINKAGE nObjPurgeAnnotations(unsigned long annotations);

  void            DLL_LINKAGE nObjChangeIndexTarget(const char *filename);

  unsigned long   DLL_LINKAGE nObjQueryNodeIdentity(void);

  int             DLL_LINKAGE nObjQueryForeign(void);

  unsigned long   DLL_LINKAGE nObjQueryObjectIdentity(void);

  unsigned long   DLL_LINKAGE nObjQueryClass(void);

  size_t          DLL_LINKAGE nObjQueryNameStrLen(void);

  size_t          DLL_LINKAGE nObjQueryCommentStrLen(void);

  char *          DLL_LINKAGE nObjQueryName(char *name, size_t size);

  char *          DLL_LINKAGE nObjQueryComment(char *comment, size_t size);

  unsigned long   DLL_LINKAGE nObjQueryEncryption(void);

  char *          DLL_LINKAGE nObjQueryIndexTarget(char *filename,

                                                   size_t size);

 

  /* Object Queries */

  int             DLL_LINKAGE nObjQueryValid(void);

  OTYPE           DLL_LINKAGE nObjQueryType(size_t *size=NULL);

  int             DLL_LINKAGE nObjQueryAggregate(void);

  int             DLL_LINKAGE nObjQueryData(void);

  int             DLL_LINKAGE nObjQueryDataAbsent(void);

  size_t          DLL_LINKAGE nObjQueryDataSize(void);

  size_t          DLL_LINKAGE nObjQueryObjectSize(void);

  int             DLL_LINKAGE nObjQueryAggregateEmpty(void);

  size_t          DLL_LINKAGE nObjQueryOSFileNameStrLen(void);

  size_t          DLL_LINKAGE nObjQueryOSFilePathStrLen(void);

  char *          DLL_LINKAGE nObjQueryOSFileName(char *name, size_t size);

  char *          DLL_LINKAGE nObjQueryOSFilePath(char *path, size_t size);

  time_t          DLL_LINKAGE nObjQueryOSFileLastModTime(void);

  unsigned long   DLL_LINKAGE nObjQueryOSFileLength(void);

  unsigned long   DLL_LINKAGE nObjQueryReference(void);

  KEYTYPE         DLL_LINKAGE nObjQueryIndexKeyType(size_t *keysize);

 

  /* Object Display Actions */

  size_t          DLL_LINKAGE nObjQueryDisplayStrLen(void);

  char *          DLL_LINKAGE nObjDisplay(char *s, size_t size);

  void            DLL_LINKAGE nObjExportDisplay(const char *filename);

 

  /* Indexing */

  void            DLL_LINKAGE nIndexOpen(void);

  void            DLL_LINKAGE nIndexOpen(ACCESSMODE accessmode,

                                         const void *key, size_t keysize);

  void            DLL_LINKAGE nIndexOpen(int (*cmp)(long key1, long key2));

  void            DLL_LINKAGE nIndexOpen(int (*cmp)(unsigned long key1,

                                                    unsigned long key2));

  void            DLL_LINKAGE nIndexOpen(int (*cmp)(const char *key1,

                                                    const char *key2));

  void            DLL_LINKAGE nIndexOpen(int (*cmp)(const void *key1,

                                                    size_t keysize1,

                                                    const void *key2,

                                                    size_t keysize2));

  void            DLL_LINKAGE nIndexClose(void);

  void            DLL_LINKAGE nIndexFlush(void);

  void            DLL_LINKAGE nIndexErase(void);

  void            DLL_LINKAGE nIndexSetAutoPurge(int on);

  int             DLL_LINKAGE nIndexQueryAutoPurge(void);

  void            DLL_LINKAGE nIndexInclude(CURSOR *object);

  void            DLL_LINKAGE nIndexInclude(unsigned long objectid);

  void            DLL_LINKAGE nIndexInclude(unsigned long objectid, long key);

  void            DLL_LINKAGE nIndexInclude(unsigned long objectid,

                                            unsigned long key);

  void            DLL_LINKAGE nIndexInclude(unsigned long objectid,

                                            const char *key);

  void            DLL_LINKAGE nIndexInclude(unsigned long objectid,

                                            const void *key, size_t keysize);

  void            DLL_LINKAGE nIndexChange(unsigned long objectid, long key,

                                           long newkey);

  void            DLL_LINKAGE nIndexChange(unsigned long objectid,

                                           unsigned long key,

                                           unsigned long newkey);

  void            DLL_LINKAGE nIndexChange(unsigned long objectid,

                                           const char *key,

                                           const char *newkey);

  void            DLL_LINKAGE nIndexChange(unsigned long objectid,

                                           const void *key, size_t keysize,

                                           const void *newkey,

                                           size_t newkeysize);

  void            DLL_LINKAGE nIndexExclude(CURSOR *object);

  void            DLL_LINKAGE nIndexExclude(unsigned long objectid);

  void            DLL_LINKAGE nIndexExclude(unsigned long objectid, long key);

  void            DLL_LINKAGE nIndexExclude(unsigned long objectid,

                                            unsigned long key);

  void            DLL_LINKAGE nIndexExclude(unsigned long objectid,

                                            const char *key);

  void            DLL_LINKAGE nIndexExclude(unsigned long objectid,

                                            const void *key, size_t keysize);

  void            DLL_LINKAGE nIndexExcludeAll(long key);

  void            DLL_LINKAGE nIndexExcludeAll(unsigned long key);

  void            DLL_LINKAGE nIndexExcludeAll(const char *key);

  void            DLL_LINKAGE nIndexExcludeAll(const void *key,

                                               size_t keysize);

  void            DLL_LINKAGE nIndexAttachTo(CURSOR *cursor);

  void            DLL_LINKAGE nIndexDetachFrom(CURSOR *cursor);

  void            DLL_LINKAGE nIndexRegister(CURSOR *range);

  void            DLL_LINKAGE nIndexDeregister(CURSOR *range);

  unsigned long   DLL_LINKAGE nIndexQueryCount(void);

  unsigned long   DLL_LINKAGE nIndexQueryCount(unsigned long objectid);

  unsigned long   DLL_LINKAGE nIndexQueryCountKey(long key);

  unsigned long   DLL_LINKAGE nIndexQueryCountKey(unsigned long key);

  unsigned long   DLL_LINKAGE nIndexQueryCountKey(const char *key);

  unsigned long   DLL_LINKAGE nIndexQueryCountKey(const void *key,

                                                  size_t keysize);

  int             DLL_LINKAGE nIndexQueryIncluded(unsigned long objectid);

  size_t          DLL_LINKAGE nIndexQueryCurrentKeySize(void);

  unsigned long   DLL_LINKAGE nIndexQueryCurrent(void);

  long            DLL_LINKAGE nIndexQueryCurrentLongKeyVal(

                                unsigned long *objectid);

  unsigned long   DLL_LINKAGE nIndexQueryCurrentUnsignedLongKeyVal(

                                unsigned long *objectid);

  char *          DLL_LINKAGE nIndexQueryCurrentStringKeyVal(

                                unsigned long *objectid,

                                char *key, size_t *keysize);

  void *          DLL_LINKAGE nIndexQueryCurrentBinaryKeyVal(

                                unsigned long *objectid,

                                void *key, size_t *keysize);

  void            DLL_LINKAGE nIndexChangeCurrent(long key);

  void            DLL_LINKAGE nIndexChangeCurrent(unsigned long key);

  void            DLL_LINKAGE nIndexChangeCurrent(const char *key);

  void            DLL_LINKAGE nIndexChangeCurrent(const void *key,

                                                  size_t keysize);

  void            DLL_LINKAGE nIndexExcludeCurrent(void);

  void            DLL_LINKAGE nIndexSeek(unsigned long objectid, long key);

  void            DLL_LINKAGE nIndexSeek(unsigned long objectid,

                                         unsigned long key);

  void            DLL_LINKAGE nIndexSeek(unsigned long objectid,

                                         const char *key);

  void            DLL_LINKAGE nIndexSeek(unsigned long objectid,

                                         const void *key, size_t keysize);

  void            DLL_LINKAGE nIndexSeekFirst(void);

  void            DLL_LINKAGE nIndexSeekFirst(long key);

  void            DLL_LINKAGE nIndexSeekFirst(unsigned long key);

  void            DLL_LINKAGE nIndexSeekFirst(const char *key);

  void            DLL_LINKAGE nIndexSeekFirst(const void *key, size_t keysize);

  void            DLL_LINKAGE nIndexSeekLast(void);

  void            DLL_LINKAGE nIndexSeekLast(long key);

  void            DLL_LINKAGE nIndexSeekLast(unsigned long key);

  void            DLL_LINKAGE nIndexSeekLast(const char *key);

  void            DLL_LINKAGE nIndexSeekLast(const void *key, size_t keysize);

  void            DLL_LINKAGE nIndexSeekPrior(void);

  void            DLL_LINKAGE nIndexSeekPrior(long key);

  void            DLL_LINKAGE nIndexSeekPrior(unsigned long key);

  void            DLL_LINKAGE nIndexSeekPrior(const char *key);

  void            DLL_LINKAGE nIndexSeekPrior(const void *key, size_t keysize);

  void            DLL_LINKAGE nIndexSeekNext(void);

  void            DLL_LINKAGE nIndexSeekNext(long key);

  void            DLL_LINKAGE nIndexSeekNext(unsigned long key);

  void            DLL_LINKAGE nIndexSeekNext(const char *key);

  void            DLL_LINKAGE nIndexSeekNext(const void *key, size_t keysize);

 

private:

  void          *p;

  int           d;

  unsigned long e;

 

  /* InitCursor and TerminateCursor are called by the constructor and

   *   destructor, respectively, to improve portability of the DLL among

   *   compilers.  These functions are not intended to be used for any other

   *   purpose.

   */

  void DLL_LINKAGE InitCursor(const char *filename, ACCESSMODE

        accessmode, const void *key, size_t keysize);

  void DLL_LINKAGE TerminateCursor(void);

};

/* Copyright (c) 1993-1997 Menai Corporation */

Return to API Description

Return to e Prototypes

 Home | Product | Consulting | Programming | Reviews | Company | Site Map | Guest Book

 Menai Corporation, 1010 El Camino Real, Suite 300, Menlo Park, California 94025-4335
 800-GAMELON (800-426-3566) (US only), 650-853-6450 (voice), 650-853-6453 (fax)
 Questions about our products and services:
info@menai.com.
 Comments about this web site:
webmaster@menai.com.

Copyright © 1996-98 Menai Corporation. All Rights Reserved. Menai, Gamelon and gamelon(stylized) are worldwide trademarks of Menai Corporation, registered in the United States of America, and the .[g] logo is a worldwide trademark of Menai Corporation. All other trademarks are owned by their respective owners.