On 5/21/08, Jorn Tage Tyskerud <email@hidden> wrote:
> Hi all.
>
> I'm creating a tool that determines whether a network connection should
> pass through a proxy. This is fairly straight forward using the
> CFProxySupport APIs on Mac OS X 10.5 (and 10.4) ; however, my tool must be
> backward compatible and run on Mac OS X 10.2 (Jaguar).
>
> Anybody have any idea of how proxy settings and proxy auto-configuration
> settings were determined back then?
For our CarbonLib/CFM application, we've got the following function:
BOOL get_proxy(char *proxy)
{
BOOL useproxy;
ICInstance icinst;
unsigned long attr;
long size;
Str255 macproxy;
OSStatus osresult;
/* Get the proxy information using CarbonLib */
osresult = ICStart(&icinst, 'MyAP');
if(osresult == noErr)
{
Boolean macuseproxy;
size = 255;
ICGetPref(icinst, kICHTTPProxyHost, &attr, macproxy, &size);
P2CStr(macproxy, proxy);
size = sizeof(Boolean);
ICGetPref(icinst, kICUseHTTPProxy, &attr, &macuseproxy, &size);
ICStop(icinst);
if(macuseproxy)
useproxy = TRUE;
else
useproxy = FALSE;
}
else
{
useproxy = FALSE;
}
return useproxy;
}
According to the docs, it should work in any version of MacOSX.
--
Mark
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Carbon-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/carbon-dev/email@hidden
This email sent to email@hidden