]> granicus.if.org Git - graphviz/commitdiff
document statistics function in the libxdot AP
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 13 Mar 2021 18:32:17 +0000 (10:32 -0800)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 20 Mar 2021 00:18:44 +0000 (17:18 -0700)
Related to #1957.

lib/xdot/xdot.3

index 6eac0a19d647b70ae86f4d9d6cb3d828115bd1a3..c11a353bd8ad5ee258997f98a99958e8cfc4ca03 100644 (file)
@@ -128,11 +128,30 @@ typedef struct {
     int flags;
 } xdot;
 
+typedef struct {
+    int cnt;  /* no. of xdot ops */
+    int n_ellipse;
+    int n_polygon;
+    int n_polygon_pts;
+    int n_polyline;
+    int n_polyline_pts;
+    int n_bezier;
+    int n_bezier_pts;
+    int n_text;
+    int n_font;
+    int n_style;
+    int n_color;
+    int n_image;
+    int n_gradcolor;
+    int n_fontchar;
+} xdot_stats;
+
 xdot* parseXDotF (char*, drawfunc_t opfns[], int sz);
 xdot* parseXDot (char*);
 char* sprintXDot (xdot*);
 void fprintXDot (FILE*, xdot*);
 void freeXDot (xdot*);
+int statXDot (xdot*, xdot_stats*);
 
 xdot_grad_type colorType (char*);
 xdot_color* parseXDotColor (char*);
@@ -256,6 +275,11 @@ the result in \fIclr\fP. It returns NULL on failure.
 .PP
 .SS "  void freeXDotColor (xdot_color* cp)"
 This frees the resources associated with a value of type \fIxdot_color\fP.
+.PP
+.SS "  int statXDot (xdot *x, xdot_stats *sp)"
+This function is provided for retrieving various statistics about an \fIxdot\fP
+object. Returns 0 on success and populates the output parameter \fIsp\fP with
+counts of various entities in the \fIxdot\fP object.
 
 .SH BUGS
 Although some small checking is done on the \fIsz\fP argument to