/usr/share/doc/libglib2.0-doc/glib/glib-N-ary-Trees.html is in libglib2.0-doc 2.32.1-0ubuntu2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>N-ary Trees</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
<link rel="home" href="index.html" title="GLib Reference Manual">
<link rel="up" href="glib-data-types.html" title="GLib Data Types">
<link rel="prev" href="glib-Balanced-Binary-Trees.html" title="Balanced Binary Trees">
<link rel="next" href="glib-Quarks.html" title="Quarks">
<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
<tr valign="middle">
<td><a accesskey="p" href="glib-Balanced-Binary-Trees.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="glib-data-types.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">GLib Reference Manual</th>
<td><a accesskey="n" href="glib-Quarks.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts">
<a href="#glib-N-ary-Trees.synopsis" class="shortcut">Top</a>
|
<a href="#glib-N-ary-Trees.description" class="shortcut">Description</a>
</td></tr>
</table>
<div class="refentry">
<a name="glib-N-ary-Trees"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="glib-N-ary-Trees.top_of_page"></a>N-ary Trees</span></h2>
<p>N-ary Trees — trees of data with any number of branches</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv">
<a name="glib-N-ary-Trees.synopsis"></a><h2>Synopsis</h2>
<pre class="synopsis">
#include <glib.h>
struct <a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode">GNode</a>;
<a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="returnvalue">GNode</span></a> * <a class="link" href="glib-N-ary-Trees.html#g-node-new" title="g_node_new ()">g_node_new</a> (<em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer"><span class="type">gpointer</span></a> data</code></em>);
<a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="returnvalue">GNode</span></a> * <a class="link" href="glib-N-ary-Trees.html#g-node-copy" title="g_node_copy ()">g_node_copy</a> (<em class="parameter"><code><a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a> *node</code></em>);
<a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer"><span class="returnvalue">gpointer</span></a> (<a class="link" href="glib-N-ary-Trees.html#GCopyFunc" title="GCopyFunc ()">*GCopyFunc</a>) (<em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gconstpointer" title="gconstpointer"><span class="type">gconstpointer</span></a> src</code></em>,
<em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer"><span class="type">gpointer</span></a> data</code></em>);
<a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="returnvalue">GNode</span></a> * <a class="link" href="glib-N-ary-Trees.html#g-node-copy-deep" title="g_node_copy_deep ()">g_node_copy_deep</a> (<em class="parameter"><code><a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a> *node</code></em>,
<em class="parameter"><code><a class="link" href="glib-N-ary-Trees.html#GCopyFunc" title="GCopyFunc ()"><span class="type">GCopyFunc</span></a> copy_func</code></em>,
<em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer"><span class="type">gpointer</span></a> data</code></em>);
<a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="returnvalue">GNode</span></a> * <a class="link" href="glib-N-ary-Trees.html#g-node-insert" title="g_node_insert ()">g_node_insert</a> (<em class="parameter"><code><a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a> *parent</code></em>,
<em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gint" title="gint"><span class="type">gint</span></a> position</code></em>,
<em class="parameter"><code><a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a> *node</code></em>);
<a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="returnvalue">GNode</span></a> * <a class="link" href="glib-N-ary-Trees.html#g-node-insert-before" title="g_node_insert_before ()">g_node_insert_before</a> (<em class="parameter"><code><a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a> *parent</code></em>,
<em class="parameter"><code><a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a> *sibling</code></em>,
<em class="parameter"><code><a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a> *node</code></em>);
<a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="returnvalue">GNode</span></a> * <a class="link" href="glib-N-ary-Trees.html#g-node-insert-after" title="g_node_insert_after ()">g_node_insert_after</a> (<em class="parameter"><code><a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a> *parent</code></em>,
<em class="parameter"><code><a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a> *sibling</code></em>,
<em class="parameter"><code><a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a> *node</code></em>);
#define <a class="link" href="glib-N-ary-Trees.html#g-node-append" title="g_node_append()">g_node_append</a> (parent,
node)
<a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="returnvalue">GNode</span></a> * <a class="link" href="glib-N-ary-Trees.html#g-node-prepend" title="g_node_prepend ()">g_node_prepend</a> (<em class="parameter"><code><a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a> *parent</code></em>,
<em class="parameter"><code><a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a> *node</code></em>);
#define <a class="link" href="glib-N-ary-Trees.html#g-node-insert-data" title="g_node_insert_data()">g_node_insert_data</a> (parent,
position,
data)
#define <a class="link" href="glib-N-ary-Trees.html#g-node-insert-data-after" title="g_node_insert_data_after()">g_node_insert_data_after</a> (parent,
sibling,
data)
#define <a class="link" href="glib-N-ary-Trees.html#g-node-insert-data-before" title="g_node_insert_data_before()">g_node_insert_data_before</a> (parent,
sibling,
data)
#define <a class="link" href="glib-N-ary-Trees.html#g-node-append-data" title="g_node_append_data()">g_node_append_data</a> (parent,
data)
#define <a class="link" href="glib-N-ary-Trees.html#g-node-prepend-data" title="g_node_prepend_data()">g_node_prepend_data</a> (parent,
data)
<span class="returnvalue">void</span> <a class="link" href="glib-N-ary-Trees.html#g-node-reverse-children" title="g_node_reverse_children ()">g_node_reverse_children</a> (<em class="parameter"><code><a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a> *node</code></em>);
<span class="returnvalue">void</span> <a class="link" href="glib-N-ary-Trees.html#g-node-traverse" title="g_node_traverse ()">g_node_traverse</a> (<em class="parameter"><code><a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a> *root</code></em>,
<em class="parameter"><code><a class="link" href="glib-Balanced-Binary-Trees.html#GTraverseType" title="enum GTraverseType"><span class="type">GTraverseType</span></a> order</code></em>,
<em class="parameter"><code><a class="link" href="glib-N-ary-Trees.html#GTraverseFlags" title="enum GTraverseFlags"><span class="type">GTraverseFlags</span></a> flags</code></em>,
<em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gint" title="gint"><span class="type">gint</span></a> max_depth</code></em>,
<em class="parameter"><code><a class="link" href="glib-N-ary-Trees.html#GNodeTraverseFunc" title="GNodeTraverseFunc ()"><span class="type">GNodeTraverseFunc</span></a> func</code></em>,
<em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer"><span class="type">gpointer</span></a> data</code></em>);
enum <a class="link" href="glib-N-ary-Trees.html#GTraverseFlags" title="enum GTraverseFlags">GTraverseFlags</a>;
<a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean"><span class="returnvalue">gboolean</span></a> (<a class="link" href="glib-N-ary-Trees.html#GNodeTraverseFunc" title="GNodeTraverseFunc ()">*GNodeTraverseFunc</a>) (<em class="parameter"><code><a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a> *node</code></em>,
<em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer"><span class="type">gpointer</span></a> data</code></em>);
<span class="returnvalue">void</span> <a class="link" href="glib-N-ary-Trees.html#g-node-children-foreach" title="g_node_children_foreach ()">g_node_children_foreach</a> (<em class="parameter"><code><a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a> *node</code></em>,
<em class="parameter"><code><a class="link" href="glib-N-ary-Trees.html#GTraverseFlags" title="enum GTraverseFlags"><span class="type">GTraverseFlags</span></a> flags</code></em>,
<em class="parameter"><code><a class="link" href="glib-N-ary-Trees.html#GNodeForeachFunc" title="GNodeForeachFunc ()"><span class="type">GNodeForeachFunc</span></a> func</code></em>,
<em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer"><span class="type">gpointer</span></a> data</code></em>);
<span class="returnvalue">void</span> (<a class="link" href="glib-N-ary-Trees.html#GNodeForeachFunc" title="GNodeForeachFunc ()">*GNodeForeachFunc</a>) (<em class="parameter"><code><a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a> *node</code></em>,
<em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer"><span class="type">gpointer</span></a> data</code></em>);
<a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="returnvalue">GNode</span></a> * <a class="link" href="glib-N-ary-Trees.html#g-node-get-root" title="g_node_get_root ()">g_node_get_root</a> (<em class="parameter"><code><a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a> *node</code></em>);
<a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="returnvalue">GNode</span></a> * <a class="link" href="glib-N-ary-Trees.html#g-node-find" title="g_node_find ()">g_node_find</a> (<em class="parameter"><code><a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a> *root</code></em>,
<em class="parameter"><code><a class="link" href="glib-Balanced-Binary-Trees.html#GTraverseType" title="enum GTraverseType"><span class="type">GTraverseType</span></a> order</code></em>,
<em class="parameter"><code><a class="link" href="glib-N-ary-Trees.html#GTraverseFlags" title="enum GTraverseFlags"><span class="type">GTraverseFlags</span></a> flags</code></em>,
<em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer"><span class="type">gpointer</span></a> data</code></em>);
<a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="returnvalue">GNode</span></a> * <a class="link" href="glib-N-ary-Trees.html#g-node-find-child" title="g_node_find_child ()">g_node_find_child</a> (<em class="parameter"><code><a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a> *node</code></em>,
<em class="parameter"><code><a class="link" href="glib-N-ary-Trees.html#GTraverseFlags" title="enum GTraverseFlags"><span class="type">GTraverseFlags</span></a> flags</code></em>,
<em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer"><span class="type">gpointer</span></a> data</code></em>);
<a class="link" href="glib-Basic-Types.html#gint" title="gint"><span class="returnvalue">gint</span></a> <a class="link" href="glib-N-ary-Trees.html#g-node-child-index" title="g_node_child_index ()">g_node_child_index</a> (<em class="parameter"><code><a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a> *node</code></em>,
<em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer"><span class="type">gpointer</span></a> data</code></em>);
<a class="link" href="glib-Basic-Types.html#gint" title="gint"><span class="returnvalue">gint</span></a> <a class="link" href="glib-N-ary-Trees.html#g-node-child-position" title="g_node_child_position ()">g_node_child_position</a> (<em class="parameter"><code><a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a> *node</code></em>,
<em class="parameter"><code><a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a> *child</code></em>);
#define <a class="link" href="glib-N-ary-Trees.html#g-node-first-child" title="g_node_first_child()">g_node_first_child</a> (node)
<a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="returnvalue">GNode</span></a> * <a class="link" href="glib-N-ary-Trees.html#g-node-last-child" title="g_node_last_child ()">g_node_last_child</a> (<em class="parameter"><code><a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a> *node</code></em>);
<a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="returnvalue">GNode</span></a> * <a class="link" href="glib-N-ary-Trees.html#g-node-nth-child" title="g_node_nth_child ()">g_node_nth_child</a> (<em class="parameter"><code><a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a> *node</code></em>,
<em class="parameter"><code><a class="link" href="glib-Basic-Types.html#guint" title="guint"><span class="type">guint</span></a> n</code></em>);
<a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="returnvalue">GNode</span></a> * <a class="link" href="glib-N-ary-Trees.html#g-node-first-sibling" title="g_node_first_sibling ()">g_node_first_sibling</a> (<em class="parameter"><code><a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a> *node</code></em>);
#define <a class="link" href="glib-N-ary-Trees.html#g-node-next-sibling" title="g_node_next_sibling()">g_node_next_sibling</a> (node)
#define <a class="link" href="glib-N-ary-Trees.html#g-node-prev-sibling" title="g_node_prev_sibling()">g_node_prev_sibling</a> (node)
<a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="returnvalue">GNode</span></a> * <a class="link" href="glib-N-ary-Trees.html#g-node-last-sibling" title="g_node_last_sibling ()">g_node_last_sibling</a> (<em class="parameter"><code><a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a> *node</code></em>);
#define <a class="link" href="glib-N-ary-Trees.html#G-NODE-IS-LEAF:CAPS" title="G_NODE_IS_LEAF()">G_NODE_IS_LEAF</a> (node)
#define <a class="link" href="glib-N-ary-Trees.html#G-NODE-IS-ROOT:CAPS" title="G_NODE_IS_ROOT()">G_NODE_IS_ROOT</a> (node)
<a class="link" href="glib-Basic-Types.html#guint" title="guint"><span class="returnvalue">guint</span></a> <a class="link" href="glib-N-ary-Trees.html#g-node-depth" title="g_node_depth ()">g_node_depth</a> (<em class="parameter"><code><a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a> *node</code></em>);
<a class="link" href="glib-Basic-Types.html#guint" title="guint"><span class="returnvalue">guint</span></a> <a class="link" href="glib-N-ary-Trees.html#g-node-n-nodes" title="g_node_n_nodes ()">g_node_n_nodes</a> (<em class="parameter"><code><a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a> *root</code></em>,
<em class="parameter"><code><a class="link" href="glib-N-ary-Trees.html#GTraverseFlags" title="enum GTraverseFlags"><span class="type">GTraverseFlags</span></a> flags</code></em>);
<a class="link" href="glib-Basic-Types.html#guint" title="guint"><span class="returnvalue">guint</span></a> <a class="link" href="glib-N-ary-Trees.html#g-node-n-children" title="g_node_n_children ()">g_node_n_children</a> (<em class="parameter"><code><a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a> *node</code></em>);
<a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean"><span class="returnvalue">gboolean</span></a> <a class="link" href="glib-N-ary-Trees.html#g-node-is-ancestor" title="g_node_is_ancestor ()">g_node_is_ancestor</a> (<em class="parameter"><code><a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a> *node</code></em>,
<em class="parameter"><code><a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a> *descendant</code></em>);
<a class="link" href="glib-Basic-Types.html#guint" title="guint"><span class="returnvalue">guint</span></a> <a class="link" href="glib-N-ary-Trees.html#g-node-max-height" title="g_node_max_height ()">g_node_max_height</a> (<em class="parameter"><code><a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a> *root</code></em>);
<span class="returnvalue">void</span> <a class="link" href="glib-N-ary-Trees.html#g-node-unlink" title="g_node_unlink ()">g_node_unlink</a> (<em class="parameter"><code><a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a> *node</code></em>);
<span class="returnvalue">void</span> <a class="link" href="glib-N-ary-Trees.html#g-node-destroy" title="g_node_destroy ()">g_node_destroy</a> (<em class="parameter"><code><a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a> *root</code></em>);
</pre>
</div>
<div class="refsect1">
<a name="glib-N-ary-Trees.description"></a><h2>Description</h2>
<p>
The <a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a> struct and its associated functions provide a N-ary tree
data structure, where nodes in the tree can contain arbitrary data.
</p>
<p>
To create a new tree use <a class="link" href="glib-N-ary-Trees.html#g-node-new" title="g_node_new ()"><code class="function">g_node_new()</code></a>.
</p>
<p>
To insert a node into a tree use <a class="link" href="glib-N-ary-Trees.html#g-node-insert" title="g_node_insert ()"><code class="function">g_node_insert()</code></a>,
<a class="link" href="glib-N-ary-Trees.html#g-node-insert-before" title="g_node_insert_before ()"><code class="function">g_node_insert_before()</code></a>, <a class="link" href="glib-N-ary-Trees.html#g-node-append" title="g_node_append()"><code class="function">g_node_append()</code></a> and <a class="link" href="glib-N-ary-Trees.html#g-node-prepend" title="g_node_prepend ()"><code class="function">g_node_prepend()</code></a>.
</p>
<p>
To create a new node and insert it into a tree use
<a class="link" href="glib-N-ary-Trees.html#g-node-insert-data" title="g_node_insert_data()"><code class="function">g_node_insert_data()</code></a>, <a class="link" href="glib-N-ary-Trees.html#g-node-insert-data-after" title="g_node_insert_data_after()"><code class="function">g_node_insert_data_after()</code></a>,
<a class="link" href="glib-N-ary-Trees.html#g-node-insert-data-before" title="g_node_insert_data_before()"><code class="function">g_node_insert_data_before()</code></a>, <a class="link" href="glib-N-ary-Trees.html#g-node-append-data" title="g_node_append_data()"><code class="function">g_node_append_data()</code></a>
and <a class="link" href="glib-N-ary-Trees.html#g-node-prepend-data" title="g_node_prepend_data()"><code class="function">g_node_prepend_data()</code></a>.
</p>
<p>
To reverse the children of a node use <a class="link" href="glib-N-ary-Trees.html#g-node-reverse-children" title="g_node_reverse_children ()"><code class="function">g_node_reverse_children()</code></a>.
</p>
<p>
To find a node use <a class="link" href="glib-N-ary-Trees.html#g-node-get-root" title="g_node_get_root ()"><code class="function">g_node_get_root()</code></a>, <a class="link" href="glib-N-ary-Trees.html#g-node-find" title="g_node_find ()"><code class="function">g_node_find()</code></a>,
<a class="link" href="glib-N-ary-Trees.html#g-node-find-child" title="g_node_find_child ()"><code class="function">g_node_find_child()</code></a>, <a class="link" href="glib-N-ary-Trees.html#g-node-child-index" title="g_node_child_index ()"><code class="function">g_node_child_index()</code></a>, <a class="link" href="glib-N-ary-Trees.html#g-node-child-position" title="g_node_child_position ()"><code class="function">g_node_child_position()</code></a>,
<a class="link" href="glib-N-ary-Trees.html#g-node-first-child" title="g_node_first_child()"><code class="function">g_node_first_child()</code></a>, <a class="link" href="glib-N-ary-Trees.html#g-node-last-child" title="g_node_last_child ()"><code class="function">g_node_last_child()</code></a>, <a class="link" href="glib-N-ary-Trees.html#g-node-nth-child" title="g_node_nth_child ()"><code class="function">g_node_nth_child()</code></a>,
<a class="link" href="glib-N-ary-Trees.html#g-node-first-sibling" title="g_node_first_sibling ()"><code class="function">g_node_first_sibling()</code></a>, <a class="link" href="glib-N-ary-Trees.html#g-node-prev-sibling" title="g_node_prev_sibling()"><code class="function">g_node_prev_sibling()</code></a>, <a class="link" href="glib-N-ary-Trees.html#g-node-next-sibling" title="g_node_next_sibling()"><code class="function">g_node_next_sibling()</code></a>
or <a class="link" href="glib-N-ary-Trees.html#g-node-last-sibling" title="g_node_last_sibling ()"><code class="function">g_node_last_sibling()</code></a>.
</p>
<p>
To get information about a node or tree use <a class="link" href="glib-N-ary-Trees.html#G-NODE-IS-LEAF:CAPS" title="G_NODE_IS_LEAF()"><code class="function">G_NODE_IS_LEAF()</code></a>,
<a class="link" href="glib-N-ary-Trees.html#G-NODE-IS-ROOT:CAPS" title="G_NODE_IS_ROOT()"><code class="function">G_NODE_IS_ROOT()</code></a>, <a class="link" href="glib-N-ary-Trees.html#g-node-depth" title="g_node_depth ()"><code class="function">g_node_depth()</code></a>, <a class="link" href="glib-N-ary-Trees.html#g-node-n-nodes" title="g_node_n_nodes ()"><code class="function">g_node_n_nodes()</code></a>,
<a class="link" href="glib-N-ary-Trees.html#g-node-n-children" title="g_node_n_children ()"><code class="function">g_node_n_children()</code></a>, <a class="link" href="glib-N-ary-Trees.html#g-node-is-ancestor" title="g_node_is_ancestor ()"><code class="function">g_node_is_ancestor()</code></a> or <a class="link" href="glib-N-ary-Trees.html#g-node-max-height" title="g_node_max_height ()"><code class="function">g_node_max_height()</code></a>.
</p>
<p>
To traverse a tree, calling a function for each node visited in the
traversal, use <a class="link" href="glib-N-ary-Trees.html#g-node-traverse" title="g_node_traverse ()"><code class="function">g_node_traverse()</code></a> or <a class="link" href="glib-N-ary-Trees.html#g-node-children-foreach" title="g_node_children_foreach ()"><code class="function">g_node_children_foreach()</code></a>.
</p>
<p>
To remove a node or subtree from a tree use <a class="link" href="glib-N-ary-Trees.html#g-node-unlink" title="g_node_unlink ()"><code class="function">g_node_unlink()</code></a> or
<a class="link" href="glib-N-ary-Trees.html#g-node-destroy" title="g_node_destroy ()"><code class="function">g_node_destroy()</code></a>.
</p>
</div>
<div class="refsect1">
<a name="glib-N-ary-Trees.details"></a><h2>Details</h2>
<div class="refsect2">
<a name="GNode"></a><h3>struct GNode</h3>
<pre class="programlisting">struct GNode {
gpointer data;
GNode *next;
GNode *prev;
GNode *parent;
GNode *children;
};
</pre>
<p>
The <a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a> struct represents one node in a
<a class="link" href="glib-N-ary-Trees.html" title="N-ary Trees">N-ary Tree</a>. fields
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer"><span class="type">gpointer</span></a> <em class="structfield"><code><a name="GNode.data"></a>data</code></em>;</span></p></td>
<td>contains the actual data of the node.</td>
</tr>
<tr>
<td><p><span class="term"><a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a> *<em class="structfield"><code><a name="GNode.next"></a>next</code></em>;</span></p></td>
<td>points to the node's next sibling (a sibling is another
<a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a> with the same parent).</td>
</tr>
<tr>
<td><p><span class="term"><a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a> *<em class="structfield"><code><a name="GNode.prev"></a>prev</code></em>;</span></p></td>
<td>points to the node's previous sibling.</td>
</tr>
<tr>
<td><p><span class="term"><a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a> *<em class="structfield"><code><a name="GNode.parent"></a>parent</code></em>;</span></p></td>
<td>points to the parent of the <a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a>, or is <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a> if the
<a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a> is the root of the tree.</td>
</tr>
<tr>
<td><p><span class="term"><a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a> *<em class="structfield"><code><a name="GNode.children"></a>children</code></em>;</span></p></td>
<td>points to the first child of the <a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a>. The other
children are accessed by using the <em class="parameter"><code>next</code></em> pointer of each
child.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="g-node-new"></a><h3>g_node_new ()</h3>
<pre class="programlisting"><a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="returnvalue">GNode</span></a> * g_node_new (<em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer"><span class="type">gpointer</span></a> data</code></em>);</pre>
<p>
Creates a new <a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a> containing the given data.
Used to create the first node in a tree.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
<td>the data of the new node</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>a new <a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="g-node-copy"></a><h3>g_node_copy ()</h3>
<pre class="programlisting"><a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="returnvalue">GNode</span></a> * g_node_copy (<em class="parameter"><code><a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a> *node</code></em>);</pre>
<p>
Recursively copies a <a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a> (but does not deep-copy the data inside the
nodes, see <a class="link" href="glib-N-ary-Trees.html#g-node-copy-deep" title="g_node_copy_deep ()"><code class="function">g_node_copy_deep()</code></a> if you need that).
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>node</code></em> :</span></p></td>
<td>a <a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>a new <a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a> containing the same data pointers</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="GCopyFunc"></a><h3>GCopyFunc ()</h3>
<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer"><span class="returnvalue">gpointer</span></a> (*GCopyFunc) (<em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gconstpointer" title="gconstpointer"><span class="type">gconstpointer</span></a> src</code></em>,
<em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer"><span class="type">gpointer</span></a> data</code></em>);</pre>
<p>
A function of this signature is used to copy the node data
when doing a deep-copy of a tree.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>src</code></em> :</span></p></td>
<td>A pointer to the data which should be copied</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
<td>Additional data</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>A pointer to the copy</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.4</p>
</div>
<hr>
<div class="refsect2">
<a name="g-node-copy-deep"></a><h3>g_node_copy_deep ()</h3>
<pre class="programlisting"><a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="returnvalue">GNode</span></a> * g_node_copy_deep (<em class="parameter"><code><a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a> *node</code></em>,
<em class="parameter"><code><a class="link" href="glib-N-ary-Trees.html#GCopyFunc" title="GCopyFunc ()"><span class="type">GCopyFunc</span></a> copy_func</code></em>,
<em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer"><span class="type">gpointer</span></a> data</code></em>);</pre>
<p>
Recursively copies a <a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a> and its data.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>node</code></em> :</span></p></td>
<td>a <a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>copy_func</code></em> :</span></p></td>
<td>the function which is called to copy the data inside each node,
or <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a> to use the original data.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
<td>data to pass to <em class="parameter"><code>copy_func</code></em>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>a new <a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a> containing copies of the data in <em class="parameter"><code>node</code></em>.</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.4</p>
</div>
<hr>
<div class="refsect2">
<a name="g-node-insert"></a><h3>g_node_insert ()</h3>
<pre class="programlisting"><a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="returnvalue">GNode</span></a> * g_node_insert (<em class="parameter"><code><a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a> *parent</code></em>,
<em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gint" title="gint"><span class="type">gint</span></a> position</code></em>,
<em class="parameter"><code><a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a> *node</code></em>);</pre>
<p>
Inserts a <a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a> beneath the parent at the given position.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>parent</code></em> :</span></p></td>
<td>the <a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a> to place <em class="parameter"><code>node</code></em> under</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>position</code></em> :</span></p></td>
<td>the position to place <em class="parameter"><code>node</code></em> at, with respect to its siblings
If position is -1, <em class="parameter"><code>node</code></em> is inserted as the last child of <em class="parameter"><code>parent</code></em>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>node</code></em> :</span></p></td>
<td>the <a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a> to insert</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>the inserted <a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="g-node-insert-before"></a><h3>g_node_insert_before ()</h3>
<pre class="programlisting"><a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="returnvalue">GNode</span></a> * g_node_insert_before (<em class="parameter"><code><a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a> *parent</code></em>,
<em class="parameter"><code><a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a> *sibling</code></em>,
<em class="parameter"><code><a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a> *node</code></em>);</pre>
<p>
Inserts a <a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a> beneath the parent before the given sibling.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>parent</code></em> :</span></p></td>
<td>the <a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a> to place <em class="parameter"><code>node</code></em> under</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>sibling</code></em> :</span></p></td>
<td>the sibling <a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a> to place <em class="parameter"><code>node</code></em> before.
If sibling is <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a>, the node is inserted as the last child of <em class="parameter"><code>parent</code></em>.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>node</code></em> :</span></p></td>
<td>the <a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a> to insert</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>the inserted <a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="g-node-insert-after"></a><h3>g_node_insert_after ()</h3>
<pre class="programlisting"><a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="returnvalue">GNode</span></a> * g_node_insert_after (<em class="parameter"><code><a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a> *parent</code></em>,
<em class="parameter"><code><a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a> *sibling</code></em>,
<em class="parameter"><code><a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a> *node</code></em>);</pre>
<p>
Inserts a <a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a> beneath the parent after the given sibling.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>parent</code></em> :</span></p></td>
<td>the <a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a> to place <em class="parameter"><code>node</code></em> under</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>sibling</code></em> :</span></p></td>
<td>the sibling <a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a> to place <em class="parameter"><code>node</code></em> after.
If sibling is <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a>, the node is inserted as the first child of <em class="parameter"><code>parent</code></em>.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>node</code></em> :</span></p></td>
<td>the <a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a> to insert</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>the inserted <a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="g-node-append"></a><h3>g_node_append()</h3>
<pre class="programlisting">#define g_node_append(parent, node)</pre>
<p>
Inserts a <a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a> as the last child of the given parent.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>parent</code></em> :</span></p></td>
<td>the <a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a> to place the new <a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a> under</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>node</code></em> :</span></p></td>
<td>the <a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a> to insert</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>the inserted <a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="g-node-prepend"></a><h3>g_node_prepend ()</h3>
<pre class="programlisting"><a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="returnvalue">GNode</span></a> * g_node_prepend (<em class="parameter"><code><a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a> *parent</code></em>,
<em class="parameter"><code><a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a> *node</code></em>);</pre>
<p>
Inserts a <a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a> as the first child of the given parent.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>parent</code></em> :</span></p></td>
<td>the <a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a> to place the new <a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a> under</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>node</code></em> :</span></p></td>
<td>the <a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a> to insert</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>the inserted <a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="g-node-insert-data"></a><h3>g_node_insert_data()</h3>
<pre class="programlisting">#define g_node_insert_data(parent, position, data)</pre>
<p>
Inserts a new <a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a> at the given position.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>parent</code></em> :</span></p></td>
<td>the <a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a> to place the new <a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a> under</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>position</code></em> :</span></p></td>
<td>the position to place the new <a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a> at. If position is -1,
the new <a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a> is inserted as the last child of <em class="parameter"><code>parent</code></em>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
<td>the data for the new <a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>the new <a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="g-node-insert-data-after"></a><h3>g_node_insert_data_after()</h3>
<pre class="programlisting">#define g_node_insert_data_after(parent, sibling, data)</pre>
<p>
Inserts a new <a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a> after the given sibling.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>parent</code></em> :</span></p></td>
<td>the <a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a> to place the new <a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a> under</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>sibling</code></em> :</span></p></td>
<td>the sibling <a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a> to place the new <a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a> after</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
<td>the data for the new <a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>the new <a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="g-node-insert-data-before"></a><h3>g_node_insert_data_before()</h3>
<pre class="programlisting">#define g_node_insert_data_before(parent, sibling, data)</pre>
<p>
Inserts a new <a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a> before the given sibling.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>parent</code></em> :</span></p></td>
<td>the <a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a> to place the new <a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a> under</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>sibling</code></em> :</span></p></td>
<td>the sibling <a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a> to place the new <a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a> before</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
<td>the data for the new <a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>the new <a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="g-node-append-data"></a><h3>g_node_append_data()</h3>
<pre class="programlisting">#define g_node_append_data(parent, data)</pre>
<p>
Inserts a new <a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a> as the last child of the given parent.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>parent</code></em> :</span></p></td>
<td>the <a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a> to place the new <a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a> under</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
<td>the data for the new <a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>the new <a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="g-node-prepend-data"></a><h3>g_node_prepend_data()</h3>
<pre class="programlisting">#define g_node_prepend_data(parent, data)</pre>
<p>
Inserts a new <a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a> as the first child of the given parent.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>parent</code></em> :</span></p></td>
<td>the <a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a> to place the new <a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a> under</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
<td>the data for the new <a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>the new <a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="g-node-reverse-children"></a><h3>g_node_reverse_children ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span> g_node_reverse_children (<em class="parameter"><code><a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a> *node</code></em>);</pre>
<p>
Reverses the order of the children of a <a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a>.
(It doesn't change the order of the grandchildren.)
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>node</code></em> :</span></p></td>
<td>a <a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a>.</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="g-node-traverse"></a><h3>g_node_traverse ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span> g_node_traverse (<em class="parameter"><code><a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a> *root</code></em>,
<em class="parameter"><code><a class="link" href="glib-Balanced-Binary-Trees.html#GTraverseType" title="enum GTraverseType"><span class="type">GTraverseType</span></a> order</code></em>,
<em class="parameter"><code><a class="link" href="glib-N-ary-Trees.html#GTraverseFlags" title="enum GTraverseFlags"><span class="type">GTraverseFlags</span></a> flags</code></em>,
<em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gint" title="gint"><span class="type">gint</span></a> max_depth</code></em>,
<em class="parameter"><code><a class="link" href="glib-N-ary-Trees.html#GNodeTraverseFunc" title="GNodeTraverseFunc ()"><span class="type">GNodeTraverseFunc</span></a> func</code></em>,
<em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer"><span class="type">gpointer</span></a> data</code></em>);</pre>
<p>
Traverses a tree starting at the given root <a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a>.
It calls the given function for each node visited.
The traversal can be halted at any point by returning <a class="link" href="glib-Standard-Macros.html#TRUE:CAPS" title="TRUE"><code class="literal">TRUE</code></a> from <em class="parameter"><code>func</code></em>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>root</code></em> :</span></p></td>
<td>the root <a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a> of the tree to traverse</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>order</code></em> :</span></p></td>
<td>the order in which nodes are visited - <a class="link" href="glib-Balanced-Binary-Trees.html#G-IN-ORDER:CAPS"><code class="literal">G_IN_ORDER</code></a>,
<a class="link" href="glib-Balanced-Binary-Trees.html#G-PRE-ORDER:CAPS"><code class="literal">G_PRE_ORDER</code></a>, <a class="link" href="glib-Balanced-Binary-Trees.html#G-POST-ORDER:CAPS"><code class="literal">G_POST_ORDER</code></a>, or <a class="link" href="glib-Balanced-Binary-Trees.html#G-LEVEL-ORDER:CAPS"><code class="literal">G_LEVEL_ORDER</code></a>.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>flags</code></em> :</span></p></td>
<td>which types of children are to be visited, one of
<a class="link" href="glib-N-ary-Trees.html#G-TRAVERSE-ALL:CAPS"><code class="literal">G_TRAVERSE_ALL</code></a>, <a class="link" href="glib-N-ary-Trees.html#G-TRAVERSE-LEAVES:CAPS"><code class="literal">G_TRAVERSE_LEAVES</code></a> and <a class="link" href="glib-N-ary-Trees.html#G-TRAVERSE-NON-LEAVES:CAPS"><code class="literal">G_TRAVERSE_NON_LEAVES</code></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>max_depth</code></em> :</span></p></td>
<td>the maximum depth of the traversal. Nodes below this
depth will not be visited. If max_depth is -1 all nodes in
the tree are visited. If depth is 1, only the root is visited.
If depth is 2, the root and its children are visited. And so on.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>func</code></em> :</span></p></td>
<td>the function to call for each visited <a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
<td>user data to pass to the function</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="GTraverseFlags"></a><h3>enum GTraverseFlags</h3>
<pre class="programlisting">typedef enum {
G_TRAVERSE_LEAVES = 1 << 0,
G_TRAVERSE_NON_LEAVES = 1 << 1,
G_TRAVERSE_ALL = G_TRAVERSE_LEAVES | G_TRAVERSE_NON_LEAVES,
G_TRAVERSE_MASK = 0x03,
G_TRAVERSE_LEAFS = G_TRAVERSE_LEAVES,
G_TRAVERSE_NON_LEAFS = G_TRAVERSE_NON_LEAVES
} GTraverseFlags;
</pre>
<p>
Specifies which nodes are visited during several of the tree
functions, including <a class="link" href="glib-N-ary-Trees.html#g-node-traverse" title="g_node_traverse ()"><code class="function">g_node_traverse()</code></a> and <a class="link" href="glib-N-ary-Trees.html#g-node-find" title="g_node_find ()"><code class="function">g_node_find()</code></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><a name="G-TRAVERSE-LEAVES:CAPS"></a><span class="term"><code class="literal">G_TRAVERSE_LEAVES</code></span></p></td>
<td>only leaf nodes should be visited. This name has
been introduced in 2.6, for older version use
<a class="link" href="glib-N-ary-Trees.html#G-TRAVERSE-LEAFS:CAPS"><code class="literal">G_TRAVERSE_LEAFS</code></a>.
</td>
</tr>
<tr>
<td><p><a name="G-TRAVERSE-NON-LEAVES:CAPS"></a><span class="term"><code class="literal">G_TRAVERSE_NON_LEAVES</code></span></p></td>
<td>only non-leaf nodes should be visited. This
name has been introduced in 2.6, for older
version use <a class="link" href="glib-N-ary-Trees.html#G-TRAVERSE-NON-LEAFS:CAPS"><code class="literal">G_TRAVERSE_NON_LEAFS</code></a>.
</td>
</tr>
<tr>
<td><p><a name="G-TRAVERSE-ALL:CAPS"></a><span class="term"><code class="literal">G_TRAVERSE_ALL</code></span></p></td>
<td>all nodes should be visited.
</td>
</tr>
<tr>
<td><p><a name="G-TRAVERSE-MASK:CAPS"></a><span class="term"><code class="literal">G_TRAVERSE_MASK</code></span></p></td>
<td>a mask of all traverse flags.
</td>
</tr>
<tr>
<td><p><a name="G-TRAVERSE-LEAFS:CAPS"></a><span class="term"><code class="literal">G_TRAVERSE_LEAFS</code></span></p></td>
<td>identical to <a class="link" href="glib-N-ary-Trees.html#G-TRAVERSE-LEAVES:CAPS"><code class="literal">G_TRAVERSE_LEAVES</code></a>.
</td>
</tr>
<tr>
<td><p><a name="G-TRAVERSE-NON-LEAFS:CAPS"></a><span class="term"><code class="literal">G_TRAVERSE_NON_LEAFS</code></span></p></td>
<td>identical to <a class="link" href="glib-N-ary-Trees.html#G-TRAVERSE-NON-LEAVES:CAPS"><code class="literal">G_TRAVERSE_NON_LEAVES</code></a>.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="GNodeTraverseFunc"></a><h3>GNodeTraverseFunc ()</h3>
<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean"><span class="returnvalue">gboolean</span></a> (*GNodeTraverseFunc) (<em class="parameter"><code><a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a> *node</code></em>,
<em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer"><span class="type">gpointer</span></a> data</code></em>);</pre>
<p>
Specifies the type of function passed to <a class="link" href="glib-N-ary-Trees.html#g-node-traverse" title="g_node_traverse ()"><code class="function">g_node_traverse()</code></a>. The
function is called with each of the nodes visited, together with the
user data passed to <a class="link" href="glib-N-ary-Trees.html#g-node-traverse" title="g_node_traverse ()"><code class="function">g_node_traverse()</code></a>. If the function returns
<a class="link" href="glib-Standard-Macros.html#TRUE:CAPS" title="TRUE"><code class="literal">TRUE</code></a>, then the traversal is stopped.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>node</code></em> :</span></p></td>
<td>a <a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a>.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
<td>user data passed to <a class="link" href="glib-N-ary-Trees.html#g-node-traverse" title="g_node_traverse ()"><code class="function">g_node_traverse()</code></a>.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>
<a class="link" href="glib-Standard-Macros.html#TRUE:CAPS" title="TRUE"><code class="literal">TRUE</code></a> to stop the traversal.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="g-node-children-foreach"></a><h3>g_node_children_foreach ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span> g_node_children_foreach (<em class="parameter"><code><a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a> *node</code></em>,
<em class="parameter"><code><a class="link" href="glib-N-ary-Trees.html#GTraverseFlags" title="enum GTraverseFlags"><span class="type">GTraverseFlags</span></a> flags</code></em>,
<em class="parameter"><code><a class="link" href="glib-N-ary-Trees.html#GNodeForeachFunc" title="GNodeForeachFunc ()"><span class="type">GNodeForeachFunc</span></a> func</code></em>,
<em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer"><span class="type">gpointer</span></a> data</code></em>);</pre>
<p>
Calls a function for each of the children of a <a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a>.
Note that it doesn't descend beneath the child nodes.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>node</code></em> :</span></p></td>
<td>a <a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>flags</code></em> :</span></p></td>
<td>which types of children are to be visited, one of
<a class="link" href="glib-N-ary-Trees.html#G-TRAVERSE-ALL:CAPS"><code class="literal">G_TRAVERSE_ALL</code></a>, <a class="link" href="glib-N-ary-Trees.html#G-TRAVERSE-LEAVES:CAPS"><code class="literal">G_TRAVERSE_LEAVES</code></a> and <a class="link" href="glib-N-ary-Trees.html#G-TRAVERSE-NON-LEAVES:CAPS"><code class="literal">G_TRAVERSE_NON_LEAVES</code></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>func</code></em> :</span></p></td>
<td>the function to call for each visited node</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
<td>user data to pass to the function</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="GNodeForeachFunc"></a><h3>GNodeForeachFunc ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span> (*GNodeForeachFunc) (<em class="parameter"><code><a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a> *node</code></em>,
<em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer"><span class="type">gpointer</span></a> data</code></em>);</pre>
<p>
Specifies the type of function passed to <a class="link" href="glib-N-ary-Trees.html#g-node-children-foreach" title="g_node_children_foreach ()"><code class="function">g_node_children_foreach()</code></a>.
The function is called with each child node, together with the user
data passed to <a class="link" href="glib-N-ary-Trees.html#g-node-children-foreach" title="g_node_children_foreach ()"><code class="function">g_node_children_foreach()</code></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>node</code></em> :</span></p></td>
<td>a <a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a>.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
<td>user data passed to <a class="link" href="glib-N-ary-Trees.html#g-node-children-foreach" title="g_node_children_foreach ()"><code class="function">g_node_children_foreach()</code></a>.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="g-node-get-root"></a><h3>g_node_get_root ()</h3>
<pre class="programlisting"><a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="returnvalue">GNode</span></a> * g_node_get_root (<em class="parameter"><code><a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a> *node</code></em>);</pre>
<p>
Gets the root of a tree.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>node</code></em> :</span></p></td>
<td>a <a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>the root of the tree</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="g-node-find"></a><h3>g_node_find ()</h3>
<pre class="programlisting"><a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="returnvalue">GNode</span></a> * g_node_find (<em class="parameter"><code><a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a> *root</code></em>,
<em class="parameter"><code><a class="link" href="glib-Balanced-Binary-Trees.html#GTraverseType" title="enum GTraverseType"><span class="type">GTraverseType</span></a> order</code></em>,
<em class="parameter"><code><a class="link" href="glib-N-ary-Trees.html#GTraverseFlags" title="enum GTraverseFlags"><span class="type">GTraverseFlags</span></a> flags</code></em>,
<em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer"><span class="type">gpointer</span></a> data</code></em>);</pre>
<p>
Finds a <a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a> in a tree.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>root</code></em> :</span></p></td>
<td>the root <a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a> of the tree to search</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>order</code></em> :</span></p></td>
<td>the order in which nodes are visited - <a class="link" href="glib-Balanced-Binary-Trees.html#G-IN-ORDER:CAPS"><code class="literal">G_IN_ORDER</code></a>,
<a class="link" href="glib-Balanced-Binary-Trees.html#G-PRE-ORDER:CAPS"><code class="literal">G_PRE_ORDER</code></a>, <a class="link" href="glib-Balanced-Binary-Trees.html#G-POST-ORDER:CAPS"><code class="literal">G_POST_ORDER</code></a>, or <a class="link" href="glib-Balanced-Binary-Trees.html#G-LEVEL-ORDER:CAPS"><code class="literal">G_LEVEL_ORDER</code></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>flags</code></em> :</span></p></td>
<td>which types of children are to be searched, one of
<a class="link" href="glib-N-ary-Trees.html#G-TRAVERSE-ALL:CAPS"><code class="literal">G_TRAVERSE_ALL</code></a>, <a class="link" href="glib-N-ary-Trees.html#G-TRAVERSE-LEAVES:CAPS"><code class="literal">G_TRAVERSE_LEAVES</code></a> and <a class="link" href="glib-N-ary-Trees.html#G-TRAVERSE-NON-LEAVES:CAPS"><code class="literal">G_TRAVERSE_NON_LEAVES</code></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
<td>the data to find</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>the found <a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a>, or <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a> if the data is not found</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="g-node-find-child"></a><h3>g_node_find_child ()</h3>
<pre class="programlisting"><a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="returnvalue">GNode</span></a> * g_node_find_child (<em class="parameter"><code><a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a> *node</code></em>,
<em class="parameter"><code><a class="link" href="glib-N-ary-Trees.html#GTraverseFlags" title="enum GTraverseFlags"><span class="type">GTraverseFlags</span></a> flags</code></em>,
<em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer"><span class="type">gpointer</span></a> data</code></em>);</pre>
<p>
Finds the first child of a <a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a> with the given data.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>node</code></em> :</span></p></td>
<td>a <a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>flags</code></em> :</span></p></td>
<td>which types of children are to be searched, one of
<a class="link" href="glib-N-ary-Trees.html#G-TRAVERSE-ALL:CAPS"><code class="literal">G_TRAVERSE_ALL</code></a>, <a class="link" href="glib-N-ary-Trees.html#G-TRAVERSE-LEAVES:CAPS"><code class="literal">G_TRAVERSE_LEAVES</code></a> and <a class="link" href="glib-N-ary-Trees.html#G-TRAVERSE-NON-LEAVES:CAPS"><code class="literal">G_TRAVERSE_NON_LEAVES</code></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
<td>the data to find</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>the found child <a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a>, or <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a> if the data is not found</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="g-node-child-index"></a><h3>g_node_child_index ()</h3>
<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gint" title="gint"><span class="returnvalue">gint</span></a> g_node_child_index (<em class="parameter"><code><a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a> *node</code></em>,
<em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer"><span class="type">gpointer</span></a> data</code></em>);</pre>
<p>
Gets the position of the first child of a <a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a>
which contains the given data.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>node</code></em> :</span></p></td>
<td>a <a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
<td>the data to find</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>the index of the child of <em class="parameter"><code>node</code></em> which contains
<em class="parameter"><code>data</code></em>, or -1 if the data is not found</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="g-node-child-position"></a><h3>g_node_child_position ()</h3>
<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gint" title="gint"><span class="returnvalue">gint</span></a> g_node_child_position (<em class="parameter"><code><a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a> *node</code></em>,
<em class="parameter"><code><a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a> *child</code></em>);</pre>
<p>
Gets the position of a <a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a> with respect to its siblings.
<em class="parameter"><code>child</code></em> must be a child of <em class="parameter"><code>node</code></em>. The first child is numbered 0,
the second 1, and so on.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>node</code></em> :</span></p></td>
<td>a <a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>child</code></em> :</span></p></td>
<td>a child of <em class="parameter"><code>node</code></em>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>the position of <em class="parameter"><code>child</code></em> with respect to its siblings</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="g-node-first-child"></a><h3>g_node_first_child()</h3>
<pre class="programlisting">#define g_node_first_child(node)</pre>
<p>
Gets the first child of a <a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>node</code></em> :</span></p></td>
<td>a <a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>the first child of <em class="parameter"><code>node</code></em>, or <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a> if <em class="parameter"><code>node</code></em> is <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a>
or has no children</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="g-node-last-child"></a><h3>g_node_last_child ()</h3>
<pre class="programlisting"><a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="returnvalue">GNode</span></a> * g_node_last_child (<em class="parameter"><code><a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a> *node</code></em>);</pre>
<p>
Gets the last child of a <a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>node</code></em> :</span></p></td>
<td>a <a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a> (must not be <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a>)</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>the last child of <em class="parameter"><code>node</code></em>, or <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a> if <em class="parameter"><code>node</code></em> has no children</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="g-node-nth-child"></a><h3>g_node_nth_child ()</h3>
<pre class="programlisting"><a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="returnvalue">GNode</span></a> * g_node_nth_child (<em class="parameter"><code><a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a> *node</code></em>,
<em class="parameter"><code><a class="link" href="glib-Basic-Types.html#guint" title="guint"><span class="type">guint</span></a> n</code></em>);</pre>
<p>
Gets a child of a <a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a>, using the given index.
The first child is at index 0. If the index is
too big, <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a> is returned.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>node</code></em> :</span></p></td>
<td>a <a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>n</code></em> :</span></p></td>
<td>the index of the desired child</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>the child of <em class="parameter"><code>node</code></em> at index <em class="parameter"><code>n</code></em>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="g-node-first-sibling"></a><h3>g_node_first_sibling ()</h3>
<pre class="programlisting"><a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="returnvalue">GNode</span></a> * g_node_first_sibling (<em class="parameter"><code><a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a> *node</code></em>);</pre>
<p>
Gets the first sibling of a <a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a>.
This could possibly be the node itself.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>node</code></em> :</span></p></td>
<td>a <a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>the first sibling of <em class="parameter"><code>node</code></em>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="g-node-next-sibling"></a><h3>g_node_next_sibling()</h3>
<pre class="programlisting">#define g_node_next_sibling(node)</pre>
<p>
Gets the next sibling of a <a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>node</code></em> :</span></p></td>
<td>a <a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>the next sibling of <em class="parameter"><code>node</code></em>, or <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a> if <em class="parameter"><code>node</code></em> is the last node
or <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="g-node-prev-sibling"></a><h3>g_node_prev_sibling()</h3>
<pre class="programlisting">#define g_node_prev_sibling(node)</pre>
<p>
Gets the previous sibling of a <a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>node</code></em> :</span></p></td>
<td>a <a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>the previous sibling of <em class="parameter"><code>node</code></em>, or <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a> if <em class="parameter"><code>node</code></em> is the first
node or <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="g-node-last-sibling"></a><h3>g_node_last_sibling ()</h3>
<pre class="programlisting"><a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="returnvalue">GNode</span></a> * g_node_last_sibling (<em class="parameter"><code><a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a> *node</code></em>);</pre>
<p>
Gets the last sibling of a <a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a>.
This could possibly be the node itself.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>node</code></em> :</span></p></td>
<td>a <a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>the last sibling of <em class="parameter"><code>node</code></em>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="G-NODE-IS-LEAF:CAPS"></a><h3>G_NODE_IS_LEAF()</h3>
<pre class="programlisting">#define G_NODE_IS_LEAF(node) (((GNode*) (node))->children == NULL)
</pre>
<p>
Returns <a class="link" href="glib-Standard-Macros.html#TRUE:CAPS" title="TRUE"><code class="literal">TRUE</code></a> if a <a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a> is a leaf node.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>node</code></em> :</span></p></td>
<td>a <a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>
<a class="link" href="glib-Standard-Macros.html#TRUE:CAPS" title="TRUE"><code class="literal">TRUE</code></a> if the <a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a> is a leaf node
(i.e. it has no children)</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="G-NODE-IS-ROOT:CAPS"></a><h3>G_NODE_IS_ROOT()</h3>
<pre class="programlisting">#define G_NODE_IS_ROOT(node)</pre>
<p>
Returns <a class="link" href="glib-Standard-Macros.html#TRUE:CAPS" title="TRUE"><code class="literal">TRUE</code></a> if a <a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a> is the root of a tree.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>node</code></em> :</span></p></td>
<td>a <a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>
<a class="link" href="glib-Standard-Macros.html#TRUE:CAPS" title="TRUE"><code class="literal">TRUE</code></a> if the <a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a> is the root of a tree
(i.e. it has no parent or siblings)</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="g-node-depth"></a><h3>g_node_depth ()</h3>
<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#guint" title="guint"><span class="returnvalue">guint</span></a> g_node_depth (<em class="parameter"><code><a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a> *node</code></em>);</pre>
<p>
Gets the depth of a <a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a>.
</p>
<p>
If <em class="parameter"><code>node</code></em> is <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a> the depth is 0. The root node has a depth of 1.
For the children of the root node the depth is 2. And so on.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>node</code></em> :</span></p></td>
<td>a <a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>the depth of the <a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="g-node-n-nodes"></a><h3>g_node_n_nodes ()</h3>
<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#guint" title="guint"><span class="returnvalue">guint</span></a> g_node_n_nodes (<em class="parameter"><code><a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a> *root</code></em>,
<em class="parameter"><code><a class="link" href="glib-N-ary-Trees.html#GTraverseFlags" title="enum GTraverseFlags"><span class="type">GTraverseFlags</span></a> flags</code></em>);</pre>
<p>
Gets the number of nodes in a tree.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>root</code></em> :</span></p></td>
<td>a <a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>flags</code></em> :</span></p></td>
<td>which types of children are to be counted, one of
<a class="link" href="glib-N-ary-Trees.html#G-TRAVERSE-ALL:CAPS"><code class="literal">G_TRAVERSE_ALL</code></a>, <a class="link" href="glib-N-ary-Trees.html#G-TRAVERSE-LEAVES:CAPS"><code class="literal">G_TRAVERSE_LEAVES</code></a> and <a class="link" href="glib-N-ary-Trees.html#G-TRAVERSE-NON-LEAVES:CAPS"><code class="literal">G_TRAVERSE_NON_LEAVES</code></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>the number of nodes in the tree</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="g-node-n-children"></a><h3>g_node_n_children ()</h3>
<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#guint" title="guint"><span class="returnvalue">guint</span></a> g_node_n_children (<em class="parameter"><code><a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a> *node</code></em>);</pre>
<p>
Gets the number of children of a <a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>node</code></em> :</span></p></td>
<td>a <a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>the number of children of <em class="parameter"><code>node</code></em>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="g-node-is-ancestor"></a><h3>g_node_is_ancestor ()</h3>
<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean"><span class="returnvalue">gboolean</span></a> g_node_is_ancestor (<em class="parameter"><code><a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a> *node</code></em>,
<em class="parameter"><code><a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a> *descendant</code></em>);</pre>
<p>
Returns <a class="link" href="glib-Standard-Macros.html#TRUE:CAPS" title="TRUE"><code class="literal">TRUE</code></a> if <em class="parameter"><code>node</code></em> is an ancestor of <em class="parameter"><code>descendant</code></em>.
This is true if node is the parent of <em class="parameter"><code>descendant</code></em>,
or if node is the grandparent of <em class="parameter"><code>descendant</code></em> etc.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>node</code></em> :</span></p></td>
<td>a <a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>descendant</code></em> :</span></p></td>
<td>a <a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>
<a class="link" href="glib-Standard-Macros.html#TRUE:CAPS" title="TRUE"><code class="literal">TRUE</code></a> if <em class="parameter"><code>node</code></em> is an ancestor of <em class="parameter"><code>descendant</code></em>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="g-node-max-height"></a><h3>g_node_max_height ()</h3>
<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#guint" title="guint"><span class="returnvalue">guint</span></a> g_node_max_height (<em class="parameter"><code><a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a> *root</code></em>);</pre>
<p>
Gets the maximum height of all branches beneath a <a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a>.
This is the maximum distance from the <a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a> to all leaf nodes.
</p>
<p>
If <em class="parameter"><code>root</code></em> is <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a>, 0 is returned. If <em class="parameter"><code>root</code></em> has no children,
1 is returned. If <em class="parameter"><code>root</code></em> has children, 2 is returned. And so on.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>root</code></em> :</span></p></td>
<td>a <a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>the maximum height of the tree beneath <em class="parameter"><code>root</code></em>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="g-node-unlink"></a><h3>g_node_unlink ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span> g_node_unlink (<em class="parameter"><code><a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a> *node</code></em>);</pre>
<p>
Unlinks a <a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a> from a tree, resulting in two separate trees.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>node</code></em> :</span></p></td>
<td>the <a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a> to unlink, which becomes the root of a new tree</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="g-node-destroy"></a><h3>g_node_destroy ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span> g_node_destroy (<em class="parameter"><code><a class="link" href="glib-N-ary-Trees.html#GNode" title="struct GNode"><span class="type">GNode</span></a> *root</code></em>);</pre>
<p>
Removes <em class="parameter"><code>root</code></em> and its children from the tree, freeing any memory
allocated.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>root</code></em> :</span></p></td>
<td>the root of the tree/subtree to destroy</td>
</tr></tbody>
</table></div>
</div>
</div>
</div>
<div class="footer">
<hr>
Generated by GTK-Doc V1.18</div>
</body>
</html>
|