projects
/
u
/
mdw
/
putty
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add a list box to the config dialogue to switch between panels. Now I don't
[u/mdw/putty]
/
mac
/
otnet.c
diff --git
a/mac/otnet.c
b/mac/otnet.c
index
282141f
..
809906b
100644
(file)
--- a/
mac/otnet.c
+++ b/
mac/otnet.c
@@
-2,6
+2,11
@@
* Macintosh OpenTransport networking abstraction
*/
* Macintosh OpenTransport networking abstraction
*/
+#if TARGET_API_MAC_CARBON
+#define OTCARBONAPPLICATION 1
+#endif
+
+#include <Files.h> /* Needed by OpenTransportInternet.h */
#include <OpenTransport.h>
#include <OpenTptInternet.h>
#include <OpenTransport.h>
#include <OpenTptInternet.h>
@@
-74,26
+79,28
@@
void ot_cleanup(void)
CloseOpenTransport();
}
CloseOpenTransport();
}
-SockAddr ot_namelookup(char *host, char **canonicalname)
+SockAddr ot_namelookup(char
const
*host, char **canonicalname)
{
{
- SockAddr ret = s
malloc(sizeof(struct SockAddr_tag)
);
+ SockAddr ret = s
new(struct SockAddr_tag
);
char *realhost;
char *realhost;
-
- ret->error = OTInetStringToAddress(ot.inetsvc, host, &ret->hostinfo);
+
+ /* Casting away const -- hope OTInetStringToAddress is sensible */
+ ret->error = OTInetStringToAddress(ot.inetsvc, (char *)host,
+ &ret->hostinfo);
ret->resolved = TRUE;
if (ret->error == kOTNoError)
realhost = ret->hostinfo.name;
else
realhost = "";
ret->resolved = TRUE;
if (ret->error == kOTNoError)
realhost = ret->hostinfo.name;
else
realhost = "";
- *canonicalname = s
malloc(1+strlen(realhost)
);
+ *canonicalname = s
newn(1+strlen(realhost), char
);
strcpy(*canonicalname, realhost);
return ret;
}
strcpy(*canonicalname, realhost);
return ret;
}
-SockAddr ot_nonamelookup(char *host)
+SockAddr ot_nonamelookup(char
const
*host)
{
{
- SockAddr ret = s
malloc(sizeof(struct SockAddr_tag)
);
+ SockAddr ret = s
new(struct SockAddr_tag
);
ret->resolved = FALSE;
ret->error = kOTNoError;
ret->resolved = FALSE;
ret->error = kOTNoError;
@@
-198,7
+205,7
@@
Socket ot_register(void *sock, Plug plug)
Actual_Socket ret;
Actual_Socket ret;
- ret = s
malloc(sizeof(struct Socket_tag)
);
+ ret = s
new(struct Socket_tag
);
ret->fn = &fn_table;
ret->error = kOTNoError;
ret->plug = plug;
ret->fn = &fn_table;
ret->error = kOTNoError;
ret->plug = plug;
@@
-247,7
+254,7
@@
Socket ot_new(SockAddr addr, int port, int privport, int oobinline,
InetAddress dest;
TCall connectCall;
InetAddress dest;
TCall connectCall;
- ret = s
malloc(sizeof(struct Socket_tag)
);
+ ret = s
new(struct Socket_tag
);
ret->fn = &fn_table;
ret->error = kOTNoError;
ret->plug = plug;
ret->fn = &fn_table;
ret->error = kOTNoError;
ret->plug = plug;