[Imgcif-l] renaming a data block?
Herbert J. Bernstein
yaya at bernstein-plus-sons.com
Wed Oct 15 02:48:15 BST 2008
Dear Michael,
Please note cbf_set_datablockname, below. Note that you have to
be in the datablock you intend to change. The first thing the code
does is to look for a parent of type CBF_DATABLOCK. It can
fail if the target name is already in use. In that case you need to copy
instead of rename. The necessary copy loop is in the code of cif2cbf.
I did not get your sf mail (my spam filter is very tight). Just
email me your sf username and I'll add you to the CBFlib project.
I'll be a bit out of touch for a few days -- I am off to Dubuque
for a meeting.
Regards,
Herbert
At the API level:
2.3.13 cbf_set_datablockname, cbf_set_saveframename
PROTOTYPE
#include "cbf.h"
int cbf_set_datablockname (cbf_handle handle, const char *datablockname);
int cbf_set_saveframename (cbf_handle handle. const char *saveframename);
DESCRIPTION
cbf_set_datablockname changes the name of the current data block to
datablockname. cbf_set_saveframename changes the name of the current save
frame to saveframename.
If a data block or save frame with this name already exists (comparison is
case-insensitive), the function returns CBF_IDENTICAL.
ARGUMENTS
handle CBF handle.
datablockname The new data block name.
datablockname The new save frame name.
RETURN VALUE
Returns an error code on failure or 0 for success.
SEE ALSO
2.3.5 cbf_new_datablock, cbf_new_saveframe
2.3.14 cbf_reset_datablocks
2.3.15 cbf_reset_datablock, cbf_reset_saveframe
2.3.17 cbf_remove_datablock, cbf_remove_saveframe
2.3.42 cbf_datablock_name
=====================================================
Herbert J. Bernstein, Professor of Computer Science
Dowling College, Kramer Science Center, KSC 121
Idle Hour Blvd, Oakdale, NY, 11769
+1-631-244-3035
yaya at dowling.edu
=====================================================
On Tue, 14 Oct 2008, Michael Blum wrote:
> Return-path: <imgcif-l-bounces at iucr.org>
> From: Michael Blum <blum at rayonix.com>
> To: The Crystallographic Binary File and its imgCIF application to image data <imgcif-l at iucr.org>
> In-Reply-To: <20081002084239.E47913 at epsilon.pair.com>
> Mime-Version: 1.0 (Apple Message framework v929.2)
> Date: Tue, 14 Oct 2008 18:09:25 -0500
> Subject: [Imgcif-l] renaming a data block?
>
> Hi,
>
> Can someone tell me how I would rename a data block using CBFlib?
>
> The situation is that I am reading in a template CBF file that
> contains some extra categories (eg, to describe a beamline, or
> goniometer)
> This file must have a data block and this becomes the working data
> block.
> I am then adding our own categories (detector and data collection
> parameters) to this data block and/or replacing nominal values with
> dynamically generated values. I then want to write out the CBF file.
>
> I want the data block written out to have a name specified by the
> program, not the name in the template file.
> I seem to be able to replace anything else (categories, and values),
> but not the data block name.
>
> Actually, I would like it to be more flexible. The purpose for which
> I use the template file is to allow the user to either 1) add
> additional categories and columns to our nominal CBF header data or 2)
> to override our internally generated values. I want the data block
> name to behave the same way, but it cannot because the template file
> must have a data block name and this always overrides my internal name.
>
> Thanks for any ideas.
>
> Michael
>
> PS - Herb - I sent a request through the sourceforge mail system to be
> added as a developer so that I can post some files. Maybe you didn't
> ge the email?
> _______________
> Michael L. Blum Toll Free: 877-627-XRAY (627-9729)
> Rayonix, LLC Tel: 847-869-1548
> 1880 Oak Avenue Fax: 847-869-1587
> Evanston, IL 60201 Email: blum at rayonix.com
> USA WWW: www.rayonix.com
>
>
>
>
>
> _______________________________________________
> imgcif-l mailing list
> imgcif-l at iucr.org
> http://scripts.iucr.org/mailman/listinfo/imgcif-l
> Content-Type: text/plain; charset=US-ASCII
> Content-Transfer-Encoding: quoted-printable
> Content-Disposition: inline
>
> Hi,
>
> Can someone tell me how I would rename a data block using CBFlib?
>
> The situation is that I am reading in a template CBF file that =20
> contains some extra categories (eg, to describe a beamline, or =20
> goniometer)
> This file must have a data block and this becomes the working data =20
> block.
> I am then adding our own categories (detector and data collection =20
> parameters) to this data block and/or replacing nominal values with =20
> dynamically generated values. I then want to write out the CBF file.
>
> I want the data block written out to have a name specified by the =20
> program, not the name in the template file.
> I seem to be able to replace anything else (categories, and values), =20
> but not the data block name.
>
> Actually, I would like it to be more flexible. The purpose for which =20
> I use the template file is to allow the user to either 1) add =20
> additional categories and columns to our nominal CBF header data or 2) =20
> to override our internally generated values. I want the data block =20
> name to behave the same way, but it cannot because the template file =20
> must have a data block name and this always overrides my internal name.
>
> Thanks for any ideas.
>
> Michael
>
> PS - Herb - I sent a request through the sourceforge mail system to be =20
> added as a developer so that I can post some files. Maybe you didn't =20
> ge the email?
> _______________
> Michael L. Blum Toll Free: 877-627-XRAY (627-9729)
> Rayonix, LLC Tel: 847-869-1548
> 1880 Oak Avenue Fax: 847-869-1587
> Evanston, IL 60201 Email: blum at rayonix.com
> USA WWW: www.rayonix.com
>
>
>
>
>
> _______________________________________________
> imgcif-l mailing list
> imgcif-l at iucr.org
> http://scripts.iucr.org/mailman/listinfo/imgcif-l
>
>
More information about the imgcif-l
mailing list