This file is indexed.

/usr/include/open-trace-format/OTF_WStream.h is in libopen-trace-format-dev 1.12.5+dfsg-1.

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
/*
 This is part of the OTF library. Copyright by ZIH, TU Dresden 2005-2014.
 Authors: Andreas Knuepfer, Holger Brunst, Ronny Brendel, Thomas Kriebitzsch
*/

/** 
 *  @file OTF_WStream.h
 *
 *  @brief Provides write access to trace streams, which consist of multiple
 *  buffers.
 *
 *  \ingroup wstream
 */

/** \defgroup wstream Stream Writer Interface
 *
 * This interface provides functions for writing trace at stream level.
 * A stream is part of a trace and consists of up to four buffers
 * (event buffer, definition buffer, snapshots buffer, statistics buffer).
 * 
 * wstream is structured similarly to writer.
 *
 * Use this interface, if you want to a specific stream and the writer
 * interface does not provide the desired access.
 *
 * \section wstream_example A short Example
 *
 *  \code
 *  #include <assert.h>
 *  #include "otf.h"
 *
 *  int main( int argc, char** argv ) {
 *  \endcode
 *
 *      Declare a file manager and a writer.
 *      \code
 * 	    OTF_FileManager* manager;
 * 	    OTF_WStream* wstream;
 * 	    \endcode
 *
 *     	Initialize the file manager. Open at most 100 OS files.
 *     	\code
 *     	manager= OTF_FileManager_open( 100 );
 * 	    assert( manager );
 * 	    \endcode
 *
 * 	    Initialize the wstream object. Open file "test", writing the first stream.
 * 	    \code
 * 	    wstream = OTF_WStream_open( "test", 0, manager );
 *      assert( wstream );
 *      \endcode
 *      
 *      Write some definition records.
 *      \code
 *      OTF_WStream_writeDefTimerResolution( wstream, 1000 );
 *      OTF_WStream_writeDefProcess( wstream, 1, "proc one", 0 );
 *      \endcode
 *
 *      Clean up before exiting the program.
 *      \code
 *      OTF_WStream_close( wstream );
 *      OTF_FileManager_close( manager );
 *
 *		return 0;
 * }
 * \endcode
 *
 * Compile this using $ gcc -o test test.c `otfconfig --libs`.
 *
 * When executing this program it only writes one file (test.0.def),
 * containg the written records.
 *
 */

#ifndef OTF_WSTREAM_H
#define OTF_WSTREAM_H


#include <stdlib.h>


#include "OTF_inttypes.h"


#include "OTF_Definitions.h"
#include "OTF_FileManager.h"
#include "OTF_WBuffer.h"
#include "OTF_Filenames.h"


#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */

struct struct_OTF_WStream {


	/**	name stub: all files will begin with this name */
	char* namestub;

	/**	Unique id for the current stream. */
	uint32_t id;

	/**	State wether to use long or short format,
		see OTF_WSTREAM_FORMAT_XXX macros above. */
	uint32_t format;


	/**	Definitions buffer. Definitions buffer carries definition
		records. */
	OTF_WBuffer* defBuffer;

	/**	Event buffer. The event buffer carries records for actual
		events, i.e. records with a time stamp */
	OTF_WBuffer* eventBuffer;

	/**	Snaps (snapshots) buffer. The snapshots buffer carries
		snapshots of the whole state at a point in time - as oppossed to
		events which only show changes in the state. This can be used to
		start from such a snapshot instead of from the very begining. */
	OTF_WBuffer* snapsBuffer;

	/**	Statistics buffer. Statistics buffer carries statistical
		information information about a certain time interval resp.
		data at points of time that allow to derive statistics without
		reading through all events of that interval. */
	OTF_WBuffer* statsBuffer;

	/**	Marker buffer. Marker buffer carries marker definitions and spots
		which live in a separate file and wich are not sorted according to time stamp
        in any way. */
	OTF_WBuffer* markerBuffer;

	/** Default compression method for all buffers managed by this stream */
	OTF_FileCompression compression;
	
	/** Default size of buffers managed by this WStream. */
	uint32_t buffersizes;

/*#ifdef HAVE_ZLIB*/
	/** Default size of zbuffers managed by this RStream. */
	uint32_t zbuffersizes;
/*#endif*/ /* HAVE_ZLIB */
	
	/** file handle manager */
	OTF_FileManager* manager;
};
/** wstream object \ingroup wstream */
typedef struct struct_OTF_WStream OTF_WStream;


/**     
 * Create a new OTF_WStream instance.
 *
 * @param namestub     File name prefix which is going to be used by 
 *                     all sub-files which belong to the writer stream.
 * @param id           Abitrary but unique identifier of the writer stream.
		       Must be > '0' for real streams. Use '0' for global definitions.
 * @param manager      File handle manager. 
 *
 * @return             Initialized OTF_WStream instance or 0 if an error
 *                     occurred.
 *
 * \ingroup wstream
 */
OTF_WStream* OTF_WStream_open( const char* namestub, uint32_t id, 
	OTF_FileManager* manager );


/** 
 * Close an OTF_WStream instance and all its related files.
 *
 * @param wstream  Pointer to an initialized OTF_WStream object. See 
 *                 also OTF_WStream_open().
 * 
 * @return         1 if instance was closed successfully and 0 otherwise.
 *
 * \ingroup wstream
 */
int OTF_WStream_close( OTF_WStream* wstream );

			
/** 
 * Flush an OTF_WStream instance, i.e. flush all associated buffers if existing.
 *
 * @param wstream  Pointer to an initialized OTF_WStream object. See 
 *                 also OTF_WStream_open().
 * 
 * @return         1 if everything flushed successfully and 0 otherwise.
 *
 * \ingroup wstream
 */
int OTF_WStream_flush( OTF_WStream* wstream );


/** 
 * Returns the definition buffer of the according writer stream.
 *
 * @param wstream  Pointer to an initialized OTF_WStream object. See 
 *                 also OTF_WStream_open().
 * 
 * @return         Initialized OTF_WBuffer instance or 0 if an error occured.
 *
 * \ingroup wstream
 */
OTF_WBuffer* OTF_WStream_getDefBuffer( OTF_WStream* wstream );


/** 
 * Returns the event buffer of the according writer stream.
 *
 * @param wstream  Pointer to an initialized OTF_WStream object. See 
 *                 also OTF_WStream_open().
 * 
 * @return         Initialized OTF_WBuffer instance or 0 if an error occured.
 *
 * \ingroup wstream
 */
OTF_WBuffer* OTF_WStream_getEventBuffer( OTF_WStream* wstream );


/** 
 * Returns the snapshots buffer of the according writer stream.
 *
 * @param wstream  Pointer to an initialized OTF_WStream object. See 
 *                 also OTF_WStream_open().
 * 
 * @return         Initialized OTF_WBuffer instance or 0 if an error occured.
 *
 * \ingroup wstream
 */
