summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/include/gnunet_gns_service.h39
-rw-r--r--src/include/gnunet_network_lib.h2
-rw-r--r--src/util/os_installation.c34
3 files changed, 37 insertions, 38 deletions
diff --git a/src/include/gnunet_gns_service.h b/src/include/gnunet_gns_service.h
index 618d3c2c2..5eaf8b058 100644
--- a/src/include/gnunet_gns_service.h
+++ b/src/include/gnunet_gns_service.h
@@ -116,6 +116,7 @@ enum GNUNET_GNS_RecordType
116 GNUNET_GNS_RECORD_REV = GNUNET_NAMESTORE_TYPE_REV 116 GNUNET_GNS_RECORD_REV = GNUNET_NAMESTORE_TYPE_REV
117}; 117};
118 118
119
119/** 120/**
120 * Initialize the connection with the GNS service. 121 * Initialize the connection with the GNS service.
121 * 122 *
@@ -169,12 +170,13 @@ typedef void (*GNUNET_GNS_LookupResultProcessor) (void *cls,
169 */ 170 */
170struct GNUNET_GNS_LookupRequest* 171struct GNUNET_GNS_LookupRequest*
171GNUNET_GNS_lookup (struct GNUNET_GNS_Handle *handle, 172GNUNET_GNS_lookup (struct GNUNET_GNS_Handle *handle,
172 const char * name, 173 const char * name,
173 enum GNUNET_GNS_RecordType type, 174 enum GNUNET_GNS_RecordType type,
174 int only_cached, 175 int only_cached,
175 struct GNUNET_CRYPTO_RsaPrivateKey *shorten_key, 176 struct GNUNET_CRYPTO_RsaPrivateKey *shorten_key,
176 GNUNET_GNS_LookupResultProcessor proc, 177 GNUNET_GNS_LookupResultProcessor proc,
177 void *proc_cls); 178 void *proc_cls);
179
178 180
179/** 181/**
180 * Perform an asynchronous lookup operation on the GNS 182 * Perform an asynchronous lookup operation on the GNS
@@ -193,13 +195,13 @@ GNUNET_GNS_lookup (struct GNUNET_GNS_Handle *handle,
193 */ 195 */
194struct GNUNET_GNS_LookupRequest* 196struct GNUNET_GNS_LookupRequest*
195GNUNET_GNS_lookup_zone (struct GNUNET_GNS_Handle *handle, 197GNUNET_GNS_lookup_zone (struct GNUNET_GNS_Handle *handle,
196 const char * name, 198 const char * name,
197 struct GNUNET_CRYPTO_ShortHashCode *zone, 199 struct GNUNET_CRYPTO_ShortHashCode *zone,
198 enum GNUNET_GNS_RecordType type, 200 enum GNUNET_GNS_RecordType type,
199 int only_cached, 201 int only_cached,
200 struct GNUNET_CRYPTO_RsaPrivateKey *shorten_key, 202 struct GNUNET_CRYPTO_RsaPrivateKey *shorten_key,
201 GNUNET_GNS_LookupResultProcessor proc, 203 GNUNET_GNS_LookupResultProcessor proc,
202 void *proc_cls); 204 void *proc_cls);
203 205
204 206
205/** 207/**
@@ -221,7 +223,7 @@ GNUNET_GNS_cancel_lookup_request (struct GNUNET_GNS_LookupRequest *lr);
221 * @param short_name the shortened name or NULL if no result 223 * @param short_name the shortened name or NULL if no result
222 */ 224 */
223typedef void (*GNUNET_GNS_ShortenResultProcessor) (void *cls, 225typedef void (*GNUNET_GNS_ShortenResultProcessor) (void *cls,
224 const char* short_name); 226 const char* short_name);
225 227
226 228
227/** 229/**
@@ -274,6 +276,7 @@ GNUNET_GNS_shorten_zone (struct GNUNET_GNS_Handle *handle,
274void 276void
275GNUNET_GNS_cancel_shorten_request (struct GNUNET_GNS_ShortenRequest *sr); 277GNUNET_GNS_cancel_shorten_request (struct GNUNET_GNS_ShortenRequest *sr);
276 278
279
277/* *************** Standard API: get authority ******************* */ 280/* *************** Standard API: get authority ******************* */
278 281
279 282
@@ -285,7 +288,7 @@ GNUNET_GNS_cancel_shorten_request (struct GNUNET_GNS_ShortenRequest *sr);
285 * @param auth_name the name of the auhtority or NULL 288 * @param auth_name the name of the auhtority or NULL
286 */ 289 */
287typedef void (*GNUNET_GNS_GetAuthResultProcessor) (void *cls, 290typedef void (*GNUNET_GNS_GetAuthResultProcessor) (void *cls,
288 const char* short_name); 291 const char* short_name);
289 292
290 293
291/** 294/**
@@ -299,9 +302,9 @@ typedef void (*GNUNET_GNS_GetAuthResultProcessor) (void *cls,
299 */ 302 */
300struct GNUNET_GNS_GetAuthRequest* 303struct GNUNET_GNS_GetAuthRequest*
301GNUNET_GNS_get_authority (struct GNUNET_GNS_Handle *handle, 304GNUNET_GNS_get_authority (struct GNUNET_GNS_Handle *handle,
302 const char * name, 305 const char * name,
303 GNUNET_GNS_GetAuthResultProcessor proc, 306 GNUNET_GNS_GetAuthResultProcessor proc,
304 void *proc_cls); 307 void *proc_cls);
305 308
306 309
307/** 310/**
diff --git a/src/include/gnunet_network_lib.h b/src/include/gnunet_network_lib.h
index 762e2faca..06a5ce903 100644
--- a/src/include/gnunet_network_lib.h
+++ b/src/include/gnunet_network_lib.h
@@ -197,7 +197,7 @@ GNUNET_NETWORK_socket_recvfrom_amount (const struct GNUNET_NETWORK_Handle
197ssize_t 197ssize_t
198GNUNET_NETWORK_socket_recvfrom (const struct GNUNET_NETWORK_Handle *desc, 198GNUNET_NETWORK_socket_recvfrom (const struct GNUNET_NETWORK_Handle *desc,
199 void *buffer, size_t length, 199 void *buffer, size_t length,
200 struct sockaddr *src_addr, socklen_t * addrlen); 200 struct sockaddr *src_addr, socklen_t *addrlen);
201 201
202 202
203/** 203/**
diff --git a/src/util/os_installation.c b/src/util/os_installation.c
index c52628dcd..1e51c1327 100644
--- a/src/util/os_installation.c
+++ b/src/util/os_installation.c
@@ -194,29 +194,26 @@ get_path_from_dyld_image ()
194 const char *path; 194 const char *path;
195 char *p; 195 char *p;
196 char *s; 196 char *s;
197 int i; 197 unsigned int i;
198 int c; 198 int c;
199 199
200 p = NULL;
201 c = _dyld_image_count (); 200 c = _dyld_image_count ();
202 for (i = 0; i < c; i++) 201 for (i = 0; i < c; i++)
203 { 202 {
204 if (_dyld_get_image_header (i) == &_mh_dylib_header) 203 if (_dyld_get_image_header (i) != &_mh_dylib_header)
205 { 204 continue;
206 path = _dyld_get_image_name (i); 205 path = _dyld_get_image_name (i);
207 if ( (NULL != path) && (strlen (path) > 0) ) 206 if ( (NULL == path) || (0 == strlen (path)) )
208 { 207 continue;
209 p = GNUNET_strdup (path); 208 p = GNUNET_strdup (path);
210 s = p + strlen (p); 209 s = p + strlen (p);
211 while ((s > p) && ('/' != *s)) 210 while ((s > p) && ('/' != *s))
212 s--; 211 s--;
213 s++; 212 s++;
214 *s = '\0'; 213 *s = '\0';
215 } 214 return p;
216 break;
217 }
218 } 215 }
219 return p; 216 return NULL;
220} 217}
221#endif 218#endif
222 219
@@ -237,8 +234,7 @@ get_path_from_PATH (const char *binary)
237 char *buf; 234 char *buf;
238 const char *p; 235 const char *p;
239 236
240 p = getenv ("PATH"); 237 if (NULL == (p = getenv ("PATH")))
241 if (NULL == p)
242 return NULL; 238 return NULL;
243#if WINDOWS 239#if WINDOWS
244 /* On W32 look in CWD first. */ 240 /* On W32 look in CWD first. */