From 1d30d0831bee2c4eaae04554a9e0c4454928a4aa Mon Sep 17 00:00:00 2001 From: David Anderson Date: Fri, 24 Feb 2006 07:49:08 +0000 Subject: [PATCH] i have a hat --- plugins/include/string.inc | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/plugins/include/string.inc b/plugins/include/string.inc index 0e024b49..93516c80 100755 --- a/plugins/include/string.inc +++ b/plugins/include/string.inc @@ -27,10 +27,26 @@ native replace(text[],len,const what[],const with[]); native add(dest[],len,const src[],max=0); /* Fills string with given format and parameters. -* Function returns number of copied chars. -* Example: format(dest,"Hello %s. You are %d years old","Tom",17). */ + * Function returns number of copied chars. + * Example: format(dest,"Hello %s. You are %d years old","Tom",17). + * If any of your input buffers overlap with the destination buffer, + * format() falls back to a "copy-back" version as of 1.65. This is + * slower, so you should using a source string that is the same as + * the destination. + */ native format(output[] ,len ,const format[] , {Float,Sql,Result,_}:...); +/* Same as format(), except does not perform a "copy back" check. + * This means formatex() is faster, but does not allow this type + * of call: + * formatex(buffer, "%s", buffer) + * formatex(buffer, buffer, buffer) + * formatex(buffer, "%s", buffer[5]) + * This is because the output is directly stored into "buffer", + * rather than copied back at the end. + */ +native formatex(output[] ,len ,const format[] , {Float,Sql,Result,_}:...); + /* Gets parameters from function as formated string. */ native format_args(output[] ,len ,pos = 0);