Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2011-12-20 06:54:25 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-12-20 06:54:25 +0400
commit553cf289a7aab9a2a53331d623fa2cfa475b7728 (patch)
tree667611c9d5427d6c858a9bb57b3006f2aaf066fc /source/blender/blenlib/intern/BLI_dynstr.c
parenta7a6049978fc0789bce2064d6746c87277793cce (diff)
patch [#29651] Add a __str__ Method to Matutils Matrices so print(matrix) Shows Columns as Columns
from Andrew Hale converted from python string formatting to using BLI_dynstr
Diffstat (limited to 'source/blender/blenlib/intern/BLI_dynstr.c')
-rw-r--r--source/blender/blenlib/intern/BLI_dynstr.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/source/blender/blenlib/intern/BLI_dynstr.c b/source/blender/blenlib/intern/BLI_dynstr.c
index 349bc3492e7..ad52de180aa 100644
--- a/source/blender/blenlib/intern/BLI_dynstr.c
+++ b/source/blender/blenlib/intern/BLI_dynstr.c
@@ -226,11 +226,11 @@ int BLI_dynstr_get_len(DynStr *ds)
return ds->curlen;
}
-char *BLI_dynstr_get_cstring(DynStr *ds)
+void BLI_dynstr_get_cstring_ex(DynStr *ds, char *rets)
{
- char *s, *rets= MEM_mallocN(ds->curlen+1, "dynstr_cstring");
+ char *s;
DynStrElem *dse;
-
+
for (s= rets, dse= ds->elems; dse; dse= dse->next) {
int slen= strlen(dse->str);
@@ -239,7 +239,12 @@ char *BLI_dynstr_get_cstring(DynStr *ds)
s+= slen;
}
rets[ds->curlen]= '\0';
-
+}
+
+char *BLI_dynstr_get_cstring(DynStr *ds)
+{
+ char *rets= MEM_mallocN(ds->curlen+1, "dynstr_cstring");
+ BLI_dynstr_get_cstring_ex(ds, rets);
return rets;
}