dlugolecki.net.pl
Dziennik
Polecane
Software
projects
/
gedcom-parse.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Updated documentation with new features in 0.90.0.
[gedcom-parse.git]
/
gedcom
/
write.c
diff --git
a/gedcom/write.c
b/gedcom/write.c
index f880bbbe90ef0279d4ab3b1cbfcccab7c608b38b..6e186b7b8c612d444d9895cfa7622df67288a36a 100644
(file)
--- a/
gedcom/write.c
+++ b/
gedcom/write.c
@@
-104,7
+104,8
@@
int write_simple(Gedcom_write_hndl hndl,
}
int write_encoding_value(Gedcom_write_hndl hndl,
}
int write_encoding_value(Gedcom_write_hndl hndl,
- int level, char* xref, char* tag, char* value)
+ int level, const char* xref, const char* tag,
+ const char* value)
{
if (strcmp(value, write_encoding.charset))
gedcom_warning(_("Forcing HEAD.CHAR value to '%s'"),
{
if (strcmp(value, write_encoding.charset))
gedcom_warning(_("Forcing HEAD.CHAR value to '%s'"),
@@
-153,8
+154,13
@@
int write_long(Gedcom_write_hndl hndl, int elt_or_rec,
if (prefix_len + line_len + term_len > MAXWRITELEN) {
line_len = MAXWRITELEN - prefix_len - term_len;
if (prefix_len + line_len + term_len > MAXWRITELEN) {
line_len = MAXWRITELEN - prefix_len - term_len;
- if (!cont_as_conc)
+ if (!cont_as_conc)
{
cont_tag = "CONC";
cont_tag = "CONC";
+ while (value_ptr[line_len] == ' '
+ || value_ptr[line_len-1] == ' ') {
+ line_len--;
+ }
+ }
}
memset(value_part, 0, sizeof(value_part));
}
memset(value_part, 0, sizeof(value_part));
@@
-164,7
+170,7
@@
int write_long(Gedcom_write_hndl hndl, int elt_or_rec,
if (line_len < value_len) {
value_ptr = value_ptr + line_len;
value_len = value_len - line_len;
if (line_len < value_len) {
value_ptr = value_ptr + line_len;
value_len = value_len - line_len;
-
while
(*value_ptr == '\n') {
+
if
(*value_ptr == '\n') {
value_ptr++;
value_len--;
}
value_ptr++;
value_len--;
}
@@
-321,7
+327,7
@@
char* convert_at(const char* input)
int _gedcom_write_val(Gedcom_write_hndl hndl,
int rec_or_elt, int tag, int parent_rec_or_elt,
int _gedcom_write_val(Gedcom_write_hndl hndl,
int rec_or_elt, int tag, int parent_rec_or_elt,
- c
har* xrefstr,
char* val)
+ c
onst char* xrefstr, const
char* val)
{
int result = 1;
int level = 0;
{
int result = 1;
int level = 0;
@@
-342,7
+348,8
@@
int _gedcom_write_val(Gedcom_write_hndl hndl,
}
int gedcom_write_record_str(Gedcom_write_hndl hndl,
}
int gedcom_write_record_str(Gedcom_write_hndl hndl,
- Gedcom_rec rec, char* xrefstr, char* val)
+ Gedcom_rec rec, const char* xrefstr,
+ const char* val)
{
int result = 1;
if (check_type(rec, (val ? GV_CHAR_PTR : GV_NULL)))
{
int result = 1;
if (check_type(rec, (val ? GV_CHAR_PTR : GV_NULL)))
@@
-352,7
+359,7
@@
int gedcom_write_record_str(Gedcom_write_hndl hndl,
int gedcom_write_element_str(Gedcom_write_hndl hndl,
Gedcom_elt elt, int tag, int parent_rec_or_elt,
int gedcom_write_element_str(Gedcom_write_hndl hndl,
Gedcom_elt elt, int tag, int parent_rec_or_elt,
- char* val)
+ c
onst c
har* val)
{
int result = 1;
if (check_type(elt, (val ? GV_CHAR_PTR : GV_NULL)))
{
int result = 1;
if (check_type(elt, (val ? GV_CHAR_PTR : GV_NULL)))
@@
-363,7
+370,7
@@
int gedcom_write_element_str(Gedcom_write_hndl hndl,
int gedcom_write_element_xref(Gedcom_write_hndl hndl,
Gedcom_elt elt, int tag, int parent_rec_or_elt,
int gedcom_write_element_xref(Gedcom_write_hndl hndl,
Gedcom_elt elt, int tag, int parent_rec_or_elt,
- struct xref_value* val)
+
const
struct xref_value* val)
{
int result = 1;
if (check_type(elt, (val ? GV_XREF_PTR : GV_NULL)))
{
int result = 1;
if (check_type(elt, (val ? GV_XREF_PTR : GV_NULL)))
@@
-374,7
+381,7
@@
int gedcom_write_element_xref(Gedcom_write_hndl hndl,
int gedcom_write_element_date(Gedcom_write_hndl hndl,
Gedcom_elt elt, int tag, int parent_rec_or_elt,
int gedcom_write_element_date(Gedcom_write_hndl hndl,
Gedcom_elt elt, int tag, int parent_rec_or_elt,
- struct date_value* val)
+
const
struct date_value* val)
{
int result = 1;
if (check_type(elt, (val ? GV_DATE_VALUE : GV_NULL)))
{
int result = 1;
if (check_type(elt, (val ? GV_DATE_VALUE : GV_NULL)))
@@
-385,7
+392,7
@@
int gedcom_write_element_date(Gedcom_write_hndl hndl,
int gedcom_write_element_age(Gedcom_write_hndl hndl,
Gedcom_elt elt, int tag, int parent_rec_or_elt,
int gedcom_write_element_age(Gedcom_write_hndl hndl,
Gedcom_elt elt, int tag, int parent_rec_or_elt,
- struct age_value* val)
+
const
struct age_value* val)
{
int result = 1;
if (check_type(elt, (val ? GV_AGE_VALUE : GV_NULL)))
{
int result = 1;
if (check_type(elt, (val ? GV_AGE_VALUE : GV_NULL)))
@@
-394,8
+401,8
@@
int gedcom_write_element_age(Gedcom_write_hndl hndl,
return result;
}
return result;
}
-int gedcom_write_user_str(Gedcom_write_hndl hndl, int level, char* tag,
- c
har* xrefstr,
char* value)
+int gedcom_write_user_str(Gedcom_write_hndl hndl, int level, c
onst c
har* tag,
+ c
onst char* xrefstr, const
char* value)
{
int result = 1;
if (tag && tag[0] == '_')
{
int result = 1;
if (tag && tag[0] == '_')
@@
-403,8
+410,8
@@
int gedcom_write_user_str(Gedcom_write_hndl hndl, int level, char* tag,
return result;
}
return result;
}
-int gedcom_write_user_xref(Gedcom_write_hndl hndl, int level, char* tag,
- c
har* xrefstr,
struct xref_value* val)
+int gedcom_write_user_xref(Gedcom_write_hndl hndl, int level, c
onst c
har* tag,
+ c
onst char* xrefstr, const
struct xref_value* val)
{
int result = 1;
if (tag && tag[0] == '_')
{
int result = 1;
if (tag && tag[0] == '_')