next up previous contents
Next: References Up: CCDS User's Guide Previous: Notes

Examples

Programming with CCDS consists of issuing calls to the CCDS programming library functions. The following example show how to get started.

The program in figure 2 accesses the data space given by the -session argument in argv[], then opens the file myfile for reading and writing with a local file offset pointer. If myfile does not exist in the data space, then it is created. See also ccds_open in appendix A. The first 11 bytes segment of myfile is locked, and a message is written. Finally, myfile is unimported to a file named test.

An example makefile to make this program is shown in figure 3.

The program in figure 4 shows how to enable the notification feature of CCDS.

  figure133
Figure 2: Example CCDS C program  

  figure136
Figure 3: Example Makefile  

  figure139
Figure 4: Example CCDS C program  



Soeren Peter Olesen (vss postdoc)
Wed Jan 7 14:44:20 EST 1998