Apple Network Setup Manual do Utilizador Página 33

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 184
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 32
CHAPTER 2
Using Network Setup
Working with Entities 33
}
}
return err;
}
The next routine, shown in Listing 2-6, opens the database for reading, gets the
entity references for all of the TCP/IP network connection entities in the default
area (using the
MyGetEntitiesList routine in Listing 2-5), and prints their
user-visible names. This routine calls a routine, MyGetEntityUserVisibleName,
which hasn’t been documented yet. It is shown in Listing 2-9 in the section
“Reading and Writing Preferences” (page 34).
Listing 2-6 Printing the user-visible name for an entity
static void PrintAllTCPEntityNames(void)
{
OSStatus err;
CfgDatabaseRef dbRef;
CfgAreaID readArea;
CfgEntityRef **entityRefs;
ItemCount entityCount;
ItemCount entityIndex;
Str255 userVisibleName;
entityRefs = (CfgEntityRef **) NewHandle(0);
err = MemError();
if (err == noErr) {
err = MyOpenDatabaseForReading(&dbRef, &readArea);
if (err == noErr) {
err = MyGetEntitiesList(dbRef, readArea,
kOTCfgClassNetworkConnection, kOTCfgTypeTCPv4,
entityRefs, nil);
}
if (err == noErr) {
HLock( (Handle) entityRefs ); assert(MemError() ==
noErr);
printf("List of TCP/IP Network Connection Entities\n");
Vista de página 32
1 2 ... 28 29 30 31 32 33 34 35 36 37 38 ... 183 184

Comentários a estes Manuais

Sem comentários