aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/reference/libcrystfel/CrystFEL-sections.txt1
-rw-r--r--libcrystfel/src/symmetry.c15
-rw-r--r--libcrystfel/src/symmetry.h1
3 files changed, 17 insertions, 0 deletions
diff --git a/doc/reference/libcrystfel/CrystFEL-sections.txt b/doc/reference/libcrystfel/CrystFEL-sections.txt
index b14f4adc..720cabff 100644
--- a/doc/reference/libcrystfel/CrystFEL-sections.txt
+++ b/doc/reference/libcrystfel/CrystFEL-sections.txt
@@ -268,6 +268,7 @@ free_symopmask
<SUBSECTION>
describe_symmetry
symmetry_name
+set_symmetry_name
is_centrosymmetric
</SECTION>
diff --git a/libcrystfel/src/symmetry.c b/libcrystfel/src/symmetry.c
index eb6a9dfb..4fdc13c6 100644
--- a/libcrystfel/src/symmetry.c
+++ b/libcrystfel/src/symmetry.c
@@ -1690,3 +1690,18 @@ const char *symmetry_name(const SymOpList *ops)
{
return ops->name;
}
+
+
+/**
+ * set_symmetry_name:
+ * @ops: A %SymOpList
+ * @name: New name for the %SymOpList
+ *
+ * Sets the text description of @ops to @name. See symmetry_name().
+ * @name will be copied, so you can safely free it after calling this function,
+ * if that's otherwise appropriate.
+ */
+void set_symmetry_name(SymOpList *ops, const char *name)
+{
+ ops->name = strdup(name);
+}
diff --git a/libcrystfel/src/symmetry.h b/libcrystfel/src/symmetry.h
index 7c80522a..68f17991 100644
--- a/libcrystfel/src/symmetry.h
+++ b/libcrystfel/src/symmetry.h
@@ -77,6 +77,7 @@ extern int is_subgroup(const SymOpList *source, const SymOpList *target);
extern int is_centrosymmetric(const SymOpList *s);
extern const char *symmetry_name(const SymOpList *ops);
+extern void set_symmetry_name(SymOpList *ops, const char *name);
extern void describe_symmetry(const SymOpList *s);
extern void add_symop(SymOpList *ops, IntegerMatrix *m);