Revision: 1398
Author: [email protected]
Date: Fri Nov 19 04:56:37 2010
Log: Added NYTP_write_attribute_nv()
http://code.google.com/p/perl-devel-nytprof/source/detail?r=1398
Modified:
/trunk/FileHandle.h
/trunk/FileHandle.xs
=======================================
--- /trunk/FileHandle.h Thu Sep 16 09:51:26 2010
+++ /trunk/FileHandle.h Fri Nov 19 04:56:37 2010
@@ -91,6 +91,8 @@
size_t key_len, long value);
size_t NYTP_write_attribute_unsigned(NYTP_file ofile, const char *key,
size_t key_len, unsigned long value);
+size_t NYTP_write_attribute_nv(NYTP_file ofile, const char *key,
+ size_t key_len, NV value);
size_t NYTP_start_deflate_write_tag_comment(NYTP_file ofile, int
compression_level);
size_t NYTP_write_process_start(NYTP_file ofile, U32 pid, U32 ppid, NV
time_of_day);
size_t NYTP_write_process_end(NYTP_file ofile, U32 pid, NV time_of_day);
=======================================
--- /trunk/FileHandle.xs Thu Sep 16 09:51:26 2010
+++ /trunk/FileHandle.xs Fri Nov 19 04:56:37 2010
@@ -903,6 +903,16 @@
return NYTP_write_attribute_string(ofile, key, key_len, buffer, len);
}
+
+size_t
+NYTP_write_attribute_nv(NYTP_file ofile, const char *key,
+ size_t key_len, NV value)
+{
+ char buffer[NV_DIG+20]; /* see Perl_sv_2pv_flags */
+ const size_t len = my_snprintf(buffer, sizeof(buffer), "%g", value);
+
+ return NYTP_write_attribute_string(ofile, key, key_len, buffer, len);
+}
#ifdef HAS_ZLIB
--
You've received this message because you are subscribed to
the Devel::NYTProf Development User group.
Group hosted at: http://groups.google.com/group/develnytprof-dev
Project hosted at: http://perl-devel-nytprof.googlecode.com
CPAN distribution: http://search.cpan.org/dist/Devel-NYTProf
To post, email: [email protected]
To unsubscribe, email: [email protected]