OTF_WBuffer* OTF_WStream_getSnapshotBuffer( OTF_WStream* wstream );


/** 
 * Returns the statistics buffer of the according writer stream.
 *
 * @param wstream  Pointer to an initialized OTF_WStream object. See 
 *                 also OTF_WStream_open().
 * 
 * @return         Initialized OTF_WBuffer instance or 0 if an error occured.
 *
 * \ingroup wstream
 */
OTF_WBuffer* OTF_WStream_getStatsBuffer( OTF_WStream* wstream );


/** 
 * Returns the marker buffer of the according writer stream.
 *
 * @param wstream  Pointer to an initialized OTF_WStream object. See 
 *                 also OTF_WStream_open().
 * 
 * @return         Initialized OTF_WBuffer instance or 0 if an error occured.
 *
 * \ingroup wstream
 */
OTF_WBuffer* OTF_WStream_getMarkerBuffer( OTF_WStream* wstream );


/**
 * Set the standard compression method for all buffers managed by this writer
 * stream
 *
 * @param wstream      Pointer to an initialized OTF_WStream object. See 
 *                     also OTF_WStream_open().
 *
 * @param compression  Default compression level.
 *                     0-9, where 0 means no compression is applied, and 9 is
 *                     the highest level of compression.
 *
 * @return             1 on success, 0 if an error occurs.
 *
 * \ingroup wstream
 */
int OTF_WStream_setCompression( OTF_WStream* wstream, OTF_FileCompression
	compression );
	
	
/**
 * Return the standard compression method for all buffers managed by this writer
 * stream
 *
 * @param wstream      Pointer to an initialized OTF_WStream object. See 
 *                     also OTF_WStream_open().
 *
 * @return             Standard compression level for all buffers managed by
 *                     this writer stream.
 *
 * \ingroup wstream
 */
OTF_FileCompression OTF_WStream_getCompression( OTF_WStream* wstream );


/**
 * Set the default buffer size for all buffers managed by this writer stream. 
 * This is only effective for future buffers and will not change already 
 * allocated buffers. Those can be changed with the buffers directly.
 *
 * @param wstream  Pointer to an initialized OTF_WStream object. See 
 *                 also OTF_WStream_open().
 * 
 * @param size     Intended buffer size.
 *
 * \ingroup wstream
 */
void OTF_WStream_setBufferSizes( OTF_WStream* wstream, uint32_t size );

/** 
 * Get the default buffer size for all buffers managed by this writer stream.
 *
 * @param wstream  Pointer to an initialized OTF_WStream object. See 
 *                 also OTF_WStream_open().
 * 
 * @return         Default buffer size for all buffers managed by this writer
 *                 stream.
 *
 * \ingroup wstream
 */
uint32_t OTF_WStream_getBufferSizes( OTF_WStream* wstream );

/** 
 * Set the default zbuffer size for all files managed by this writer stream.
 * This is only effective for future files and will not change already
 * allocated buffers. Those can be changed with the files directly.
 *
 * @param wstream  Pointer to an initialized OTF_WStream object. See 
 *                 also OTF_WStream_open().
 *
 * @param size     Intended buffer size.
 *
 * \ingroup wstream
 */
void OTF_WStream_setZBufferSizes( OTF_WStream* wstream, uint32_t size );


/** 
 * Get the default zbuffer size for all files managed by this writer stream.
 *
 * @param wstream  Pointer to an initialized OTF_WStream object. See 
 *                 also OTF_WStream_open().
 *
 * @return         Default buffer size for all buffers managed by this reader
 *                 stream.
 *
 * \ingroup wstream
 */
uint32_t OTF_WStream_getZBufferSizes( OTF_WStream* wstream );

/**
 * Set the default ouput format.
 *
 * @param wstream  Pointer to an initialized OTF_WStream object. See 
 *                 also OTF_WStream_open().
 *
 * @param format   Intended output format (OTF_WSTREAM_FORMAT_{LONG,SHORT})
 *
 * \ingroup wstream
 */
void OTF_WStream_setFormat( OTF_WStream* wstream, uint32_t format );

/**
 * Get the default output format
 *
 * @param wstream  Pointer to an initialized OTF_WStream object. See 
 *                 also OTF_WStream_open().
 *
 * @return         Default output format.
 *
 * \ingroup wstream
 */
uint32_t OTF_WStream_getFormat( OTF_WStream* wstream );


/* *** definition record write handlers *** ******************************** */


/**	Write a DEFINITIONCOMMENT record to stream 'wstream'. 
 * @see OTF_Writer_writeDefinitionComment()
 * \ingroup wstream 
 */
int OTF_WStream_writeDefinitionComment( OTF_WStream* wstream,
	const char* comment );

/**	Write a DEFINITIONCOMMENT record including an OTF_KeyValueList to stream 'wstream'. 
 * @see OTF_Writer_writeDefinitionCommentEV()
 * \ingroup wstream 
 */
int OTF_WStream_writeDefinitionCommentKV( OTF_WStream* wstream,
	const char* comment, OTF_KeyValueList* list );


/**	Write a DEFTIMERRESOLUTION record to stream 'wstream'.
 * @see OTF_Writer_writeDefTimerResolution()
 * \ingroup wstream 
 */
int OTF_WStream_writeDefTimerResolution( OTF_WStream* wstream,
	uint64_t ticksPerSecond );

/**	Write a DEFTIMERRESOLUTION record including an OTF_KeyValueList to stream 'wstream'.
 * @see OTF_Writer_writeDefTimerResolutionEV()
 * \ingroup wstream 
 */
int OTF_WStream_writeDefTimerResolutionKV( OTF_WStream* wstream,
	uint64_t ticksPerSecond, OTF_KeyValueList* list );

/**	Write a DEFPROCESS record to stream 'wstream'.
 * @see OTF_Writer_writeDefProcess()
 * \ingroup wstream 
 */
int OTF_WStream_writeDefProcess( OTF_WStream* wstream, uint32_t deftoken,
	const char* name, uint32_t parent );

/**	Write a DEFPROCESS record including an OTF_KeyValueList to stream 'wstream'.
 * @see OTF_Writer_writeDefProcessKV()
 * \ingroup wstream 
 */
int OTF_WStream_writeDefProcessKV( OTF_WStream* wstream, uint32_t deftoken,
	const char* name, uint32_t parent, OTF_KeyValueList* list );

/**	Write a DEFPROCESSGROUP record to stream 'wstream'.
 * @see OTF_Writer_writeDefProcessGroup()
 * \ingroup wstream 
 */
int OTF_WStream_writeDefProcessGroup( OTF_WStream* wstream, uint32_t deftoken,
	const char* name, uint32_t n, const uint32_t* array );

