Differences From Artifact [29fca6defb]:
- File
src/OFSystemInfo.m
— part of check-in
[43c80a7593]
at
2023-05-21 17:47:10
on branch trunk
— Change how +[OFSystemInfo networkInterfaces] works
This removes functionality which will be restored later. (user: js, size: 20397) [annotate] [blame] [check-ins using]
To Artifact [8a22d63aae]:
- File src/OFSystemInfo.m — part of check-in [ef03831928] at 2023-06-04 15:33:55 on branch trunk — Improve API for +[OFSystemInfo networkInterfaces] (user: js, size: 20799) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
120 121 122 123 124 125 126 127 128 129 130 131 132 133 | typedef unsigned int NSSearchPathEnumerationState; extern NSSearchPathEnumerationState NSStartSearchPathEnumeration( NSSearchPathDirectory, NSSearchPathDomainMask); extern NSSearchPathEnumerationState NSGetNextSearchPathEnumeration( NSSearchPathEnumerationState, char *); #endif #if defined(OF_AMD64) || defined(OF_X86) struct X86Regs { uint32_t eax, ebx, ecx, edx; }; #endif | > > > > | 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 | typedef unsigned int NSSearchPathEnumerationState; extern NSSearchPathEnumerationState NSStartSearchPathEnumeration( NSSearchPathDirectory, NSSearchPathDomainMask); extern NSSearchPathEnumerationState NSGetNextSearchPathEnumeration( NSSearchPathEnumerationState, char *); #endif #ifdef OF_HAVE_SOCKETS OFNetworkInterfaceKey OFNetworkInterfaceIndex = @"OFNetworkInterfaceIndex"; #endif #if defined(OF_AMD64) || defined(OF_X86) struct X86Regs { uint32_t eax, ebx, ecx, edx; }; #endif |
︙ | ︙ | |||
835 836 837 838 839 840 841 | + (bool)isWindowsNT { return !(GetVersion() & 0x80000000); } #endif #ifdef OF_HAVE_SOCKETS | | | | | | > > > > > > > > | 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 | + (bool)isWindowsNT { return !(GetVersion() & 0x80000000); } #endif #ifdef OF_HAVE_SOCKETS + (OFDictionary OF_GENERIC(OFString *, OFNetworkInterface) *)networkInterfaces { # ifdef HAVE_IF_NAMEINDEX OFMutableDictionary *ret = [OFMutableDictionary dictionary]; void *pool = objc_autoreleasePoolPush(); OFStringEncoding encoding = [OFLocale encoding]; struct if_nameindex *nameindex = if_nameindex(); if (nameindex == NULL) { objc_autoreleasePoolPop(pool); return nil; } @try { for (size_t i = 0; nameindex[i].if_index != 0; i++) { OFString *name = [OFString stringWithCString: nameindex[i].if_name encoding: encoding]; OFNumber *index = [OFNumber numberWithUnsignedInt: nameindex[i].if_index]; OFDictionary *interface = [OFDictionary dictionaryWithObject: index forKey: OFNetworkInterfaceIndex]; [ret setObject: interface forKey: name]; } } @finally { if_freenameindex(nameindex); } [ret makeImmutable]; objc_autoreleasePoolPop(pool); |
︙ | ︙ |