From aa03132bc30369dc310fdcebe0bf1d94bab1114f Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Sun, 20 Jan 2008 23:53:13 +0000 Subject: [Coder API's]: Added a "generic unique name-finding function". Basically, this is based on the behaviour of the unique_constraint_name (or equivilant) functions, which have traditionally been duplicated everytime a new datatype needed this. Currently, this is in use for the following things: * Constraints * Action/Bone Groups * Local Action Markers / PoseLib poses Usage Notes: * The file in which this is to be used should include the standard header file . This defines the offsetof() macro, which should be used to find the relative location of the "name" member of the structs * This function is only designed for names of up to 128 chars in length (Most names are at most 32. TimeMarkers are 64). If a longer string needs to be handled, the function will need to be modified accordingly. * defname is the default name that should be used in case one hasn't been specified already --- source/blender/blenlib/BLI_blenlib.h | 1 + 1 file changed, 1 insertion(+) (limited to 'source/blender/blenlib/BLI_blenlib.h') diff --git a/source/blender/blenlib/BLI_blenlib.h b/source/blender/blenlib/BLI_blenlib.h index e149c92c72b..fed513d3279 100644 --- a/source/blender/blenlib/BLI_blenlib.h +++ b/source/blender/blenlib/BLI_blenlib.h @@ -107,6 +107,7 @@ int BLI_findindex(struct ListBase *listbase, void *vlink); void BLI_freelistN(struct ListBase *listbase); void BLI_addtail(struct ListBase *listbase, void *vlink); void BLI_remlink(struct ListBase *listbase, void *vlink); +void BLI_uniquename(struct ListBase *list, void *vlink, char defname[], short name_offs, short len); void BLI_newname(char * name, int add); int BLI_stringdec(char *string, char *kop, char *start, unsigned short *numlen); void BLI_stringenc(char *string, char *kop, char *start, unsigned short numlen, int pic); -- cgit v1.2.3