/**	Write a DEFPROCESSGROUP record including an OTF_KeyValueList to stream 'wstream'.
 * @see OTF_Writer_writeDefProcessGroupKV()
 * \ingroup wstream 
 */
int OTF_WStream_writeDefProcessGroupKV( OTF_WStream* wstream, uint32_t deftoken,
	const char* name, uint32_t n, const uint32_t* array, OTF_KeyValueList* list );

/**	Write a DEFATTRLIST record to stream 'wstream'.
 * @see OTF_Writer_writeDefAttributeList()
 * \ingroup wstream 
 */
int OTF_WStream_writeDefAttributeList( OTF_WStream* wstream, uint32_t attr_token,
	uint32_t num, OTF_ATTR_TYPE* array );

/**	Write a DEFATTRLIST record including an OTF_KeyValueList to stream 'wstream'.
 * @see OTF_Writer_writeDefAttributeListKV()
 * \ingroup wstream 
 */
int OTF_WStream_writeDefAttributeListKV( OTF_WStream* wstream, uint32_t attr_token,
	uint32_t num, OTF_ATTR_TYPE* array, OTF_KeyValueList* list );

/**	Write a DEFPROCESSORGROUPATTR record to stream 'wstream'.
 * @see OTF_Writer_writeDefAttributeList()
 * \ingroup wstream 
 */
int OTF_WStream_writeDefProcessOrGroupAttributes( OTF_WStream* wstream,
	uint32_t proc_token, uint32_t attr_token );

/**	Write a DEFPROCESSORGROUPATTR record including an OTF_KeyValueList to stream 'wstream'.
 * @see OTF_Writer_writeDefAttributeListKV()
 * \ingroup wstream 
 */
int OTF_WStream_writeDefProcessOrGroupAttributesKV( OTF_WStream* wstream,
	uint32_t proc_token, uint32_t attr_token, OTF_KeyValueList* list );

/**	Write a DEFFUNCTION record to stream 'wstream'.
 * @see OTF_Writer_writeDefFunction()
 * \ingroup wstream 
 */
int OTF_WStream_writeDefFunction( OTF_WStream* wstream, uint32_t deftoken,
	const char* name, uint32_t group, uint32_t scltoken );

/**	Write a DEFFUNCTION record including an OTF_KeyValueList to stream 'wstream'.
 * @see OTF_Writer_writeDefFunctionKV()
 * \ingroup wstream 
 */
int OTF_WStream_writeDefFunctionKV( OTF_WStream* wstream, uint32_t deftoken,
	const char* name, uint32_t group, uint32_t scltoken, OTF_KeyValueList* list );

/**	Write a DEFFUNCTIONGROUP record to stream 'wstream'.
 * @see OTF_Writer_writeDefFunctionGroup()
 * \ingroup wstream 
 */
int OTF_WStream_writeDefFunctionGroup( OTF_WStream* wstream,
	uint32_t deftoken, const char* name );

/**	Write a DEFFUNCTIONGROUP record including an OTF_KeyValueList to stream 'wstream'.
 * @see OTF_Writer_writeDefFunctionGroupKV()
 * \ingroup wstream 
 */
int OTF_WStream_writeDefFunctionGroupKV( OTF_WStream* wstream,
	uint32_t deftoken, const char* name, OTF_KeyValueList* list );

/** Write a DEFCOLLECTIVEOPERATION record to stream 'wstream'.
 * @see OTF_Writer_writeDefCollectiveOperation()
 * \ingroup wstream 
 */
int OTF_WStream_writeDefCollectiveOperation( OTF_WStream* wstream, 
	uint32_t collOp, const char* name, uint32_t type );

/** Write a DEFCOLLECTIVEOPERATION record including an OTF_KeyValueList to stream 'wstream'.
 * @see OTF_Writer_writeDefCollectiveOperationKV()
 * \ingroup wstream 
 */
int OTF_WStream_writeDefCollectiveOperationKV( OTF_WStream* wstream, 
	uint32_t collOp, const char* name, uint32_t type, OTF_KeyValueList* list );

/**	Write a DEFCOUNTER record to stream 'wstream'.
 * @see OTF_Writer_writeDefCounter()
 * \ingroup wstream 
 */
int OTF_WStream_writeDefCounter( OTF_WStream* wstream, uint32_t deftoken,
	const char* name, uint32_t properties, uint32_t countergroup, 
	const char* unit );

/**	Write a DEFCOUNTER record including an OTF_KeyValueList to stream 'wstream'.
 * @see OTF_Writer_writeDefCounterKV()
 * \ingroup wstream 
 */
int OTF_WStream_writeDefCounterKV( OTF_WStream* wstream, uint32_t deftoken,
	const char* name, uint32_t properties, uint32_t countergroup, 
	const char* unit, OTF_KeyValueList* list );

/**	Write a DEFCOUNTERGROUP record to stream 'wstream'.
 * @see OTF_Writer_writeDefCounterGroup()
 * \ingroup wstream 
 */
int OTF_WStream_writeDefCounterGroup( OTF_WStream* wstream,
	uint32_t deftoken, const char* name );

/**	Write a DEFCOUNTERGROUP record including an OTF_KeyValueList to stream 'wstream'.
 * @see OTF_Writer_writeDefCounterGroupKV()
 * \ingroup wstream 
 */
int OTF_WStream_writeDefCounterGroupKV( OTF_WStream* wstream,
	uint32_t deftoken, const char* name, OTF_KeyValueList* list );

/**	Write a DEFSCL record to stream 'wstream'. 
 * @see OTF_Writer_writeDefScl()
 * \ingroup wstream 
 */
int OTF_WStream_writeDefScl( OTF_WStream* wstream, uint32_t deftoken,
	uint32_t sclfile, uint32_t sclline );

/**	Write a DEFSCL record including an OTF_KeyValueList to stream 'wstream'. 
 * @see OTF_Writer_writeDefSclKV()
 * \ingroup wstream 
 */
int OTF_WStream_writeDefSclKV( OTF_WStream* wstream, uint32_t deftoken,
	uint32_t sclfile, uint32_t sclline, OTF_KeyValueList* list );

/**	Write a DEFSCLFILE record to stream 'wstream'.
 * @see OTF_Writer_writeDefSclFile()
 * \ingroup wstream 
 */
int OTF_WStream_writeDefSclFile( OTF_WStream* wstream,
	uint32_t deftoken, const char* filename );

/**	Write a DEFSCLFILE record including an OTF_KeyValueList to stream 'wstream'.
 * @see OTF_Writer_writeDefSclFileKV()
 * \ingroup wstream 
 */
int OTF_WStream_writeDefSclFileKV( OTF_WStream* wstream,
	uint32_t deftoken, const char* filename, OTF_KeyValueList* list );

/**	Write a DEFCREATOR record to stream 'wstream'.
 * @see OTF_Writer_writeDefCreator()
 * \ingroup wstream 
 */
int OTF_WStream_writeDefCreator( OTF_WStream* wstream, const char* creator );

/**	Write a DEFCREATOR record including an OTF_KeyValueList to stream 'wstream'.
 * @see OTF_Writer_writeDefCreatorKV()
 * \ingroup wstream 
 */
int OTF_WStream_writeDefCreatorKV( OTF_WStream* wstream, const char* creator, OTF_KeyValueList* list );

/**
 * Write a DEFUNIQUEID record to stream 'wstream'.
 * This record is generated automatically at beginning of tracing in the global
 * definition stream.
 *
 * @param wstream      Initialized OTF_WStream instance.
 * @return             1 on success, 0 if an error occurs.
 *
 * \ingroup wstream
 */
int OTF_WStream_writeUniqueId( OTF_WStream* wstream );

/** Write a DEFVERSION record to stream 'wstream'.
 * @see OTF_Writer_writeOtfVersion()
 * \ingroup wstream 
 */
int OTF_WStream_writeOtfVersion( OTF_WStream* wstream );

/** Write a DEFFILE record to stream 'wstream'. 
 * @see OTF_Writer_writeDefFile()
 * \ingroup wstream 
 */
int OTF_WStream_writeDefFile( OTF_WStream* wstream, uint32_t token,
	const char* name, uint32_t group );

/** Write a DEFFILE record including an OTF_KeyValueList to stream 'wstream'. 
 * @see OTF_Writer_writeDefFileKV()
 * \ingroup wstream 
 */
int OTF_WStream_writeDefFileKV( OTF_WStream* wstream, uint32_t token,
	const char* name, uint32_t group, OTF_KeyValueList* list );

/** Write a DEFFILEGROUP record to stream 'wstream'.
 * @see OTF_Writer_writeDefFileGroup()
 * \ingroup wstream 
 */
int OTF_WStream_writeDefFileGroup( OTF_WStream* wstream, uint32_t token,
	const char* name );

/** Write a DEFFILEGROUP record including an OTF_KeyValueList to stream 'wstream'.
 * @see OTF_Writer_writeDefFileGroupKV()
 * \ingroup wstream 
 */
int OTF_WStream_writeDefFileGroupKV( OTF_WStream* wstream, uint32_t token,
	const char* name, OTF_KeyValueList* list );

/** Write a DEFKEYVALUE record to stream 'wstream'.
 * @see OTF_Writer_writeDefKeyValue()
 * \ingroup wstream 
 */
int OTF_WStream_writeDefKeyValue( OTF_WStream* wstream,	uint32_t key,
	OTF_Type type, const char* name, const char *description );

/** Write a DEFKEYVALUE record including an OTF_KeyValueList to stream 'wstream'.
 * @see OTF_Writer_writeDefKeyValueKV()
 * \ingroup wstream 
 */
int OTF_WStream_writeDefKeyValueKV( OTF_WStream* wstream, uint32_t key,
	OTF_Type type, const char* name, const char *description,
	OTF_KeyValueList* list );


/** Write a DEFTIMERANGE record including an OTF_KeyValueList to
 *  stream 'wstream'.
 * @see OTF_Writer_writeDefTimeRange()
 * \ingroup wstream
 */
int OTF_WStream_writeDefTimeRange( OTF_WStream* wstream, uint64_t minTime,
	uint64_t maxTime, OTF_KeyValueList* list );

/** Write a DEFCOUNTERASSIGNMENTS record including an OTF_KeyValueList to
 *  stream 'wstream'.
 * @see OTF_Writer_writeDefCounterAssignments()
 * \ingroup wstream
 */
int OTF_WStream_writeDefCounterAssignments( OTF_WStream* wstream,
	uint32_t counter_token, uint32_t number_of_members,
	const uint32_t* procs_or_groups, OTF_KeyValueList* list );

/** Write a DEFPROCESSSUBTITUTES record including an OTF_KeyValueList to
 *  stream 'wstream'.
 * @see OTF_Writer_writeDefProcessSubsitutes()
 * \ingroup wstream
 */
int OTF_WStream_writeDefProcessSubstitutes( OTF_WStream* wstream,
	uint32_t representative, uint32_t numberOfProcs, const uint32_t* procs,
	OTF_KeyValueList* list );


/** Write a DEFAUXSAMPLEPOINT record to stream 'wstream'.
 * @see OTF_Writer_writeDefAuxSamplePoint()
 * \ingroup wstream
 */
int OTF_WStream_writeDefAuxSamplePoint( OTF_WStream*           wstream,
                                        uint64_t               time,
                                        OTF_AuxSamplePointType type,
                                        OTF_KeyValueList*      list );


/* *** event record write handlers *** ************************************* */


/**	Write a NOOP record including an OTF_KeyValueList to stream 'wstream'.
 * @see OTF_Writer_writeNoOpKV()
 * \ingroup wstream 
 */
int OTF_WStream_writeNoOpKV( OTF_WStream* wstream, uint64_t time,
    uint32_t process, OTF_KeyValueList* list );

/**	Write a ENTER record to stream 'wstream'.
 * @see OTF_Writer_writeEnter()
 * \ingroup wstream 
 */
int OTF_WStream_writeEnter( OTF_WStream* wstream, uint64_t time,
    uint32_t statetoken, uint32_t cpuid, uint32_t scltoken );

/**	Write a ENTER record including an OTF_KeyValueList to stream 'wstream'.
 * @see OTF_Writer_writeEnterKV()
 * \ingroup wstream 
 */
int OTF_WStream_writeEnterKV( OTF_WStream* wstream, uint64_t time,
    uint32_t statetoken, uint32_t cpuid, uint32_t scltoken, OTF_KeyValueList* list );

/**	Write a RECEIVE record to stream 'wstream'.
 * @see OTF_Writer_writeRecvMsg()
 * \ingroup wstream 
 */
int OTF_WStream_writeRecvMsg( OTF_WStream* wstream, uint64_t time,
    uint32_t receiver, uint32_t sender, uint32_t communicator,
    uint32_t msgtype, uint32_t msglength, uint32_t scltoken );

/**	Write a RECEIVE record including an OTF_KeyValueList to stream 'wstream'.
 * @see OTF_Writer_writeRecvMsgKV()
 * \ingroup wstream 
 */
int OTF_WStream_writeRecvMsgKV( OTF_WStream* wstream, uint64_t time,
    uint32_t receiver, uint32_t sender, uint32_t communicator,
    uint32_t msgtype, uint32_t msglength, uint32_t scltoken, OTF_KeyValueList* list );

/**	Write a SEND record to stream 'wstream'.
 * @see OTF_Writer_writeSendMsg()
 * \ingroup wstream 
 */
int OTF_WStream_writeSendMsg( OTF_WStream* wstream, uint64_t time, 
    uint32_t sender, uint32_t receiver, uint32_t communicator, 
    uint32_t msgtype, uint32_t msglength, uint32_t scltoken );

