Apple Network Setup Manual de usuario Pagina 29

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 184
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 28
CHAPTER 2
Using Network Setup
Opening and Closing the Network Setup Database 29
If commit is false, the routine calls OTCfgAbortAreaModifications to discard the
changes made in the writable temporary area. The read area is not changed, and
the network protocol stacks continue unaffected.
In contrast to MyCloseDatabaseAfterReading shown in Listing 2-3,
MyCloseDatabaseAfterWriting does not always throw away error results. If
OTCfgCommitAreaModifications returns an error, the
MyCloseDatabaseAfterWriting routine aborts. Your application may respond to
this by calling the same routine again, this time with commit set to false.
Listing 2-4 Closing the database after writing
static OSStatus MyCloseDatabaseAfterWriting(CfgDatabaseRef dbRef,
CfgAreaID readArea,
CfgAreaID writeArea,
Boolean commit)
{
OSStatus err;
OSStatus junk;
assert(dbRef != nil);
assert(readArea != kInvalidCfgAreaID);
assert(writeArea != kInvalidCfgAreaID);
if ( commit ) {
err = OTCfgCommitAreaModifications(dbRef, readArea, writeArea);
} else {
junk = OTCfgAbortAreaModifications(dbRef, readArea);
assert(junk == noErr);
err = noErr;
}
if (err == noErr) {
err = OTCfgCloseDatabase(&dbRef);
}
return err;
}
Vista de pagina 28
1 2 ... 24 25 26 27 28 29 30 31 32 33 34 ... 183 184

Comentarios a estos manuales

Sin comentarios