/* Gamelon(tm) File I/O Library Sample Code  C Language   */

/* (C)1994 Menai Corporation(tm)  Released for public use */

 

/* Example 6a. How to specify annotations during a   */

/* simple alteration.                                */

 

/* In order to specify annotations to an object      */

/* during a simple alteration, the annotations must  */

/* be specified between time the alteration is       */

/* initiated and the time the data is written into   */

/* an object. (Assume an empty file.)                */

 

#include <stdlib.h>

#include "gfcursor.h"

 

int main(void) {

char newchar = 'u';

int valid;

CURSOR *c = new_CURSOR(NULL,

"newfile",

AM_SHARED,

NULL,

0);

eCursorQueryValid(c, &valid);

if (!valid)

exit(1);

eCursorMoveIn(c);

eCursorMovePreFirst(c);

eAltAppend(c);

eObjSetComment(c, "Response to question #1");

eObjSetClass(c, 144);

eObjWriteChar(c, newchar);

delete_CURSOR(c);

return 0;

}

 

/* Ending file layout:                                  */

/*   {                                                                    }    */

/*     ['u':CO("Response to question #1"):CL("144")]     */

 

/* The above code associated the comment and class      */

/* number with the object containing the character      */

/* value 'u'. Each type of annotation can only be       */

/* specified once within a single alteration. Once an   */

/* annotation has been specified in an alteration, any  */

/* subsequent attempts to set that alteration will be   */

/* ignored unless the programmer calls a special        */

/* function which abandons all the pending annotations  */

/* specified up to that point within the current single */

/* alteration. Alternately, the programmer can commit   */

/* the pending annotations and set them again in        */

/* another alteration (overwriting the original         */

/* annotations), or commit the pending annotations and  */

/* call another function to purge them from the object. */

Download this sample source code

Return to Samples List

 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.