Add:Core:Possibility to log at defined position
authormartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>
Wed, 26 Jan 2011 16:57:41 +0000 (16:57 +0000)
committermartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>
Wed, 26 Jan 2011 16:57:41 +0000 (16:57 +0000)
git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@4048 ffa7fe5e-494d-0410-b361-a75ebd5db220

navit/navit/navit.c
navit/navit/navit.h

index 180c3c4..e308c50 100644 (file)
@@ -1235,6 +1235,22 @@ navit_textfile_debug_log(struct navit *this_, const char *fmt, ...)
 }
 
 void
+navit_textfile_debug_log_at(struct navit *this_, struct pcoord *pc, const char *fmt, ...)
+{
+       va_list ap;
+       char *str1,*str2;
+       va_start(ap, fmt);
+       if (this_->textfile_debug_log && this_->vehicle) {
+               str1=g_strdup_vprintf(fmt, ap);
+               str2=g_strdup_printf("0x%x 0x%x%s%s\n", pc->x, pc->y, strlen(str1) ? " " : "", str1);
+               log_write(this_->textfile_debug_log, str2, strlen(str2), 0);
+               g_free(str2);
+               g_free(str1);
+       }
+               va_end(ap);
+}
+
+void
 navit_say(struct navit *this_, char *text)
 {
        if(this_->speech) {
index 5cd24b9..95ba1de 100644 (file)
@@ -80,6 +80,7 @@ void navit_set_destination(struct navit *this_, struct pcoord *c, const char *de
 void navit_set_destinations(struct navit *this_, struct pcoord *c, int count, const char *description, int async);
 int navit_check_route(struct navit *this_);
 void navit_textfile_debug_log(struct navit *this_, const char *fmt, ...);
+void navit_textfile_debug_log_at(struct navit *this_, struct pcoord *pc, const char *fmt, ...);
 int navit_speech_estimate(struct navit *this_, char *str);
 void navit_say(struct navit *this_, char *text);
 void navit_speak(struct navit *this_);