Apple Network Setup Manual do Utilizador Página 29

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 184
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 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 página 28
1 2 ... 24 25 26 27 28 29 30 31 32 33 34 ... 183 184

Comentários a estes Manuais

Sem comentários