Пример #1
0
void editor_marker_update(int marker, unsigned char flags,
                          const char *note) {

    editor_db_marker *marker_st =
        editor_db_get_item (ActiveMarkersDB, marker, 0, 0);

    int dirty = 0;
    assert(marker_st != NULL);

    if (note == NULL) {
        if (marker_st->note != ROADMAP_INVALID_STRING) {
            dirty++;
            marker_st->note = ROADMAP_INVALID_STRING;
        }
    } else if ((marker_st->note == ROADMAP_INVALID_STRING) ||
               strcmp(editor_dictionary_get(marker_st->note),
                      note)) {

        dirty++;
        marker_st->note = editor_dictionary_add(note);
    }

    if ((marker_st->flags & ~ED_MARKER_DIRTY) !=
            (flags & ~ED_MARKER_DIRTY)) {
        dirty++;
    }

    marker_st->flags = flags;

    if (dirty) editor_db_update_item(ActiveMarkersDB, marker);
}
Пример #2
0
const char *editor_marker_note(int marker) {

    editor_db_marker *marker_st =
        editor_db_get_item (ActiveMarkersDB, marker, 0, 0);
    assert(marker_st != NULL);

    if (marker_st->note == ROADMAP_INVALID_STRING) {
        return "";
    } else {

        return editor_dictionary_get(marker_st->note);
    }
}
Пример #3
0
const char *editor_street_get_street_t2s
               (int street_id) {

   editor_db_street *street;
   
   if (street_id < 0) return "";
   
   street =
      (editor_db_street *) editor_db_get_item
                              (ActiveStreetDB, street_id, 0, NULL);
   assert (street != NULL);

   if (street->t2s < 0) {
      return "";
   }

   return editor_dictionary_get (street->t2s);
}