aboutsummaryrefslogtreecommitdiff
path: root/libcrystfel
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2013-04-11 14:45:42 +0200
committerThomas White <taw@physics.org>2013-04-11 14:45:42 +0200
commite27da1bd5af8c10fcc17c024d5c9ae2988caf55c (patch)
treeaf7e1c1be53eb91cf494f9141d65191dd3687c68 /libcrystfel
parentff270f275724bfa5fb9b7d184450fd13f34e0ba8 (diff)
Add set_symmetry_name()
Diffstat (limited to 'libcrystfel')
-rw-r--r--libcrystfel/src/symmetry.c15
-rw-r--r--libcrystfel/src/symmetry.h1
2 files changed, 16 insertions, 0 deletions
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);