mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 08:21:25 +00:00
Patches submitted from May 20 to Aug 28 1997
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@2406 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
f0a72da206
commit
25afcc3594
119 changed files with 16409 additions and 1698 deletions
44
Testing/nshost.m
Normal file
44
Testing/nshost.m
Normal file
|
@ -0,0 +1,44 @@
|
|||
#include <Foundation/NSArray.h>
|
||||
#include <Foundation/NSString.h>
|
||||
#include <Foundation/NSHost.h>
|
||||
|
||||
void
|
||||
displayHost(NSHost* h)
|
||||
{
|
||||
NSArray* a;
|
||||
int i;
|
||||
|
||||
printf("\n");
|
||||
a = [h names];
|
||||
for (i = 0; i < [a count]; i++)
|
||||
printf("%s\n", [[a objectAtIndex:i] cStringNoCopy]);
|
||||
a = [h addresses];
|
||||
for (i = 0; i < [a count]; i++)
|
||||
printf("%s\n", [[a objectAtIndex:i] cStringNoCopy]);
|
||||
}
|
||||
|
||||
int
|
||||
main ()
|
||||
{
|
||||
NSHost* a;
|
||||
NSHost* c;
|
||||
NSHost* n;
|
||||
|
||||
c = [NSHost currentHost];
|
||||
displayHost(c);
|
||||
n = [NSHost hostWithName:[c name]];
|
||||
displayHost(n);
|
||||
a = [NSHost hostWithAddress:[c address]];
|
||||
displayHost(a);
|
||||
|
||||
printf("c:%lx, n:%lx, a:%lx\n", c, n, a);
|
||||
|
||||
[NSHost setHostCacheEnabled:NO];
|
||||
|
||||
[n release];
|
||||
n = [NSHost hostWithName:[c name]];
|
||||
displayHost(n);
|
||||
printf("c:%lx, n:%lx, a:%lx\n", c, n, a);
|
||||
|
||||
exit (0);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue