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); }
int editor_line_mark_dirty (int line_id) { editor_db_line *line_db; line_db = (editor_db_line *) editor_db_get_item (ActiveLinesDB, line_id, 0, NULL); if (line_db == NULL) return -1; line_db->flags |= ED_LINE_DIRTY; editor_line_set_modification_time (line_db); return editor_db_update_item (ActiveLinesDB, line_id); }
int editor_line_set_direction (int line, int direction) { editor_db_line *line_db; line_db = (editor_db_line *) editor_db_get_item (ActiveLinesDB, line, 0, NULL); if (line_db == NULL) return -1; line_db->direction = direction; editor_line_set_modification_time (line_db); return editor_db_update_item (ActiveLinesDB, line); }
void editor_line_reset_flag (int line, int flag) { editor_db_line *line_db; line_db = (editor_db_line *) editor_db_get_item (ActiveLinesDB, line, 0, NULL); assert (line_db != NULL); if (line_db == NULL) return; line_db->flags = line_db->flags & ~flag; editor_line_set_modification_time (line_db); editor_db_update_item (ActiveLinesDB, line); }
int editor_line_set_street (int line, int street) { editor_db_line *line_db; line_db = (editor_db_line *) editor_db_get_item (ActiveLinesDB, line, 0, NULL); if (line_db == NULL) return -1; line_db->street = street; editor_line_set_modification_time (line_db); return editor_db_update_item (ActiveLinesDB, line); }
void editor_line_modify_properties (int line, int cfcc, int flags) { editor_db_line *line_db; line_db = (editor_db_line *) editor_db_get_item (ActiveLinesDB, line, 0, NULL); assert (line_db != NULL); if (line_db == NULL) return; line_db->cfcc = cfcc; line_db->flags = flags; editor_line_set_modification_time (line_db); editor_db_update_item (ActiveLinesDB, line); }
int editor_override_line_set_direction (int line, int direction) { editor_db_override *data; int created; int id = editor_override_find (line, &data, &created); int rc; if (id < 0) return 0; data->direction = direction; if (created) { rc = editor_db_write_item (ActiveOverridesDB, id, 1); } else { rc = editor_db_update_item (ActiveOverridesDB, id); } return rc; }
int editor_override_line_reset_flag (int line, int flags) { editor_db_override *data; int created; int id = editor_override_find (line, &data, &created); int rc; if (id < 0) return 0; data->flags = data->flags & ~flags; if (created) { rc = editor_db_write_item (ActiveOverridesDB, id, 1); } else { rc = editor_db_update_item (ActiveOverridesDB, id); } return rc; }