This file is indexed.

/usr/include/taningia/atom.h is in libtaningia-dev 0.2.2-2.

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
/*
 * Copyright (C) 2009  Lincoln de Sousa <lincoln@minaslivre.org>
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License as
 * published by the Free Software Foundation; either version 2 of the
 * License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * General Public License for more details.
 *
 * You should have received a copy of the GNU General Public
 * License along with this program; if not, write to the
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 * Boston, MA 02111-1307, USA.
 */

#ifndef _TANINGIA_ATOM_H_
#define _TANINGIA_ATOM_H_

#ifdef __cplusplus
extern "C" {
#endif

#include <time.h>
#include <iksemel.h>
#include <taningia/object.h>
#include <taningia/iri.h>
#include <taningia/error.h>
#include <taningia/list.h>

#define TA_ATOM_NS "http://www.w3.org/2005/Atom"
#define TA_ATOM_THREADING_NS "http://purl.org/syndication/thread/1.0"

typedef struct
{
  ta_object_t parent;
  char *name;
  char *value;
} ta_atom_simple_element_t;

typedef struct
{
  ta_object_t parent;
  ta_iri_t *ref;
  ta_iri_t *href;
  ta_iri_t *source;
  char *type;
} ta_atom_in_reply_to_t;

typedef struct
{
  ta_object_t parent;
  ta_iri_t *href;
  char *title;
  char *rel;
  char *type;
  char *length;
} ta_atom_link_t;

typedef struct
{
  ta_object_t parent;
  char *type;
  char *content;
  int len;
  ta_iri_t *src;
} ta_atom_content_t;

typedef struct
{
  ta_object_t parent;
  char *name;
  char *email;
  ta_iri_t *iri;
  ta_list_t *ext_elements;
} ta_atom_person_t;

typedef struct
{
  ta_object_t parent;
  char *label;
  char *term;
  ta_iri_t *scheme;
} ta_atom_category_t;

typedef struct
{
  ta_object_t parent;
  ta_iri_t *id;
  char *title;
  time_t updated;
  time_t published;
  char *rights;
  ta_list_t *authors;
  ta_list_t *categories;
  ta_list_t *links;
  char *summary;
  ta_atom_content_t *content;
  ta_error_t *error;
  ta_list_t *ext_elements;
  ta_list_t *in_reply_to;
} ta_atom_entry_t;

typedef struct
{
  ta_object_t parent;
  ta_iri_t *id;
  char *title;
  time_t updated;
  ta_list_t *authors;
  ta_list_t *categories;
  ta_list_t *entries;
  ta_list_t *links;
  ta_error_t *error;
  ta_list_t *ext_elements;
} ta_atom_feed_t;

typedef enum {
  TA_ATOM_LOAD_ERROR,
  TA_ATOM_PARSING_ERROR
} ta_atom_error_t;

/* -- Atom Simple Ext Element -- */

/**
 * @name: ta_atom_simple_element::new
 * @type: constructor
 */
ta_atom_simple_element_t *ta_atom_simple_element_new (const char *name,
                                                      const char *value);

/**
 * @name: ta_atom_simple_element::init
 * @type: initializer
 */
void ta_atom_simple_element_init (ta_atom_simple_element_t *see,
                                  const char *name, const char *value);

/**
 * @name: ta_atom_simple_element::to_iks
 * @type: method
 *
 * Returns an iks representation of a simple element.
 */
iks *ta_atom_simple_element_to_iks (ta_atom_simple_element_t *see);

/**
 * @name: ta_atom_simple_element::to_string
 * @type: method
 *
 * Returns a string representation of a simple element.
 */
char *ta_atom_simple_element_to_string (ta_atom_simple_element_t *sse);

/**
 * @name: ta_atom_simple_element::get_name
 * @type: getter
 */
const char *ta_atom_simple_element_get_name (ta_atom_simple_element_t *sse);

/**
 * @name: ta_atom_simple_element::set_name
 * @type: setter
 */
void ta_atom_simple_element_set_name (ta_atom_simple_element_t *sse,
                                      const char *name);

/**
 * @name: ta_atom_simple_element::get_value
 * @type: getter
 */
const char *ta_atom_simple_element_get_value (ta_atom_simple_element_t *sse);

/**
 * @name: ta_atom_simple_element::set_value
 * @type: setter
 */
void ta_atom_simple_element_set_value (ta_atom_simple_element_t *sse,
                                       const char *value);

/* -- Atom Link -- */

/**
 * @name: ta_atom_link::new
 * @type: constructor
 * @param href: Link target.
 */
ta_atom_link_t *ta_atom_link_new (ta_iri_t *href);

/**
 * @name: ta_atom_link::init
 * @type: initializer
 */
void ta_atom_link_init (ta_atom_link_t *link, ta_iri_t *href);

/**
 * @name: ta_atom_link::to_iks
 * @type: method
 *
 * This method returns an iks representation of the link instance.
 */
iks *ta_atom_link_to_iks (ta_atom_link_t *link);

/**
 * @name: ta_atom_link::to_string
 * @type: method
 *
 * This method returns an xml representation of the link instance.
 */
char *ta_atom_link_to_string (ta_atom_link_t *link);

/**
 * @name: ta_atom_link::get_href
 * @type: getter
 */
ta_iri_t *ta_atom_link_get_href (ta_atom_link_t *link);

/**
 * @name: ta_atom_link::set_href
 * @type: setter
 */
void ta_atom_link_set_href (ta_atom_link_t *link, ta_iri_t *href);

/**
 * @name: ta_atom_link::get_title
 * @type: getter
 */
const char *ta_atom_link_get_title (ta_atom_link_t *link);

/**
 * @name: ta_atom_link::set_title
 * @type: setter
 */
void ta_atom_link_set_title (ta_atom_link_t *link, const char *title);

/**
 * @name: ta_atom_link::get_rel
 * @type: getter
 */
const char *ta_atom_link_get_rel (ta_atom_link_t *link);

/**
 * @name: ta_atom_link::set_rel
 * @type: setter
 */
void ta_atom_link_set_rel (ta_atom_link_t *link, const char *rel);

/**
 * @name: ta_atom_link::get_type
 * @type: getter
 */
const char *ta_atom_link_get_type (ta_atom_link_t *link);

/**
 * @name: ta_atom_link::set_type
 * @type: setter
 */
void ta_atom_link_set_type (ta_atom_link_t *link, const char *type);

/**
 * @name: ta_atom_link::get_length
 * @type: getter
 */
const char *ta_atom_link_get_length (ta_atom_link_t *link);

/**
 * @name: ta_atom_link::set_length
 * @type: setter
 */
void ta_atom_link_set_length (ta_atom_link_t *link, const char *length);

/* -- Atom Content -- */

/**
 * @name: ta_atom_content::new
 * @type: constructor
 * @param type (optional): Mime type of the content.
 */
ta_atom_content_t *ta_atom_content_new (const char *type);

/**
 * @name: ta_atom_content::init
 * @type: initializer
 */
void ta_atom_content_init (ta_atom_content_t *content, const char *type);

/**
 * @name: ta_atom_content::to_iks
 * @type: method
 *
 * This method returns an iks representation of the content
 * instance.
 */
iks *ta_atom_content_to_iks (ta_atom_content_t *content);

/**
 * @name: ta_atom_content::to_string
 * @type: method
 *
 * This method returns an xml representation of the content
 * instance.
 */
char *ta_atom_content_to_string (ta_atom_content_t *content);

/**
 * @name: ta_atom_content::get_type
 * @type: getter
 */
const char *ta_atom_content_get_type (ta_atom_content_t *content);

/**
 * @name: ta_atom_content::set_type
 * @type: setter
 */
void ta_atom_content_set_type (ta_atom_content_t *content, const char *type);

/**
 * @name: ta_atom_content::get_src
 * @type: getter
 */
ta_iri_t *ta_atom_content_get_src (ta_atom_content_t *content);

/**
 * @name: ta_atom_content::set_src
 * @type: setter
 */
void ta_atom_content_set_src (ta_atom_content_t *content, ta_iri_t *src);

/**
 * @name: ta_atom_content::get_content
 * @type: getter
 */
const char *ta_atom_content_get_content (ta_atom_content_t *content, int *len);

/**
 * @name: ta_atom_content::set_content
 * @type: setter
 */
void ta_atom_content_set_content (ta_atom_content_t *content, const char *text,
                                  int len);

/* -- Atom Person -- */

/**
 * @name: ta_atom_person::new
 * @type: constructor
 * @param name: The person name.
 * @param email (optional): Person's email address.
 * @param iri (optional): The iri of the person's website.
 */
ta_atom_person_t *ta_atom_person_new (const char *name,
                                      const char *email,
                                      ta_iri_t *iri);

/**
 * @name: ta_atom_person::init
 * @type: initializer
 */
void ta_atom_person_init (ta_atom_person_t *person,
                          const char *name,
                          const char *email,
                          ta_iri_t *iri);

/**
 * @name: ta_atom_person::to_iks
 * @type: method
 * @param element: The element name.
 *
 * This method returns an iks representation of the person
 * instance. And the `element' parameter will be used as its
 * root node name.
 */
iks *ta_atom_person_to_iks (ta_atom_person_t *person, const char *element);

/**
 * @name: ta_atom_person::to_string
 * @type: method
 * @param element: The element name.
 *
 * This method returns an xml representation of the person
 * instance. The root node of this representation is named with the
 * `element' parameter.
 */
char *ta_atom_person_to_string (ta_atom_person_t *person, const char *element);

/**
 * @name: ta_atom_person::get_name
 * @type: getter
 */
const char *ta_atom_person_get_name (ta_atom_person_t *person);

/**
 * @name: ta_atom_person::set_name
 * @type: setter
 */
void ta_atom_person_set_name (ta_atom_person_t *person, const char *name);

/**
 * @name: ta_atom_person::get_email
 * @type: getter
 */
const char *ta_atom_person_get_email (ta_atom_person_t *person);

/**
 * @name: ta_atom_person::set_email
 * @type: setter
 */
void ta_atom_person_set_email (ta_atom_person_t *person, const char *email);

/**
 * @name: ta_atom_person::get_iri
 * @type: getter
 */
ta_iri_t *ta_atom_person_get_iri (ta_atom_person_t *person);

/**
 * @name: ta_atom_person::set_iri
 * @type: setter
 */
void ta_atom_person_set_iri (ta_atom_person_t *person, ta_iri_t *iri);

/**
 * @name: ta_atom_person::add_see
 * @type: method
 * @param element: The element that will be added to the person.
 *
 * Adds an atom simple ext element to the person instance.
 */
void ta_atom_person_add_see (ta_atom_person_t *person,
                             ta_atom_simple_element_t *element);

/**
 * @name: ta_atom_person::del_see
 * @type: method
 *
 * Removes all atom simple ext elements from the person instance.
 */
void ta_atom_person_del_see (ta_atom_person_t *person);

/**
 * @name: ta_atom_person::get_see
 * @type: method
 * @param person: A person instance.
 * @return: ta_list (ta_atom_simple_element)
 *
 * Gets all simple extension elements associated with a person
 * instance.
 **/
ta_list_t *ta_atom_person_get_see (ta_atom_person_t *person);

/* -- Atom Category -- */

/**
 * @name: ta_atom_category::new
 * @type: constructor
 * @param term: The category term.
 * @param label (optional): A human readable string containing the
 * category label.
 * @param scheme (optional): An iri pointing to a reachable category resource.
 */
ta_atom_category_t *ta_atom_category_new (const char *term, const char *label,
                                          ta_iri_t *scheme);

/**
 * @name: ta_atom_category::init
 * @type: initializer
 */
void ta_atom_category_init (ta_atom_category_t *category,
                            const char *term,
                            const char *label,
                            ta_iri_t *scheme);

/**
 * @name: ta_atom_category::to_iks
 * @type: method
 *
 * This method returns an iks representation of the category
 * instance.
 */
iks *ta_atom_category_to_iks (ta_atom_category_t *category);

/**
 * @name: ta_atom_category::to_string
 * @type: method
 *
 * This method returns an xml representation of the category
 * instance.
 */
char *ta_atom_category_to_string (ta_atom_category_t *category);

/**
 * @name: ta_atom_category::get_label
 * @type: getter
 */
const char *ta_atom_category_get_label (ta_atom_category_t  *category);

/**
 * @name: ta_atom_category::set_label
 * @type: setter
 */
void ta_atom_category_set_label (ta_atom_category_t *category,
                                 const char *label);

/**
 * @name: ta_atom_category::get_term
 * @type: getter
 */
const char *ta_atom_category_get_term (ta_atom_category_t *category);

/**
 * @name: ta_atom_category::set_term
 * @type: setter
 */
void ta_atom_category_set_term (ta_atom_category_t *category,
                                const char *term);

/**
 * @name: ta_atom_category::get_scheme
 * @type: getter
 */
ta_iri_t *ta_atom_category_get_scheme (ta_atom_category_t *category);

/**
 * @name: ta_atom_category::set_scheme
 * @type: setter
 */
void ta_atom_category_set_scheme (ta_atom_category_t *category,
                                  ta_iri_t *scheme);

/* -- Atom Thread In reply to -- */

/**
 * @name: ta_atom_in_reply_to::new
 * @type: constructor
 * @param ref: The IRI reference to the entry that is responsed to.
 */
ta_atom_in_reply_to_t *ta_atom_in_reply_to_new (ta_iri_t *ref);

/**
 * @name: ta_atom_in_reply_to::init
 * @type: initializer
 */
void ta_atom_in_reply_to_init (ta_atom_in_reply_to_t *irt,
                               ta_iri_t *ref);

/**
 * @name: ta_atom_in_reply_to::to_iks
 * @type: method
 *
 * Returns an iks representation of the in reply to instance.
 */
iks *ta_atom_in_reply_to_to_iks (ta_atom_in_reply_to_t *irt);

/**
 * @name: ta_atom_in_reply_to::to_string
 * @type: method
 *
 * Returns an xmp representation of the in reply to instance.
 */
char *ta_atom_in_reply_to_to_string (ta_atom_in_reply_to_t *irt);

/**
 * @name: ta_atom_in_reply_to::get_ref
 * @type: getter
 */
ta_iri_t *ta_atom_in_reply_to_get_ref (ta_atom_in_reply_to_t *irt);

/**
 * @name: ta_atom_in_reply_to::set_ref
 * @type: setter
 */
void ta_atom_in_reply_to_set_ref (ta_atom_in_reply_to_t *irt, ta_iri_t *ref);

/**
 * @name: ta_atom_in_reply_to::get_href
 * @type: getter
 */
ta_iri_t *ta_atom_in_reply_to_get_href (ta_atom_in_reply_to_t *irt);

/**
 * @name: ta_atom_in_reply_to::set_href
 * @type: setter
 */
void ta_atom_in_reply_to_set_href (ta_atom_in_reply_to_t *irt, ta_iri_t *href);

/**
 * @name: ta_atom_in_reply_to::get_source
 * @type: getter
 */
ta_iri_t *ta_atom_in_reply_to_get_source (ta_atom_in_reply_to_t *irt);

/**
 * @name: ta_atom_in_reply_to::set_source
 * @type: setter
 */
void ta_atom_in_reply_to_set_source (ta_atom_in_reply_to_t *irt,
                                     ta_iri_t *source);

/**
 * @name: ta_atom_in_reply_to::get_type
 * @type: getter
 */
const char *ta_atom_in_reply_to_get_type (ta_atom_in_reply_to_t *irt);

/**
 * @name: ta_atom_in_reply_to::set_type
 * @type: setter
 */
void ta_atom_in_reply_to_set_type (ta_atom_in_reply_to_t *irt,
                                   const char *type);

/* -- Atom Entry -- */

/**
 * @name: ta_atom_entry::new
 * @type: constructor
 * @param title (optional): The entry title
 */
ta_atom_entry_t *ta_atom_entry_new (const char *title);

/**
 * @name: ta_atom_entry::init
 * @type: initializer
 */
void ta_atom_entry_init (ta_atom_entry_t *entry, const char *title);

/**
 * @name: ta_atom_entry::set_from_file
 * @type: method
 * @param fname: Name of the file to be loaded
 * @raise: TA_ATOM_LOAD_ERROR, TA_ATOM_PARSING_ERROR
 *
 * Load a file to an atom entry.
 */
int ta_atom_entry_set_from_file (ta_atom_entry_t *entry, const char *fname);

/**
 * @name: ta_atom_entry::set_from_iks
 * @type: method
 * @param iks: iks object to be parsed
 * @raise: TA_ATOM_PARSING_ERROR
 *
 * Load an iks xml structure to an atom entry.
 */
int ta_atom_entry_set_from_iks (ta_atom_entry_t *entry, iks *ik);

/**
 * @name: ta_atom_entry::to_iks
 * @type: method
 *
 * Returns an iks representation of an atom entry.
 */
iks *ta_atom_entry_to_iks (ta_atom_entry_t *entry);

/**
 * @name: ta_atom_entry::to_string
 * @type: method
 *
 * Returns a xml string representation of an atom entry.
 */
char *ta_atom_entry_to_string (ta_atom_entry_t *entry);

/**
 * @name: ta_atom_entry::to_file
 * @type: method
 * @param fname: Output file name.
 *
 * Saves the xml representation of the entry instance to a file.
 */
int ta_atom_entry_to_file (ta_atom_entry_t *entry, const char *fname);

/**
 * @name: ta_atom_entry::get_error
 * @type: getter
 */
ta_error_t *ta_atom_entry_get_error (ta_atom_entry_t *entry);

/**
 * @name: ta_atom_entry::get_title
 * @type: getter
 */
const char *ta_atom_entry_get_title (ta_atom_entry_t *entry);

/**
 * @name: ta_atom_entry::set_title
 * @type: setter
 */
void ta_atom_entry_set_title (ta_atom_entry_t *entry, const char *title);

/**
 * @name: ta_atom_entry::get_id
 * @type: getter
 */
ta_iri_t *ta_atom_entry_get_id (ta_atom_entry_t *entry);

/**
 * @name: ta_atom_entry::set_id
 * @type: setter
 */
void ta_atom_entry_set_id (ta_atom_entry_t *entry, ta_iri_t *id);

/**
 * @name: ta_atom_entry::get_updated
 * @type: getter
 */
time_t ta_atom_entry_get_updated (ta_atom_entry_t *entry);

/**
 * @name: ta_atom_entry::set_updated
 * @type: setter
 */
void ta_atom_entry_set_updated (ta_atom_entry_t *entry, time_t updated);

/**
 * @name: ta_atom_entry::get_published
 * @type: getter
 */
time_t ta_atom_entry_get_published (ta_atom_entry_t *entry);

/**
 * @name: ta_atom_entry::set_published
 * @type: setter (nullable)
 */
void ta_atom_entry_set_published (ta_atom_entry_t *entry, time_t published);

/**
 * @name: ta_atom_entry::get_rights
 * @type: getter
 */
const char *ta_atom_entry_get_rights (ta_atom_entry_t *entry);

/**
 * @name: ta_atom_entry::set_rights
 * @type: setter
 */
void ta_atom_entry_set_rights (ta_atom_entry_t *entry, const char *rights);

/**
 * @name: ta_atom_entry::get_summary
 * @type: getter
 */
const char *ta_atom_entry_get_summary (ta_atom_entry_t *entry);

/**
 * @name: ta_atom_entry::set_summary
 * @type: setter
 */
void ta_atom_entry_set_summary (ta_atom_entry_t *entry, const char *summary);

/**
 * @name: ta_atom_entry::get_content
 * @type: getter
 */
ta_atom_content_t *ta_atom_entry_get_content (ta_atom_entry_t *entry);

/**
 * @name: ta_atom_entry::set_content
 * @type: setter
 */
void ta_atom_entry_set_content (ta_atom_entry_t *entry,
                                ta_atom_content_t *content);

/**
 * @name: ta_atom_entry::get_authors
 * @type: method
 * @return: ta_list (ta_atom_person)
 *
 * Returns the list of authors of an atom entry instance.
 */
ta_list_t *ta_atom_entry_get_authors (ta_atom_entry_t *entry);

/**
 * @name: ta_atom_entry::add_author
 * @type: method
 * @param author: The author instance to be added.
 *
 * Adds an author instance to the entry. After that, you should not
 * free the author instance, it will be done by `ta_atom_entry_free'.
 */
void ta_atom_entry_add_author (ta_atom_entry_t *entry,
                               ta_atom_person_t *author);

/**
 * @name: ta_atom_entry::del_authors
 * @type: method
 *
 * Remove all authors from the entry. They will be freed too.
 */
void ta_atom_entry_del_authors (ta_atom_entry_t *entry);

/**
 * @name: ta_atom_entry::get_categories
 * @type: method
 * @return: ta_list (ta_atom_category)
 *
 * Returns the list of categories of an atom entry instance.
 */
ta_list_t *ta_atom_entry_get_categories (ta_atom_entry_t *entry);

/**
 * @name: ta_atom_entry::add_category
 * @type: method
 * @param category: The category instance to be added.
 *
 * Adds an category instance to the entry. After that, you should not
 * free the category instance, it will be done by `ta_atom_entry_free'.
 */
void ta_atom_entry_add_category (ta_atom_entry_t *entry,
                                 ta_atom_category_t *category);

/**
 * @name: ta_atom_entry::del_categories
 * @type: method
 *
 * Remove all categories from the entry. They will be freed too.
 */
void ta_atom_entry_del_categories (ta_atom_entry_t *entry);

/**
 * @name: ta_atom_entry::get_links
 * @type: method
 * @return: ta_list (ta_atom_link)
 *
 * Returns the list of links of an atom entry instance.
 */
ta_list_t *ta_atom_entry_get_links (ta_atom_entry_t *entry);

/**
 * @name: ta_atom_entry::add_link
 * @type: method
 * @param link: The link instance to be added.
 *
 * Adds an link instance to the entry. After that, you should not
 * free the link instance, it will be done by `ta_atom_entry_free'.
 */
void ta_atom_entry_add_link (ta_atom_entry_t *entry, ta_atom_link_t *link);

/**
 * @name: ta_atom_entry::del_links
 * @type: method
 *
 * Remove all links from the entry. They will be freed too.
 */
void ta_atom_entry_del_links (ta_atom_entry_t *entry);

/**
 * @name: ta_atom_entry::get_see
 * @type: method
 * @return: ta_list (ta_atom_simple_element)
 *
 * Returns the list of simple elements of an atom entry instance.
 */
ta_list_t *ta_atom_entry_get_see (ta_atom_entry_t *entry);

/**
 * @name: ta_atom_entry::add_see
 * @type: method
 * @param element: The element instance to be added.
 *
 * Adds a simple element instance to the entry. After that, you should
 * not free the element instance, it will be done by
 * `ta_atom_entry_free'.
 */
void ta_atom_entry_add_see (ta_atom_entry_t *entry,
                            ta_atom_simple_element_t *element);

/**
 * @name: ta_atom_entry::del_see
 * @type: method
 *
 * Remove all simple elements from the entry. They will be freed too.
 */
void ta_atom_entry_del_see (ta_atom_entry_t *entry);

/**
 * @name: ta_atom_entry::get_inreplyto
 * @type: method
 * @return: ta_list (ta_atom_in_reply_to)
 *
 * Returns the list of <code>in_reply_to</code> elements of an atom
 * entry instance.
 */
ta_list_t *ta_atom_entry_get_inreplyto (ta_atom_entry_t *entry);

/**
 * @name: ta_atom_entry::add_inreplyto
 * @type: method
 * @param element: The in reply to instance to be added.
 *
 * Adds an <code>in_reply_to</code> instance to the entry. After that,
 * you should not free the added instance, it will be done by
 * `ta_atom_entry_free'.
 */
void ta_atom_entry_add_inreplyto (ta_atom_entry_t *entry,
                                  ta_atom_in_reply_to_t *irt);

/**
 * @name: ta_atom_entry::del_inreplyto
 * @type: method
 *
 * Remove all <em>in_reply_to</em> elements from the entry. They will
 * be freed too.
 */
void ta_atom_entry_del_inreplyto (ta_atom_entry_t *entry);

/* -- Atom Feed -- */

/**
 * @name: ta_atom_feed::new
 * @type: constructor
 * @param title (optional): The feed title
 */
ta_atom_feed_t *ta_atom_feed_new (const char *title);

/**
 * @name: ta_atom_feed::init
 * @type: initializer
 */
void ta_atom_feed_init (ta_atom_feed_t *feed, const char *title);

/**
 * @name: ta_atom_feed::set_from_file
 * @type: method
 * @param fname: Name of the file to be loaded
 * @raise: TA_ATOM_LOAD_ERROR, TA_ATOM_PARSING_ERROR
 *
 * Load a file to an atom feed.
 */
int
ta_atom_feed_set_from_file (ta_atom_feed_t  *feed,
                            const char *fname);

/**
 * @name: ta_atom_feed::set_from_iks
 * @type: method
 * @param iks: iks object to be parsed
 * @raise: TA_ATOM_PARSING_ERROR
 *
 * Load an iks xml structure to an atom feed.
 */
int
ta_atom_feed_set_from_iks (ta_atom_feed_t *feed, iks *ik);

/**
 * @name: ta_atom_feed::to_iks
 * @type: method
 *
 * Returns an iks representation of an atom feed.
 */
iks *ta_atom_feed_to_iks (ta_atom_feed_t *feed);

/**
 * @name: ta_atom_feed::to_string
 * @type: method
 *
 * Returns a xml string representation of an atom feed.
 */
char *ta_atom_feed_to_string (ta_atom_feed_t *feed);

/**
 * @name: ta_atom_feed::to_file
 * @type: method
 * @param fname: Output file name.
 *
 * Saves the xml representation of the feed instance to a file.
 */
int ta_atom_feed_to_file (ta_atom_feed_t *feed, const char *fname);

/**
 * @name: ta_atom_feed::get_error
 * @type: getter
 */
ta_error_t *ta_atom_feed_get_error (ta_atom_feed_t *feed);

/**
 * @name: ta_atom_feed::get_title
 * @type: getter
 */
const char *ta_atom_feed_get_title (ta_atom_feed_t *feed);

/**
 * @name: ta_atom_feed::set_title
 * @type: setter
 */
void ta_atom_feed_set_title (ta_atom_feed_t *feed, const char *title);

/**
 * @name: ta_atom_feed::get_id
 * @type: getter
 */
ta_iri_t *ta_atom_feed_get_id (ta_atom_feed_t *feed);

/**
 * @name: ta_atom_feed::set_id
 * @type: setter
 */
void ta_atom_feed_set_id (ta_atom_feed_t *feed, ta_iri_t *id);

/**
 * @name: ta_atom_feed::get_updated
 * @type: getter
 */
time_t ta_atom_feed_get_updated (ta_atom_feed_t *feed);

/**
 * @name: ta_atom_feed::set_updated
 * @type: setter
 */
void ta_atom_feed_set_updated (ta_atom_feed_t *feed, time_t updated);

/**
 * @name: ta_atom_feed::get_authors
 * @type: method
 * @return: ta_list (ta_atom_person)
 *
 * Returns the list of authors of an atom feed instance.
 */
ta_list_t *ta_atom_feed_get_authors (ta_atom_feed_t *feed);

/**
 * @name: ta_atom_feed::add_author
 * @type: method
 * @param author: The author instance to be added.
 *
 * Adds an author instance to the feed. After that, you should not
 * free the author instance, it will be done by `ta_atom_feed_free'.
 */
void ta_atom_feed_add_author (ta_atom_feed_t *feed, ta_atom_person_t *author);

/**
 * @name: ta_atom_feed::del_authors
 * @type: method
 *
 * Remove all authors from the feed. They will be freed too.
 */
void ta_atom_feed_del_authors (ta_atom_feed_t *feed);

/**
 * @name: ta_atom_feed::get_categories
 * @type: method
 * @return: ta_list (ta_atom_category)
 *
 * Returns the list of categories of an atom feed instance.
 */
ta_list_t *ta_atom_feed_get_categories (ta_atom_feed_t *feed);

/**
 * @name: ta_atom_feed::add_category
 * @type: method
 * @param category: The category instance to be added.
 *
 * Adds an category instance to the feed. After that, you should not
 * free the category instance, it will be done by `ta_atom_feed_free'.
 */
void ta_atom_feed_add_category (ta_atom_feed_t *feed,
                                ta_atom_category_t *category);

/**
 * @name: ta_atom_feed::del_categories
 * @type: method
 *
 * Remove all categories from the feed. They will be freed too.
 */
void ta_atom_feed_del_categories (ta_atom_feed_t *feed);

/**
 * @name: ta_atom_feed::get_links
 * @type: method
 * @return: ta_list (ta_atom_link)
 *
 * Returns the list of links of an atom feed instance.
 */
ta_list_t *ta_atom_feed_get_links (ta_atom_feed_t *feed);

/**
 * @name: ta_atom_feed::add_link
 * @type: method
 * @param link: The link instance to be added.
 *
 * Adds an link instance to the feed. After that, you should not
 * free the link instance, it will be done by `ta_atom_feed_free'.
 */
void ta_atom_feed_add_link (ta_atom_feed_t *feed, ta_atom_link_t *link);

/**
 * @name: ta_atom_feed::del_links
 * @type: method
 *
 * Remove all links from the feed. They will be freed too.
 */
void ta_atom_feed_del_links (ta_atom_feed_t *feed);

/**
 * @name: ta_atom_feed::get_entries
 * @type: method
 * @return: ta_list (ta_atom_entry)
 *
 * Returns the list of entries of an atom feed instance.
 */
ta_list_t *ta_atom_feed_get_entries (ta_atom_feed_t *feed);

/**
 * @name: ta_atom_feed::add_entry
 * @type: method
 * @param entry: The entry instance to be added.
 *
 * Adds an entry instance to the feed. After that, you should not
 * free the entry instance, it will be done by `ta_atom_feed_free'.
 */
void ta_atom_feed_add_entry (ta_atom_feed_t *feed, ta_atom_entry_t *entry);

/**
 * @name: ta_atom_feed::del_entries
 * @type: method
 *
 * Remove all entries from the feed. They will be freed too.
 */
void ta_atom_feed_del_entries (ta_atom_feed_t *feed);

#ifdef __cplusplus
}
#endif

#endif /* _TANINGIA_ATOM_H_ */