/**	Write a SEND record including an OTF_KeyValueList to stream 'wstream'.
 * @see OTF_Writer_writeSendMsgKV()
 * \ingroup wstream 
 */
int OTF_WStream_writeSendMsgKV( OTF_WStream* wstream, uint64_t time, 
    uint32_t sender, uint32_t receiver, uint32_t communicator, 
    uint32_t msgtype, uint32_t msglength, uint32_t scltoken, OTF_KeyValueList* list );

/**	Write a LEAVE record to stream 'wstream'.
 * @see OTF_Writer_writeLeave()
 * \ingroup wstream 
 */
int OTF_WStream_writeLeave( OTF_WStream* wstream, uint64_t time,
    uint32_t statetoken, uint32_t cpuid, uint32_t scltoken );

/**	Write a LEAVE record including an OTF_KeyValueList to stream 'wstream'.
 * @see OTF_Writer_writeLeaveKV()
 * \ingroup wstream 
 */
int OTF_WStream_writeLeaveKV( OTF_WStream* wstream, uint64_t time,
    uint32_t statetoken, uint32_t cpuid, uint32_t scltoken, OTF_KeyValueList* list );

/**	Write a COUNTER record to stream 'wstream'.
 * @see OTF_Writer_writeCounter()
 * \ingroup wstream 
 */
int OTF_WStream_writeCounter( OTF_WStream* wstream, uint64_t time, 
    uint32_t process, uint32_t counter_token, uint64_t value );

/**	Write a COUNTER record including an OTF_KeyValueList to stream 'wstream'.
 * @see OTF_Writer_writeCounterKV()
 * \ingroup wstream 
 */
int OTF_WStream_writeCounterKV( OTF_WStream* wstream, uint64_t time, 
    uint32_t process, uint32_t counter_token, uint64_t value, OTF_KeyValueList* list );

/** Write a COLLOP record to stream 'wstream'. 
 * @deprecated This event record has been deprecated due to usage constraints.
 *             Please use OTF_WStream_writeBeginCollectiveOperation() and
 *             OTF_WStream_writeEndCollectiveOperation(), repectively.
 * \ingroup wstream  */
int OTF_WStream_writeCollectiveOperation( OTF_WStream* wstream, uint64_t time, 
    uint32_t process, uint32_t functionToken, uint32_t communicator, 
    uint32_t rootprocess, uint32_t sent, uint32_t received, 
    uint64_t duration, uint32_t scltoken );

/** Write a COLLOP record including an OTF_KeyValueList to stream 'wstream'. 
 * @deprecated This event record has been deprecated due to usage constraints.
 *             Please use OTF_WStream_writeBeginCollectiveOperationKV() and
 *             OTF_WStream_writeEndCollectiveOperationKV(), repectively.
 * \ingroup wstream  */
int OTF_WStream_writeCollectiveOperationKV( OTF_WStream* wstream, uint64_t time, 
    uint32_t process, uint32_t functionToken, uint32_t communicator, 
    uint32_t rootprocess, uint32_t sent, uint32_t received, 
    uint64_t duration, uint32_t scltoken, OTF_KeyValueList* list );

/** Write a COLLOPBEGIN record to stream 'wstream'.
 * @see OTF_Writer_writeBeginCollectiveOperation()
 * \ingroup wstream 
 */
int OTF_WStream_writeBeginCollectiveOperation( OTF_WStream* wstream,
                uint64_t time, uint32_t process, uint32_t collOp,
                uint64_t matchingId, uint32_t procGroup, uint32_t rootProc,
                uint64_t sent, uint64_t received, uint32_t scltoken );

/** Write a COLLOPBEGIN record including an OTF_KeyValueList to stream 'wstream'.
 * @see OTF_Writer_writeBeginCollectiveOperationKV()
 * \ingroup wstream 
 */
int OTF_WStream_writeBeginCollectiveOperationKV( OTF_WStream* wstream,
                uint64_t time, uint32_t process, uint32_t collOp,
                uint64_t matchingId, uint32_t procGroup, uint32_t rootProc,
                uint64_t sent, uint64_t received, uint32_t scltoken, OTF_KeyValueList* list );

/** Write a COLLOPEND record to stream 'wstream'.
 * @see OTF_Writer_writeEndCollectiveOperation()
 * \ingroup wstream 
 */
int OTF_WStream_writeEndCollectiveOperation( OTF_WStream* wstream,
                uint64_t time, uint32_t process, uint64_t matchingId );

/** Write a COLLOPEND record including an OTF_KeyValueList to stream 'wstream'.
 * @see OTF_Writer_writeEndCollectiveOperationKV()
 * \ingroup wstream 
 */
int OTF_WStream_writeEndCollectiveOperationKV( OTF_WStream* wstream,
                uint64_t time, uint32_t process, uint64_t matchingId, OTF_KeyValueList* list );

/** Write a #EVTCOMMENT record to stream 'wstream'.
 * @see OTF_Writer_writeEventComment()
 * \ingroup wstream 
 */
int OTF_WStream_writeEventComment( OTF_WStream* wstream, uint64_t time, 
    uint32_t process, const char* comment );

/** Write a #EVTCOMMENT record including an OTF_KeyValueList to stream 'wstream'.
 * @see OTF_Writer_writeEventCommentKV()
 * \ingroup wstream 
 */
int OTF_WStream_writeEventCommentKV( OTF_WStream* wstream, uint64_t time, 
    uint32_t process, const char* comment, OTF_KeyValueList* list );

/** Write a PROCESSBEGIN record to stream 'wstream'.
 * @see OTF_Writer_writeBeginProcess()
 * \ingroup wstream 
 */
int OTF_WStream_writeBeginProcess( OTF_WStream* wstream, uint64_t time,
    uint32_t process );

/** Write a PROCESSBEGIN record including an OTF_KeyValueList to stream 'wstream'.
 * @see OTF_Writer_writeBeginProcessKV()
 * \ingroup wstream 
 */
int OTF_WStream_writeBeginProcessKV( OTF_WStream* wstream, uint64_t time,
    uint32_t process, OTF_KeyValueList* list );

/** Write a PROCESSEND record to stream 'wstream'.
 * @see OTF_Writer_writeEndProcess()
 * \ingroup wstream 
 */
int OTF_WStream_writeEndProcess( OTF_WStream* wstream, uint64_t time,
    uint32_t process );

/** Write a PROCESSEND record including an OTF_KeyValueList to stream 'wstream'.
 * @see OTF_Writer_writeEndProcessKV()
 * \ingroup wstream 
 */
int OTF_WStream_writeEndProcessKV( OTF_WStream* wstream, uint64_t time,
    uint32_t process, OTF_KeyValueList* list );

