/usr/lib/emboss/include/ajdom.h is in emboss-lib 6.6.0+dfsg-6.
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 | /* @include ajdom *************************************************************
**
** AJAX Document Object Model (DOM) functions
**
** @author Copyright (C) 2006 Alan Bleasby
** @version $Revision: 1.17 $
** @modified Jul 03 2006 ajb First version
** @modified $Date: 2012/09/03 14:24:14 $ by $Author: rice $
** @@
**
** This library is free software; you can redistribute it and/or
** modify it under the terms of the GNU Lesser General Public
** License as published by the Free Software Foundation; either
** version 2.1 of the License, or (at your option) any later version.
**
** This library 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
** Lesser General Public License for more details.
**
** You should have received a copy of the GNU Lesser General Public
** License along with this library; if not, write to the Free Software
** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
** MA 02110-1301, USA.
**
******************************************************************************/
#ifndef AJDOM_H
#define AJDOM_H
/* ========================================================================= */
/* ============================= include files ============================= */
/* ========================================================================= */
#include "ajdefine.h"
#include "ajstr.h"
#include "ajlist.h"
#include "ajtable.h"
#include "ajfile.h"
AJ_BEGIN_DECLS
/* ========================================================================= */
/* =============================== constants =============================== */
/* ========================================================================= */
/* @enum AjEDomNodeType *******************************************************
**
** AJAX DOM Node Type enumeration
**
** @value ajEDomNodeTypeNULL NULL
** @value ajEDomNodeTypeElement Element
** @value ajEDomNodeTypeAttribute Attribute
** @value ajEDomNodeTypeText Text
** @value ajEDomNodeTypeCdataSection CDATA Section
** @value ajEDomNodeTypeEntityReference Entity Reference
** @value ajEDomNodeTypeEntityNode Entity
** @value ajEDomNodeTypeProcessingInstruction Processing Instruction
** @value ajEDomNodeTypeComment Comment
** @value ajEDomNodeTypeDocumentNode Document
** @value ajEDomNodeTypeDocumentType Document Type
** @value ajEDomNodeTypeDocumentFragment Document Fragment
** @value ajEDomNodeTypeNotation Notation
** @@
******************************************************************************/
typedef enum AjODomNodeType
{
ajEDomNodeTypeNULL,
ajEDomNodeTypeElement,
ajEDomNodeTypeAttribute,
ajEDomNodeTypeText,
ajEDomNodeTypeCdataSection,
ajEDomNodeTypeEntityReference,
ajEDomNodeTypeEntityNode,
ajEDomNodeTypeProcessingInstruction,
ajEDomNodeTypeComment,
ajEDomNodeTypeDocumentNode,
ajEDomNodeTypeDocumentType,
ajEDomNodeTypeDocumentFragment,
ajEDomNodeTypeNotation
} AjEDomNodeType;
#define AJDOMDESTROY 1
#define AJDOMKEEP 0
/* ========================================================================= */
/* ============================== public data ============================== */
/* ========================================================================= */
/* @data AjSDomNode ***********************************************************
**
** DOM parsing node
**
** @alias AjODomNode
** @alias AjPDomNode
** @alias AjPDomDocument
** @alias AjPDomDocumentType
** @alias AjPDomElement
** @alias AjPDomText
** @alias AjPDomCharacterData
** @alias AjPDomDocumentFragment
** @alias AjPDomCDATASection
** @alias AjPDomComment
** @alias AjPDomAttr
** @alias AjPDomEntityReference
** @alias AjPDomEntity
** @alias AjPDomPi
** @alias AjPDomNotation
**
** @attr name [AjPStr] name of node
** @attr value [AjPStr] value associated with name
** @attr parentnode [struct AjSDomNode*] ancestor
** @attr childnodes [struct AjSDomNodeList*] children
** @attr firstchild [struct AjSDomNode*] first child in list
** @attr lastchild [struct AjSDomNode*] last child in list
** @attr previoussibling [struct AjSDomNode*] last node at this level
** @attr nextsibling [struct AjSDomNode*] next node at this level
** @attr attributes [struct AjSDomNodeList*] attributes
** @attr ownerdocument [struct AjSDomNode*] document owner
** @attr sub [union] substructure depending on node type
** @attr type [AjEDomNodeType] AJAX DOM Node enumeration
** @attr subtreeModified [ajuint] internal flag
**
******************************************************************************/
typedef struct AjSDomNode
{
AjPStr name;
AjPStr value;
struct AjSDomNode *parentnode;
struct AjSDomNodeList *childnodes;
struct AjSDomNode *firstchild;
struct AjSDomNode *lastchild;
struct AjSDomNode *previoussibling;
struct AjSDomNode *nextsibling;
struct AjSDomNodeList *attributes;
struct AjSDomNode *ownerdocument;
union
{
struct
{
struct AjSDomNode *doctype;
struct AjSDomNode *documentelement;
struct AjSDomNode *document;
struct AjSDomNode *defaultview;
struct AjSDomNode *commonparent;
AjPStr version;
AjPStr encoding;
ajint standalone;
char Padding[4];
} Document;
struct
{
AjPStr name;
struct AjSDomNodeList *entities;
struct AjSDomNodeList *notations;
AjPStr publicid;
AjPStr systemid;
AjPStr internalsubset;
} DocumentType;
struct
{
AjPStr tagname;
} Element;
struct
{
AjPStr name;
AjPStr value;
struct AjSDomNode *ownerelement;
ajint specified;
char Padding[4];
} Attr;
struct
{
AjPStr data;
ajint length;
char Padding[4];
} CharacterData;
struct
{
AjPStr publicid;
AjPStr systemid;
} Notation;
struct
{
AjPStr publicid;
AjPStr systemid;
AjPStr notationname;
} Entity;
struct
{
AjPStr target;
AjPStr data;
} ProcessingInstruction;
} sub;
AjEDomNodeType type;
ajuint subtreeModified;
} AjODomNode;
#define AjPDomNode AjODomNode*
/* @data AjSDomNodeEntry ******************************************************
**
** DOM parsing node entry
**
** @alias AjODomNodeEntry
** @alias AjPDomNodeEntry
**
** @attr prev [struct AjSDomNodeEntry*] previous node
** @attr next [struct AjSDomNodeEntry*] next node
** @attr node [AjPDomNode] linked list node
**
******************************************************************************/
typedef struct AjSDomNodeEntry
{
struct AjSDomNodeEntry *prev;
struct AjSDomNodeEntry *next;
AjPDomNode node;
} AjODomNodeEntry;
#define AjPDomNodeEntry AjODomNodeEntry*
/* @data AjSDomNodeList *******************************************************
**
** DOM parsing node list
**
** @alias AjODomNodeList
** @alias AjPDomNodeList
** @alias AjPDomNodeMap
**
** @attr ownerdocument [AjPDomNode] document owner
** @attr ownerelement [AjPDomNode] element owner
** @attr first [AjPDomNodeEntry] first in list
** @attr last [AjPDomNodeEntry] last in list
** @attr length [ajint] length
** @attr filter [ajuint] filter
** @attr list [struct AjSDomNodeList*] list
** @attr table [AjPTable] fast lookup table
**
******************************************************************************/
typedef struct AjSDomNodeList
{
AjPDomNode ownerdocument;
AjPDomNode ownerelement;
AjPDomNodeEntry first;
AjPDomNodeEntry last;
ajint length;
ajuint filter;
struct AjSDomNodeList *list;
AjPTable table;
} AjODomNodeList;
#define AjPDomNodeList AjODomNodeList*
/* @data AjSDomUserdata *******************************************************
**
** DOM Userdata used when reading XML
**
** @alias AjODomUserdata
** @alias AjPDomUserdata
**
** @attr Buffer [AjPStr] Utility string
** @attr Stack [AjPList] Stack
** @attr Cdata [AjBool] Cdata
** @attr Padding [AjBool] Pad to alignment boundary
**
******************************************************************************/
typedef struct AjSDomUserdata
{
AjPStr Buffer;
AjPList Stack;
AjBool Cdata;
AjBool Padding;
} AjODomUserdata;
#define AjPDomUserdata AjODomUserdata*
#define AjPDomDocument AjPDomNode
#define AjPDomNodeMap AjPDomNodeList
#define AjPDomDocumentType AjPDomNode
#define AjPDomElement AjPDomNode
#define AjPDomText AjPDomNode
#define AjPDomCharacterData AjPDomNode
#define AjPDomDocumentFragment AjPDomNode
#define AjPDomCDATASection AjPDomNode
#define AjPDomComment AjPDomNode
#define AjPDomAttr AjPDomNode
#define AjPDomEntityReference AjPDomNode
#define AjPDomEntity AjPDomNode
#define AjPDomPi AjPDomNode
#define AjPDomNotation AjPDomNode
/* ========================================================================= */
/* =========================== public functions ============================ */
/* ========================================================================= */
/*
** Prototype definitions
*/
AjPDomNode ajDomDocumentCreateNode(AjPDomDocument doc,
AjEDomNodeType nodetype);
AjPDomDocumentType ajDomImplementationCreateDocumentType(const AjPStr qualname,
const AjPStr publicid,
const AjPStr systemid);
AjPDomDocumentType ajDomImplementationCreateDocumentTypeC(const char *qualname,
const char *publicid,
const char *systemid);
AjPDomDocument ajDomImplementationCreateDocument(const AjPStr uri,
const AjPStr qualname,
AjPDomDocumentType doctype);
AjPDomDocument ajDomImplementationCreateDocumentC(const char *uri,
const char *qualname,
AjPDomDocumentType doctype);
ajint ajDomNodeListGetLen(const AjPDomNodeList list);
AjPDomNodeEntry ajDomNodeListAppend(AjPDomNodeList list,
AjPDomNode child);
AjPStr ajDomElementGetAttribute(const AjPDomElement element,
const AjPStr name);
AjPStr ajDomElementGetAttributeC(const AjPDomElement element,
const char *name);
void ajDomElementSetAttribute(const AjPDomElement element,
const AjPStr name,
const AjPStr value);
void ajDomElementSetAttributeC(const AjPDomElement element,
const char *name,
const char *value);
void ajDomElementRemoveAttribute(AjPDomElement element,
const AjPStr name);
void ajDomElementRemoveAttributeC(AjPDomElement element,
const char *name);
AjPDomNode ajDomElementRemoveAttributeNode(AjPDomElement element,
AjPDomNode oldattr);
AjPDomNode ajDomElementGetAttributeNode(const AjPDomElement element,
const AjPStr name);
AjPDomNode ajDomElementGetAttributeNodeC(const AjPDomElement element,
const char *name);
AjPDomNode ajDomElementSetAttributeNode(AjPDomElement element,
AjPDomNode newattr);
AjPDomNodeList ajDomElementGetElementsByTagName(AjPDomElement element,
const AjPStr name);
AjPDomNodeList ajDomElementGetElementsByTagNameC(AjPDomElement element,
const char *name);
void ajDomElementNormalise(AjPDomElement element);
AjPStr ajDomCharacterDataSubstringData(const AjPDomCharacterData data,
ajint offset, ajint count);
void ajDomCharacterDataAppendData(AjPDomCharacterData data,
const AjPStr arg);
void ajDomCharacterDataAppendDataC(AjPDomCharacterData data,
const char *arg);
void ajDomCharacterDataInsertData(AjPDomCharacterData data,
ajint offset, const AjPStr arg);
void ajDomCharacterDataInsertDataC(AjPDomCharacterData data,
ajint offset, const char *arg);
void ajDomCharacterDataDeleteData(AjPDomCharacterData data,
ajint offset, ajint count);
void ajDomCharacterDataReplaceData(AjPDomCharacterData data,
ajint offset, ajint count,
const AjPStr arg);
void ajDomCharacterDataReplaceDataC(AjPDomCharacterData data,
ajint offset, ajint count,
const char *arg);
ajint ajDomCharacterDataGetLength(const AjPDomCharacterData data);
AjPDomText ajDomTextSplitText(AjPDomText text, ajint offset);
AjPDomElement ajDomDocumentCreateElement(AjPDomDocument doc,
const AjPStr tagname);
AjPDomElement ajDomDocumentCreateElementC(AjPDomDocument doc,
const char *tagname);
AjPDomDocumentFragment ajDomDocumentCreateDocumentFragment(AjPDomDocument doc);
AjPDomText ajDomDocumentCreateTextNode(AjPDomDocument doc,
const AjPStr data);
AjPDomText ajDomDocumentCreateTextNodeC(AjPDomDocument doc,
const char *data);
AjPDomComment ajDomDocumentCreateComment(AjPDomDocument doc,
const AjPStr data);
AjPDomComment ajDomDocumentCreateCommentC(AjPDomDocument doc,
const char *data);
AjPDomCDATASection ajDomDocumentCreateCDATASection(AjPDomDocument doc,
const AjPStr data);
AjPDomCDATASection ajDomDocumentCreateCDATASectionC(AjPDomDocument doc,
const char *data);
AjPDomAttr ajDomDocumentCreateAttribute(AjPDomDocument doc,
const AjPStr name);
AjPDomAttr ajDomDocumentCreateAttributeC(AjPDomDocument doc,
const char *name);
AjPDomEntityReference ajDomDocumentCreateEntityReference(AjPDomDocument doc,
const AjPStr name);
AjPDomEntityReference ajDomDocumentCreateEntityReferenceC(AjPDomDocument doc,
const char *name);
AjPDomPi ajDomDocumentCreateProcessingInstruction(AjPDomDocument doc,
const AjPStr target,
const AjPStr data);
AjPDomPi ajDomDocumentCreateProcessingInstructionC(AjPDomDocument doc,
const char *target,
const char *data);
AjPDomNodeList ajDomDocumentGetElementsByTagName(AjPDomDocument doc,
const AjPStr name);
AjPDomNodeList ajDomDocumentGetElementsByTagNameC(AjPDomDocument doc,
const char *name);
AjPDomDocumentType ajDomDocumentGetDoctype(const AjPDomDocument doc);
AjPDomElement ajDomDocumentGetDocumentElement(const AjPDomDocument doc);
AjPDomNode ajDomNodeAppendChild(AjPDomNode node,
AjPDomNode extrachild);
AjPDomNode ajDomNodeInsertBefore(AjPDomNode node, AjPDomNode newchild,
AjPDomNode refchild);
AjPDomNode ajDomRemoveChild(AjPDomNode node, AjPDomNode child);
void ajDomDocumentDestroyNode(AjPDomDocument doc,
AjPDomNode *Pnode);
void ajDomDocumentDestroyNodeList(AjPDomDocument doc,
AjPDomNodeList *Plist,
AjBool donodes);
AjPDomNode ajDomNodeReplaceChild(AjPDomNode node, AjPDomNode newchild,
AjPDomNode oldchild);
AjPDomNode ajDomNodeCloneNode(AjPDomNode node, AjBool deep);
AjPDomNode ajDomNodeListItem(const AjPDomNodeList list, ajint indexnum);
AjBool ajDomNodeListExists(AjPDomNodeList list,
const AjPDomNode child);
AjPDomNodeEntry ajDomNodeListRemove(AjPDomNodeList list, AjPDomNode child);
AjPDomNodeList ajDomCreateNodeList(AjPDomDocument doc);
AjPDomNode ajDomNodeMapGetItem(const AjPDomNodeMap map,
const AjPStr name);
AjPDomNode ajDomNodeMapGetItemC(const AjPDomNodeMap map,
const char *name);
AjPDomNode ajDomNodeMapSetItem(AjPDomNodeMap map, AjPDomNode arg);
AjPDomNode ajDomNodeMapRemoveItem(AjPDomNodeMap map,
const AjPStr name);
AjPDomNode ajDomNodeMapRemoveItemC(AjPDomNodeMap map,
const char *name);
AjPDomNode ajDomNodeMapItem(const AjPDomNodeMap map, ajint indexnum);
AjPDomNodeEntry ajDomNodeListInsert(AjPDomNodeList list, AjPDomNode newchild,
AjPDomNode refchild);
AjPDomNodeEntry ajDomNodeListReplace(AjPDomNodeList list, AjPDomNode newchild,
AjPDomNode oldchild);
AjBool ajDomNodeHasChildNodes(const AjPDomNode node);
ajint ajDomWrite(const AjPDomDocument node, AjPFile outf);
ajint ajDomWriteIndent(const AjPDomDocument node, AjPFile outf,
ajint indent);
void ajDomPrintNode(const AjPDomNode node, ajint indent);
void ajDomPrintNode2(const AjPDomNode node);
void ajDomNodePrintNode(const AjPDomNode node);
ajint ajDomReadFp(AjPDomDocument node, FILE *stream);
ajint ajDomReadFilebuff(AjPDomDocument node, AjPFilebuff buff);
ajint ajDomReadFilebuffText(AjPDomDocument node, AjPFilebuff buff,
AjBool dotext, AjPStr *Pstr);
ajint ajDomReadString(AjPDomDocument node, AjPStr str);
AjPStr ajDomTextGetText(AjPDomText text);
AjPStr ajDomElementGetText(AjPDomElement element);
AjPDomElement ajDomElementGetNthChildByTagNameC(AjPDomDocument doc,
AjPDomElement element,
const char *name,
ajint n);
AjPDomElement ajDomElementGetFirstChildByTagNameC(AjPDomDocument doc,
AjPDomElement element,
const char *name);
/*
** End of prototype definitions
*/
AJ_END_DECLS
#endif /* !AJDOM_H */
|