From b038b09dd71f3f03575969d8b23bedbcc92a23a9 Mon Sep 17 00:00:00 2001 From: Yury Melnichek Date: Wed, 20 Mar 2013 00:15:00 +0100 Subject: [PATCH] [api] More minor fixes. --- api/src/c/api-client.c | 4 +++- api/src/c/api-client.h | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/api/src/c/api-client.c b/api/src/c/api-client.c index 8935993ab1..5045050c46 100644 --- a/api/src/c/api-client.c +++ b/api/src/c/api-client.c @@ -70,8 +70,10 @@ void MapsWithMe_LatLonToString(double lat, double lon, char * s, int nBytes) } } -char * MapsWithMe_GenShortShowMapUrl(double lat, double lon, double zoomLevel, char const * name) +int MapsWithMe_GenShortShowMapUrl(double lat, double lon, double zoomLevel, char const * name, char * buf, int bufSize) { // @TODO: Implement MapsWithMe_GenShortShowMapUrl(). + // @TODO: Escape URL-unfriendly characters: ! * ' ( ) ; : @ & = + $ , / ? % # [ ] + return 0; } diff --git a/api/src/c/api-client.h b/api/src/c/api-client.h index 5562373150..9335a8950b 100644 --- a/api/src/c/api-client.h +++ b/api/src/c/api-client.h @@ -39,7 +39,8 @@ char * MapsWithMe_GenShowMapUrl(MapsWithMe_ShowMapRequest const * request); */ // Helper method to generate short url. -char * MapsWithMe_GenShortShowMapUrl(double lat, double lon, double zoomLevel, char const * name); +// Returns the number of bytes required to fit the whole URL or an error_code < 0 on error. +int MapsWithMe_GenShortShowMapUrl(double lat, double lon, double zoomLevel, char const * name, char * buf, int bufSize); #ifdef __cplusplus } // Closing brace for extern "C"