/** Write a FILEOP record to stream 'wstream'.
 * @deprecated This event record has been deprecated due to usage constraints.
 *             Please use OTF_WStream_writeBeginFileOperation() and
 *             OTF_WStream_writeEndFileOperation(), respectively.
 * \ingroup wstream  */
int OTF_WStream_writeFileOperation( OTF_WStream* wstream, uint64_t time,
	uint32_t fileid, uint32_t process, uint64_t handleid, uint32_t operation,
	uint64_t bytes, uint64_t duration, uint32_t source );

/** Write a FILEOP record including an OTF_KeyValueList to stream 'wstream'.
 * @deprecated This event record has been deprecated due to usage constraints.
 *             Please use OTF_WStream_writeBeginFileOperationKV() and
 *             OTF_WStream_writeEndFileOperationKV(), respectively.
 * \ingroup wstream  */
int OTF_WStream_writeFileOperationKV( OTF_WStream* wstream, uint64_t time,
	uint32_t fileid, uint32_t process, uint64_t handleid, uint32_t operation,
	uint64_t bytes, uint64_t duration, uint32_t source, OTF_KeyValueList* list );

/** Write a FILEOPBEGIN record to stream 'wstream'.
 * @see OTF_Writer_writeBeginFileOperation()
 * \ingroup wstream 
 */
int OTF_WStream_writeBeginFileOperation( OTF_WStream* wstream, uint64_t time,
    uint32_t process, uint64_t matchingId, uint32_t scltoken );

/** Write a FILEOPBEGIN record including an OTF_KeyValueList to stream 'wstream'.
 * @see OTF_Writer_writeBeginFileOperationKV()
 * \ingroup wstream 
 */
int OTF_WStream_writeBeginFileOperationKV( OTF_WStream* wstream, uint64_t time,
    uint32_t process, uint64_t matchingId, uint32_t scltoken, OTF_KeyValueList* list );

/** Write a FILEOPEND record to stream 'wstream'.
 * @see OTF_Writer_writeEndFileOperation()
 * \ingroup wstream 
 */
int OTF_WStream_writeEndFileOperation( OTF_WStream* wstream, uint64_t time,
                uint32_t process, uint32_t fileid, uint64_t matchingId,
                uint64_t handleId, uint32_t operation, uint64_t bytes,
                uint32_t scltoken );

/** Write a FILEOPEND record including an OTF_KeyValueList to stream 'wstream'.
 * @see OTF_Writer_writeEndFileOperationKV()
 * \ingroup wstream 
 */
int OTF_WStream_writeEndFileOperationKV( OTF_WStream* wstream, uint64_t time,
                uint32_t process, uint32_t fileid, uint64_t matchingId,
                uint64_t handleId, uint32_t operation, uint64_t bytes,
                uint32_t scltoken, OTF_KeyValueList* list );

/** Write a RMAPUT record to stream 'wstream'.
 * @see OTF_Writer_writeRMAPut()
 * \ingroup wstream 
 */
int OTF_WStream_writeRMAPut( OTF_WStream* wstream, uint64_t time,
    uint32_t process, uint32_t origin, uint32_t target, uint32_t communicator,
    uint32_t tag, uint64_t bytes, uint32_t scltoken );

/** Write a RMAPUT record including an OTF_KeyValueList to stream 'wstream'.
 * @see OTF_Writer_writeRMAPutKV()
 * \ingroup wstream 
 */
int OTF_WStream_writeRMAPutKV( OTF_WStream* wstream, uint64_t time,
    uint32_t process, uint32_t origin, uint32_t target, uint32_t communicator,
    uint32_t tag, uint64_t bytes, uint32_t scltoken, OTF_KeyValueList* list );

/** Write a RMAPUTRE record to stream 'wstream'.
 * @see OTF_Writer_writeRMAPutRemoteEnd()
 * \ingroup wstream 
 */
int OTF_WStream_writeRMAPutRemoteEnd( OTF_WStream* wstream, uint64_t time,
    uint32_t process, uint32_t origin, uint32_t target, uint32_t communicator,
    uint32_t tag, uint64_t bytes, uint32_t scltoken );

/** Write a RMAPUTRE record including an OTF_KeyValueList to stream 'wstream'.
 * @see OTF_Writer_writeRMAPutRemoteEndKV()
 * \ingroup wstream 
 */
int OTF_WStream_writeRMAPutRemoteEndKV( OTF_WStream* wstream, uint64_t time,
    uint32_t process, uint32_t origin, uint32_t target, uint32_t communicator,
    uint32_t tag, uint64_t bytes, uint32_t scltoken, OTF_KeyValueList* list );

/** Write a RMAGET record to stream 'wstream'.
 * @see OTF_Writer_writeRMAGet()
 * \ingroup wstream 
 */
int OTF_WStream_writeRMAGet( OTF_WStream* wstream, uint64_t time,
    uint32_t process, uint32_t origin, uint32_t target, uint32_t communicator,
    uint32_t tag, uint64_t bytes, uint32_t scltoken );

/** Write a RMAGET record including an OTF_KeyValueList to stream 'wstream'.
 * @see OTF_Writer_writeRMAGetKV()
 * \ingroup wstream 
 */
int OTF_WStream_writeRMAGetKV( OTF_WStream* wstream, uint64_t time,
    uint32_t process, uint32_t origin, uint32_t target, uint32_t communicator,
    uint32_t tag, uint64_t bytes, uint32_t scltoken, OTF_KeyValueList* list );

/** Write a RMAEND record to stream 'wstream'.
 * @see OTF_Writer_writeRMAEnd()
 * \ingroup wstream 
 */
int OTF_WStream_writeRMAEnd( OTF_WStream* wstream, uint64_t time,
    uint32_t process, uint32_t remote, uint32_t communicator, uint32_t tag,
    uint32_t scltoken );

/** Write a RMAEND record including an OTF_KeyValueList to stream 'wstream'.
 * @see OTF_Writer_writeRMAEndKV()
 * \ingroup wstream 
 */
int OTF_WStream_writeRMAEndKV( OTF_WStream* wstream, uint64_t time,
    uint32_t process, uint32_t remote, uint32_t communicator, uint32_t tag,
    uint32_t scltoken, OTF_KeyValueList* list );


/* *** public snapshot record write handlers *** */


/** Write a #TCOMMENT record to stream 'wstream'.
 * @see OTF_Writer_writeSnapshotComment()
 * \ingroup wstream 
 */
int OTF_WStream_writeSnapshotComment( OTF_WStream* wstream, uint64_t time, 
    uint32_t process, const char* comment );

/** Write a #TCOMMENT record including an OTF_KeyValueList to stream 'wstream'.
 * @see OTF_Writer_writeSnapshotCommentKV()
 * \ingroup wstream 
 */
int OTF_WStream_writeSnapshotCommentKV( OTF_WStream* wstream, uint64_t time, 
    uint32_t process, const char* comment, OTF_KeyValueList* list );

/** Write a TENTER record to stream 'wstream'.
 * @see OTF_Writer_writeEnterSnapshot()
 * \ingroup wstream 
 */
int OTF_WStream_writeEnterSnapshot( OTF_WStream* wstream, uint64_t time,
    uint64_t originaltime, uint32_t statetoken, uint32_t cpuid, uint32_t scltoken );

/** Write a TENTER record including an OTF_KeyValueList to stream 'wstream'.
 * @see OTF_Writer_writeEnterSnapshotKV()
 * \ingroup wstream 
 */
int OTF_WStream_writeEnterSnapshotKV( OTF_WStream* wstream, uint64_t time,
    uint64_t originaltime, uint32_t statetoken, uint32_t cpuid, uint32_t scltoken, OTF_KeyValueList* list );

/** Write a TSEND record to stream 'wstream'.
 * @see OTF_Writer_writeSendSnapshot()
 * \ingroup wstream 
 */
int OTF_WStream_writeSendSnapshot( OTF_WStream* wstream, uint64_t time,
		uint64_t originaltime, uint32_t sender, uint32_t receiver,
		uint32_t procGroup, uint32_t type, uint32_t length, uint32_t source );

/** Write a TSEND record including an OTF_KeyValueList to stream 'wstream'.
 * @see OTF_Writer_writeSendSnapshotKV()
 * \ingroup wstream 
 */
int OTF_WStream_writeSendSnapshotKV( OTF_WStream* wstream, uint64_t time,
		uint64_t originaltime, uint32_t sender, uint32_t receiver,
		uint32_t procGroup, uint32_t type, uint32_t length,
        uint32_t source, OTF_KeyValueList* list );

/** Write a TOPENFILE record to stream 'wstream'.
 * @see OTF_Writer_writeOpenFileSnapshot()
 * \ingroup wstream 
 */
int OTF_WStream_writeOpenFileSnapshot( OTF_WStream* wstream,uint64_t time,
	uint64_t originaltime, uint32_t fileid, uint32_t process, uint64_t handleid,
	uint32_t source );

/** Write a TOPENFILE record including an OTF_KeyValueList to stream 'wstream'.
 * @see OTF_Writer_writeOpenFileSnapshotKV()
 * \ingroup wstream 
 */
int OTF_WStream_writeOpenFileSnapshotKV( OTF_WStream* wstream,uint64_t time,
	uint64_t originaltime, uint32_t fileid, uint32_t process, uint64_t handleid,
	uint32_t source, OTF_KeyValueList* list );


/** Write a TBEGINCOLLOP record to stream 'wstream'.
 * @see OTF_Writer_writeBeginCollopSnapshot()
 * \ingroup wstream 
 */
int OTF_WStream_writeBeginCollopSnapshot( OTF_WStream* wstream, uint64_t time,
    uint64_t originaltime, uint32_t process, uint32_t collOp, uint64_t matchingId,
	uint32_t procGroup, uint32_t rootProc, uint64_t sent, uint64_t received,
    uint32_t scltoken );


/** Write a TBEGINCOLLOP record including an OTF_KeyValueList to stream 'wstream'.
 * @see OTF_Writer_writeBeginCollopSnapshotKV()
 * \ingroup wstream 
 */
int OTF_WStream_writeBeginCollopSnapshotKV( OTF_WStream* wstream, uint64_t time,
    uint64_t originaltime, uint32_t process, uint32_t collOp, uint64_t matchingId,
	uint32_t procGroup, uint32_t rootProc, uint64_t sent, uint64_t received,
    uint32_t scltoken, OTF_KeyValueList *list );


/** Write a TBEGINFILEOP record to stream 'wstream'.
 * @see OTF_Writer_writeBeginFileOpSnapshot()
 * \ingroup wstream 
 */
int OTF_WStream_writeBeginFileOpSnapshot( OTF_WStream* wstream, uint64_t time,
     uint64_t originaltime, uint32_t process, uint64_t matchingId, uint32_t scltoken );

/** Write a TBEGINFILEOP record including an OTF_KeyValueList to stream 'wstream'.
 * @see OTF_Writer_writeBeginFileOpSnapshotKV()
 * \ingroup wstream 
 */
int OTF_WStream_writeBeginFileOpSnapshotKV( OTF_WStream* wstream, uint64_t time,
     uint64_t originaltime, uint32_t process, uint64_t matchingId,
     uint32_t scltoken, OTF_KeyValueList *list );


/** Write a TCOLLOPCOUNT record to stream 'wstream'.
 * @see OTF_Writer_writeCollopCountSnapshot()
 * \ingroup wstream
 */
int OTF_WStream_writeCollopCountSnapshot( OTF_WStream* wstream,
                                          uint64_t time,
                                          uint32_t process,
                                          uint32_t communicator,
                                          uint64_t count,
                                          OTF_KeyValueList* list );


/** Write a TCOUNTER record to stream 'wstream'.
 * @see OTF_Writer_writeCounterSnapshot()
 * \ingroup wstream
 */
int OTF_WStream_writeCounterSnapshot( OTF_WStream*      wstream,
                                      uint64_t          time,
                                      uint64_t          originaltime,
                                      uint32_t          process,
                                      uint32_t          counter,
                                      uint64_t          value,
                                      OTF_KeyValueList* list );


/* *** public statistics record write handlers *** */


/** Write a SUMCOMMENT record to stream 'wstream'.
 * @see OTF_Writer_writeSummaryComment()
 * \ingroup wstream 
 */
int OTF_WStream_writeSummaryComment( OTF_WStream* wstream, uint64_t time, 
    uint32_t process, const char* comment );

/** Write a SUMCOMMENT record including an OTF_KeyValueList to stream 'wstream'.
 * @see OTF_Writer_writeSummaryCommentKV()
 * \ingroup wstream 
 */
int OTF_WStream_writeSummaryCommentKV( OTF_WStream* wstream, uint64_t time, 
    uint32_t process, const char* comment, OTF_KeyValueList* list );

/** Write a SUMFUNCTION record to stream 'wstream'.
 * @see OTF_Writer_writeFunctionSummary()
 * \ingroup wstream 
 */
int OTF_WStream_writeFunctionSummary( OTF_WStream* wstream, 
	uint64_t time, uint32_t function, uint32_t process, 
	uint64_t count, uint64_t excltime, uint64_t incltime );

/** Write a SUMFUNCTION record including an OTF_KeyValueList to stream 'wstream'.
 * @see OTF_Writer_writeFunctionSummaryKV()
 * \ingroup wstream 
 */
int OTF_WStream_writeFunctionSummaryKV( OTF_WStream* wstream, 
	uint64_t time, uint32_t function, uint32_t process, 
	uint64_t count, uint64_t excltime, uint64_t incltime, OTF_KeyValueList* list );

/** Write a SUMFUNCTIONGROUP record to stream 'wstream'.
 * @see OTF_Writer_writeFunctionGroupSummary()
 * \ingroup wstream 
 */
int OTF_WStream_writeFunctionGroupSummary( OTF_WStream* wstream, 
	uint64_t time,  uint32_t functiongroup,  uint32_t process,  
	uint64_t count,  uint64_t excltime,  uint64_t incltime );

/** Write a SUMFUNCTIONGROUP record including an OTF_KeyValueList to stream 'wstream'.
 * @see OTF_Writer_writeFunctionGroupSummaryKV()
 * \ingroup wstream 
 */
int OTF_WStream_writeFunctionGroupSummaryKV( OTF_WStream* wstream, 
	uint64_t time,  uint32_t functiongroup,  uint32_t process,  
	uint64_t count,  uint64_t excltime,  uint64_t incltime, OTF_KeyValueList* list );

/** Write a SUMMESSAGE record to stream 'wstream'. 
 * @see OTF_Writer_writeMessageSummary()
 * \ingroup wstream 
 */
int OTF_WStream_writeMessageSummary( OTF_WStream* wstream, 
	uint64_t time, uint32_t process, uint32_t peer, 
	uint32_t comm,  uint32_t tag, uint64_t number_sent, uint64_t number_recved,
	uint64_t bytes_sent,  uint64_t bytes_recved );

/** Write a SUMMESSAGE record including an OTF_KeyValueList to stream 'wstream'. 
 * @see OTF_Writer_writeMessageSummaryKV()
 * \ingroup wstream 
 */
int OTF_WStream_writeMessageSummaryKV( OTF_WStream* wstream, 
	uint64_t time, uint32_t process, uint32_t peer, 
	uint32_t comm,  uint32_t tag, uint64_t number_sent, uint64_t number_recved,
	uint64_t bytes_sent,  uint64_t bytes_recved, OTF_KeyValueList* list );

/** Write a COLLOPMESSAGE record to stream 'wstream'.
 * @see OTF_Writer_writeCollopSummary()
 * \ingroup wstream 
 */
int OTF_WStream_writeCollopSummary( OTF_WStream* wstream,
	uint64_t time, uint32_t process, uint32_t comm, uint32_t collective,
	uint64_t number_sent, uint64_t number_recved, uint64_t bytes_sent,  uint64_t bytes_recved );

/** Write a COLLOPMESSAGE record including an OTF_KeyValueList to stream 'wstream'.
 * @see OTF_Writer_writeCollopSummaryKV()
 * \ingroup wstream 
 */
int OTF_WStream_writeCollopSummaryKV( OTF_WStream* wstream,
	uint64_t time, uint32_t process, uint32_t comm, uint32_t collective,
	uint64_t number_sent, uint64_t number_recved, uint64_t bytes_sent,  uint64_t bytes_recved, OTF_KeyValueList* list );

/** Write a SUMFILEOPERATION record to stream 'wstream'.
 * @see OTF_Writer_writeFileOperationSummary()
 * \ingroup wstream 
 */
int OTF_WStream_writeFileOperationSummary( OTF_WStream* wstream, uint64_t time,
	uint32_t fileid, uint32_t process, uint64_t nopen, uint64_t nclose,
	uint64_t nread, uint64_t nwrite, uint64_t nseek, uint64_t bytesread,
	uint64_t byteswrite );

/** Write a SUMFILEOPERATION record including an OTF_KeyValueList to stream 'wstream'.
 * @see OTF_Writer_writeFileOperationSummaryKV()
 * \ingroup wstream 
 */
int OTF_WStream_writeFileOperationSummaryKV( OTF_WStream* wstream, uint64_t time,
	uint32_t fileid, uint32_t process, uint64_t nopen, uint64_t nclose,
	uint64_t nread, uint64_t nwrite, uint64_t nseek, uint64_t bytesread,
	uint64_t byteswrite, OTF_KeyValueList* list );

/** Write a SUMFILEGROUPOPERATION record to stream 'wstream'.
 * @see OTF_Writer_writeFileGroupOperationSummary()
 * \ingroup wstream 
 */
int OTF_WStream_writeFileGroupOperationSummary( OTF_WStream* wstream, uint64_t time,
	uint32_t groupid, uint32_t process, uint64_t nopen, uint64_t nclose,
	uint64_t nread, uint64_t nwrite, uint64_t nseek, uint64_t bytesread,
	uint64_t byteswrite );

/** Write a SUMFILEGROUPOPERATION record including an OTF_KeyValueList to stream 'wstream'.
 * @see OTF_Writer_writeFileGroupOperationSummaryKV()
 * \ingroup wstream 
 */
int OTF_WStream_writeFileGroupOperationSummaryKV( OTF_WStream* wstream, uint64_t time,
	uint32_t groupid, uint32_t process, uint64_t nopen, uint64_t nclose,
	uint64_t nread, uint64_t nwrite, uint64_t nseek, uint64_t bytesread,
	uint64_t byteswrite, OTF_KeyValueList* list );

/*
int OTF_WStream_writeCounterSummary( OTF_WStream* wstream, 
	uint64_t time,  uint32_t process,  
	uint32_t counter,  uint64_t value );

int OTF_WStream_writeCollOpSummary( OTF_WStream* wstream, 
	uint64_t time, uint32_t process,  uint32_t root,  
	uint64_t bytes_sent, uint64_t bytes_recved );
*/



/* *** marker record types *** */

/** Write a def marker record to stream 'wstream'.
 * @see OTF_Writer_writeDefMarker()
 * \ingroup wstream 
 */
int OTF_WStream_writeDefMarker( OTF_WStream* wstream, 
                                uint32_t token, 
                                const char* name, 
                                uint32_t type );

/** Write a def marker record including an OTF_KeyValueList to stream 'wstream'.
 * @see OTF_Writer_writeDefMarkerKV()
 * \ingroup wstream 
 */
int OTF_WStream_writeDefMarkerKV( OTF_WStream* wstream, 
                                uint32_t token, 
                                const char* name, 
                                uint32_t type,
				OTF_KeyValueList* list );

/** Write a marker record to stream 'wstream'.
 * @see OTF_Writer_writeMarker()
 * \ingroup wstream 
 */
int OTF_WStream_writeMarker( OTF_WStream* wstream, 
                             uint64_t time, 
                             uint32_t process, 
                             uint32_t token, 
                             const char* text );

/** Write a marker record including an OTF_KeyValueList to stream 'wstream'.
 * @see OTF_Writer_writeMarkerKV()
 * \ingroup wstream 
 */
int OTF_WStream_writeMarkerKV( OTF_WStream* wstream, 
                             uint64_t time, 
                             uint32_t process, 
                             uint32_t token, 
                             const char* text,
			     OTF_KeyValueList* list );


#ifdef __cplusplus
}
#endif /* __cplusplus */

#endif /* OTF_WSTREAM_H */