This file is indexed.

/usr/lib/emboss/include/ajstr.h is in emboss-lib 6.3.1-6ubuntu3.

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
#ifdef __cplusplus
extern "C"
{
#endif

#ifndef ajstr_h
#define ajstr_h

#include "ajdefine.h"




/* @data AjPStr ***************************************************************
**
** Ajax string object.
**
** Holds a null terminated character string with additional data.
** The length is known and held internally.
** The reserved memory size is known and held internally.
** The reference count is known and held internally.
** New pointers can refer to the same string without needing
** to duplicate the character data.
**
** If a string has multiple references it cannot be changed. Any
** instance to be changed is first copied to a new string. This
** means that any function which can change the character data must
** pass a pointer to the string so that the string can be moved.
**
** A default null string is provided. New strings are by default
** implemented as pointers to this with increased reference counters.
**
** AjPStr is implemented as a pointer to a C data structure.
**
** @alias AjPPStr
** @alias AjSStr
** @alias AjOStr
** @iterator AjIStr
**
** @attr Res [ajuint] Reserved bytes (usable for expanding in place)
** @attr Len [ajuint] Length of current string, excluding NULL at end
** @attr Ptr [char*] The string, as a NULL-terminated C string.
** @attr Use [ajuint] Use count: 1 for single reference, more if several
**                   pointers share the same string.
**                   Must drop to 0 before deleting. Modifying means making
**                   a new string if not 1.
** @attr Padding [ajint] Padding to alignment boundary
** @@
******************************************************************************/

typedef struct AjSStr {
  ajuint Res;
  ajuint Len;
  char *Ptr;
  ajuint Use;
  ajint Padding;
} AjOStr;
#define AjPStr AjOStr*
typedef AjPStr* AjPPStr;




/* @data AjIStr ***************************************************************
**
** String iterator, used to test iterator functionality.
**
** @alias AjSStrIter
** @alias AjOStrIter
**
** @new ajStrIter Creates and initialises an iterator for a string
**
** @delete ajStrIterFree Destructor for a string iterator
**
** @modify ajStrIterNext Steps to the next iteration
**
** @modify ajStrIterBegin returns result of first iteration
** @modify ajStrIterNext Steps to the next iteration
** @modify ajStrIterBackNext Step to previous character in string iterator.
** @modify ajStrIterEnd   returns result of last iteration
** @cast ajStrIterDone  Tests whether iteration is complete
** @cast ajStrIterGetC  returns the character* from the iterator
** @cast ajStrIterGetK  returns the character from the iterator
**
** @attr Start [char*] Starting string pointer
** @attr End [char*] Final string pointer (NULL character position)
** @attr Ptr [char*] Current string pointer
** @@
******************************************************************************/

typedef struct AjSStrIter {
  char *Start;
  char *End;
  char *Ptr;
} AjOStrIter;

#define AjIStr  AjOStrIter*




/* @data AjPStrTok ************************************************************
**
** String token parser object for the string parsing functions. These normally
** require a set of characters to be skipped, but some functions use a string
** delimiter instead.
**
** @attr String [AjPStr] String
** @attr Delim [AjPStr] Delimiter set for ajStrToken
** @attr Pos [ajuint] Position in string
** @attr Padding [char[4]] Padding to alignment boundary
**
** @new ajStrTokenInit Generates a string token parser object
** @delete ajStrTokenClear Destroys a string token parser
** @@
******************************************************************************/

typedef struct AjSStrTok {
  AjPStr String;
  AjPStr Delim;
  ajuint Pos;
  char Padding[4];
} AjOStrTok;

#define AjPStrTok AjOStrTok*




/* ========================================================================= */
/* ========================= All functions by section ====================== */
/* ========================================================================= */

/*
** Prototype definitions
*/

/* === C character string === */

/* constructors */

char*      ajCharNewC (const char* txt);
char*      ajCharNewS (const AjPStr thys);
char*      ajCharNewRes(ajuint size);
char*      ajCharNewResC(const char* txt, ajuint size);
char*      ajCharNewResS(const AjPStr str, ajuint size);
char*      ajCharNewResLenC(const char* txt, ajuint size, ajuint len);
char*      ajCharNull (void);

/* destructors */

void       ajCharDel(char** Ptxt);

/* formatting */

AjBool     ajCharFmtLower (char *txt);
AjBool     ajCharFmtUpper (char *txt);

/* comparison */

AjBool     ajCharMatchC(const char* txt1, const char* txt2);
AjBool     ajCharMatchCaseC(const char* txt1, const char* txt2);
AjBool     ajCharMatchWildC(const char* txt1, const char* txt2);
AjBool     ajCharMatchWildS(const char* txt, const AjPStr str);
AjBool     ajCharMatchWildCaseC(const char* txt1, const char* txt2);
AjBool     ajCharMatchWildCaseS(const char* txt, const AjPStr str);
AjBool     ajCharMatchWildNextC(const char* txt1, const char* txt2);
AjBool     ajCharMatchWildWordC(const char* str, const char* txt);
AjBool     ajCharMatchWildNextCaseC(const char* txt1, const char* txt2);
AjBool     ajCharMatchWildWordCaseC(const char* str, const char* txt);
AjBool     ajCharPrefixC(const char* txt, const char* pref);
AjBool     ajCharPrefixS(const char* txt, const AjPStr pref);
AjBool     ajCharPrefixCaseC(const char* txt, const char* pref);
AjBool     ajCharPrefixCaseS(const char* txt, const AjPStr pref);
AjBool     ajCharSuffixC(const char* txt, const char* suff);
AjBool     ajCharSuffixS(const char* txt, const AjPStr suff);
AjBool     ajCharSuffixCaseC(const char* txt, const char* suff);
AjBool     ajCharSuffixCaseS(const char* txt, const AjPStr suff);

/* comparison (sorting) */


int        ajCharCmpCase(const char* txt1, const char* txt2);
int        ajCharCmpCaseLen(const char* txt1, const char* txt2, ajuint len);
ajint      ajCharCmpWild(const char* txt1, const char* txt2);
ajint      ajCharCmpWildCase(const char* txt1, const char* txt2);

/* parsing */

AjPStr     ajCharParseC (const char* txt, const char* delim);

/* === AjPStr string === */

/* constructors */

AjPStr     ajStrNew (void);
AjPStr     ajStrNewC (const char *txt);
AjPStr     ajStrNewK (char ch);
AjPStr     ajStrNewS (const AjPStr str);
AjPStr     ajStrNewRef(AjPStr str);
AjPStr     ajStrNewRes(ajuint size);
AjPStr     ajStrNewResC (const char *txt, ajuint size);
AjPStr     ajStrNewResS (const AjPStr str, ajuint size);
AjPStr     ajStrNewResLenC (const char *txt, ajuint size, ajuint len);

const AjPStr ajStrConstEmpty(void);
const AjPStr ajStrConstS(const AjPStr);

/* destructors */

void       ajStrDel (AjPStr* Pstr);
void       ajStrDelarray(AjPStr** PPstr);
AjBool     ajStrDelStatic(AjPStr* Pstr);

#define MAJSTRDEL(Pstr) if(*Pstr) \
    {if((*Pstr)->Use <= 1) ajStrDel(Pstr);	\
  else {--(*Pstr)->Use;(*Pstr) = NULL;}}

/* assignment */

AjBool     ajStrAssignC(AjPStr* Pstr, const char* txt);
AjBool     ajStrAssignK(AjPStr* Pstr, char chr);
AjBool     ajStrAssignS(AjPStr* Pstr, const AjPStr str);
AjBool     ajStrAssignClear(AjPStr* Pstr);
AjBool     ajStrAssignEmptyC(AjPStr* pthis, const char* str);
AjBool     ajStrAssignEmptyS(AjPStr* pthis, const AjPStr str);
AjBool     ajStrAssignLenC(AjPStr* Pstr, const char* txt, ajuint ilen);
AjBool     ajStrAssignRef(AjPStr* Pstr, AjPStr refstr);
AjBool     ajStrAssignResC(AjPStr* Pstr, ajuint size, const char* txt);
AjBool     ajStrAssignResS(AjPStr* Pstr, ajuint i, const AjPStr str);
AjBool     ajStrAssignSubC(AjPStr* Pstr, const char* txt,
			   ajint pos1, ajint pos2);
AjBool     ajStrAssignSubS(AjPStr* Pstr, const AjPStr str,
			  ajint pos1, ajint pos2);

#define MAJSTRASSIGNCLEAR(Pstr) if((*Pstr) && (*Pstr)->Use == 1)        \
    {(*Pstr)->Ptr[0]='\0';(*Pstr)->Len=0;} else {ajStrAssignClear(Pstr);}
    
    
/* combination */

AjBool     ajStrAppendC(AjPStr* Pstr, const char* txt);
AjBool     ajStrAppendK(AjPStr* Pstr, char chr);
AjBool     ajStrAppendS(AjPStr* Pstr, const AjPStr str);
AjBool     ajStrAppendCountK(AjPStr* Pstr, char chr, ajuint num);
AjBool     ajStrAppendLenC(AjPStr* Pstr, const char* txt, ajuint len);
AjBool     ajStrAppendSubC(AjPStr* Pstr, const char* txt,
			   ajint pos1, ajint pos2);
AjBool     ajStrAppendSubS(AjPStr* Pstr, const AjPStr str,
			   ajint pos1, ajint pos2);

AjBool     ajStrInsertC (AjPStr* pthis, ajint pos, const char* str);
AjBool     ajStrInsertK (AjPStr* pthis, ajint begin, char insert);
AjBool     ajStrInsertS  (AjPStr* pthis, ajint pos, const AjPStr str);

AjBool     ajStrJoinC (AjPStr* Pstr, ajint pos1,
		       const char* txt, ajint pos2);
AjBool     ajStrJoinS (AjPStr* Pstr, ajint pos,
		       const AjPStr str, ajint posb);
AjBool     ajStrMaskIdent(AjPStr* Pstr, const AjPStr str, char maskchar);
AjBool     ajStrMaskRange(AjPStr* Pstr, ajint begin, ajint end,
                          char maskchar);
AjBool     ajStrPasteS( AjPStr* Pstr, ajint pos, const AjPStr str);
AjBool     ajStrPasteCountK(AjPStr* Pstr, ajint pos, char chr,
		      ajuint num);
AjBool     ajStrPasteMaxC (AjPStr* Pstr, ajint pos, const char* txt,
		     ajuint n);
AjBool     ajStrPasteMaxS( AjPStr* Pstr, ajint pos, const AjPStr str,
		       ajuint n);

/* cut */

AjBool     ajStrCutComments(AjPStr* Pstr);
AjBool     ajStrCutCommentsRestpos(AjPStr* Pstr, AjPStr* Prest, ajuint* pos);
AjBool     ajStrCutCommentsStart(AjPStr* Pstr);
AjBool     ajStrCutEnd(AjPStr* Pstr, ajuint len);
AjBool     ajStrCutRange(AjPStr* Pstr, ajint pos1, ajint pos2);
AjBool     ajStrCutStart(AjPStr* Pstr, ajuint len);
AjBool     ajStrKeepRange(AjPStr* Pstr, ajint pos1, ajint pos2);
AjBool     ajStrKeepSetC(AjPStr* Pstr, const char* txt);
AjBool     ajStrKeepSetS(AjPStr* Pstr, const AjPStr str);
AjBool     ajStrKeepSetAlpha(AjPStr* Pstr);
AjBool     ajStrKeepSetAlphaC(AjPStr* Pstr, const char* txt);
AjBool     ajStrKeepSetAlphaS(AjPStr* Pstr, const AjPStr str);
AjBool     ajStrKeepSetAlphaRest(AjPStr* Pstr, AjPStr* Prest);
AjBool     ajStrKeepSetAlphaRestC(AjPStr* Pstr, const char* txt,
				  AjPStr* Prest);
AjBool     ajStrKeepSetAlphaRestS(AjPStr* Pstr, const AjPStr str,
				  AjPStr* Prest);
AjBool     ajStrKeepSetAscii(AjPStr* Pstr, int minchar, int maxchar);
AjBool     ajStrQuoteStrip(AjPStr *Pstr);
AjBool     ajStrQuoteStripAll(AjPStr *Pstr);
AjBool     ajStrRemoveDupchar(AjPStr* Pstr);
AjBool     ajStrRemoveGap(AjPStr* thys);
AjBool     ajStrRemoveGapF(AjPStr* thys, float *Pfloat);
AjBool     ajStrRemoveHtml(AjPStr* pthis);
AjBool     ajStrRemoveLastNewline(AjPStr* Pstr);
AjBool     ajStrRemoveSetC(AjPStr* Pstr, const char *txt);
AjBool     ajStrRemoveWhite(AjPStr* Pstr);
AjBool     ajStrRemoveWhiteExcess(AjPStr* Pstr);
AjBool     ajStrRemoveWhiteSpaces(AjPStr* Pstr);
AjBool     ajStrRemoveWild(AjPStr* Pstr);
AjBool     ajStrTrimC (AjPStr* pthis, const char* txt);
AjBool     ajStrTrimEndC (AjPStr* Pstr, const char* txt);
AjBool     ajStrTrimStartC (AjPStr* Pstr, const char* txt);
AjBool     ajStrTrimWhite(AjPStr* Pstr);
AjBool     ajStrTrimWhiteEnd(AjPStr* Pstr);
AjBool     ajStrTrimWhiteStart(AjPStr* Pstr);
AjBool     ajStrTruncateLen(AjPStr* Pstr, ajuint len);
AjBool     ajStrTruncatePos(AjPStr* Pstr, ajint pos);

/* substitution */

AjBool     ajStrExchangeCC(AjPStr* Pstr, const char* txt, const char* txtnew);
AjBool     ajStrExchangeCS(AjPStr* Pstr, const char* txt,
			   const AjPStr strnew);
AjBool     ajStrExchangeKK(AjPStr* Pstr, char chr, char chrnew);
AjBool     ajStrExchangeSC(AjPStr* Pstr, const AjPStr str,
			   const char* txtnew);
AjBool     ajStrExchangeSS(AjPStr* Pstr, const AjPStr str,
			   const AjPStr strnew);
AjBool     ajStrExchangePosCC(AjPStr* Pstr, ajint ipos, const char* txt,
			      const char* txtnew);
AjBool     ajStrExchangeSetCC(AjPStr* Pstr, const char* txt,
			      const char* newc);
AjBool     ajStrExchangeSetSS(AjPStr* Pstr, const AjPStr str,
			    const AjPStr strnew);
AjBool     ajStrExchangeSetRestCK(AjPStr* Pstr, const char* txt,
				  char chr);
AjBool     ajStrExchangeSetRestSK(AjPStr* Pstr, const AjPStr str,
				  char chr);
AjBool     ajStrRandom(AjPStr *s);
AjBool     ajStrReverse(AjPStr* Pstr);

/* query */

ajuint     ajStrCalcCountC(const AjPStr str, const char* txt);
ajuint     ajStrCalcCountK(const AjPStr str, char chr);
AjBool     ajStrHasParentheses(const AjPStr str);
AjBool     ajStrIsAlnum (const AjPStr str);
AjBool     ajStrIsAlpha (const AjPStr str);
AjBool     ajStrIsBool (const AjPStr str);
AjBool     ajStrIsCharsetC(const AjPStr str, const char* txt);
AjBool     ajStrIsCharsetS(const AjPStr str, const AjPStr str2);
AjBool     ajStrIsCharsetCaseC(const AjPStr str, const char* txt);
AjBool     ajStrIsCharsetCaseS(const AjPStr str, const AjPStr str2);
AjBool     ajStrIsDouble (const AjPStr str);
AjBool     ajStrIsFloat (const AjPStr str);
AjBool     ajStrIsHex (const AjPStr str);
AjBool     ajStrIsInt (const AjPStr str);
AjBool     ajStrIsLong (const AjPStr str);
AjBool     ajStrIsLower (const AjPStr str);
AjBool     ajStrIsNum (const AjPStr str);
AjBool     ajStrIsUpper (const AjPStr str);
AjBool     ajStrIsWild (const AjPStr str);
AjBool     ajStrIsWhite (const AjPStr str);
AjBool     ajStrIsWord (const AjPStr str);
AjBool     ajStrWhole (const AjPStr str, ajint pos1, ajint pos2);

/* element retrieval */

char       ajStrGetAsciiCommon(const AjPStr str);
char       ajStrGetAsciiHigh(const AjPStr str);
char       ajStrGetAsciiLow(const AjPStr str);
char       ajStrGetCharFirst(const AjPStr str);
char       ajStrGetCharLast(const AjPStr str);
char       ajStrGetCharPos(const AjPStr str, ajint pos);
ajuint     ajStrGetLen(const AjPStr str);
#define    MAJSTRGETLEN(str) ((str) ? (str)->Len : 0)
const char* ajStrGetPtr(const AjPStr str);
#define    MAJSTRGETPTR(str) ((str) ? (str)->Ptr : ajCharNull())
ajuint      ajStrGetRes(const AjPStr str);
#define    MAJSTRGETRES(str) ((str) ? (str)->Res : 0)
ajuint     ajStrGetRoom(const AjPStr str);
ajuint     ajStrGetUse(const AjPStr str);
#define    MAJSTRGETUSE(str) ((str) ? (str)->Use : 0)
AjBool     ajStrGetValid (const AjPStr thys);

/* modifiable string retrieval */

char*      ajStrGetuniquePtr(AjPStr *Pstr);
#define MAJSTRGETUNIQUESTR(Pstr) (((*Pstr)->Use > 1) ? \
				  ajStrGetuniqueStr(Pstr) : *Pstr) 
AjPStr     ajStrGetuniqueStr(AjPStr *Pstr);

/* element assignment */

AjBool     ajStrSetClear (AjPStr* pthis);
AjBool     ajStrSetRes(AjPStr* Pstr, ajuint size);
AjBool     ajStrSetResRound(AjPStr* Pstr, ajuint size);
AjBool     ajStrSetValid(AjPStr *Pstr);
AjBool     ajStrSetValidLen(AjPStr* Pstr, ajuint len);

#define MAJSTRSETVALIDLEN(Pstr,len) (*Pstr)->Len = len

/* string to datatype conversion functions */

AjBool     ajStrToBool (const AjPStr str, AjBool* Pval);
AjBool     ajStrToDouble (const AjPStr str, double* Pval);
AjBool     ajStrToFloat (const AjPStr str, float* Pval);
AjBool     ajStrToHex (const AjPStr str, ajint* Pval);
AjBool     ajStrToInt (const AjPStr str, ajint* Pval);
AjBool     ajStrToLong (const AjPStr thys, ajlong* result);
AjBool     ajStrToUint (const AjPStr str, ajuint* Pval);
AjBool     ajStrToUlong(const AjPStr str, ajulong* Pval);
    
/* datatype to string conversion functions */

AjBool     ajStrFromBool (AjPStr* Pstr, AjBool val);
AjBool     ajStrFromDouble (AjPStr* Pstr, double val, ajint precision);
AjBool     ajStrFromDoubleExp (AjPStr* Pstr, double val, ajint precision);
AjBool     ajStrFromFloat (AjPStr* Pstr, float val, ajint precision);
AjBool     ajStrFromInt (AjPStr* Pstr, ajint val);
AjBool     ajStrFromLong (AjPStr* Pstr, ajlong val);
AjBool     ajStrFromUint (AjPStr* Pstr, ajuint val);

/* formatting */

AjBool     ajStrFmtBlock(AjPStr* pthis, ajuint blksize);
AjBool     ajStrFmtLower(AjPStr* Pstr);
AjBool     ajStrFmtLowerSub(AjPStr* Pstr, ajint pos1, ajint pos2);
AjBool     ajStrFmtQuote(AjPStr* Pstr);
AjBool     ajStrFmtTitle(AjPStr* Pstr);
AjBool     ajStrFmtUpper(AjPStr* Pstr);
AjBool     ajStrFmtUpperSub(AjPStr* Pstr, ajint pos1, ajint pos2);
AjBool     ajStrFmtWrap(AjPStr* Pstr, ajuint width );
AjBool     ajStrFmtWrapAt(AjPStr* Pstr, ajuint width, char ch);
AjBool     ajStrFmtWrapLeft(AjPStr* Pstr, ajuint width,
			    ajuint margin, ajuint indent);

/* comparison */

AjBool     ajStrMatchC      (const AjPStr thys, const char* txt);
AjBool     ajStrMatchS      (const AjPStr thys, const AjPStr str);
AjBool     ajStrMatchCaseC  (const AjPStr thys, const char* text);
AjBool     ajStrMatchCaseS  (const AjPStr thys, const AjPStr str);
AjBool     ajStrMatchWildC  (const AjPStr thys, const char* text);
AjBool     ajStrMatchWildS  (const AjPStr thys, const AjPStr wild);
AjBool     ajStrMatchWildCaseC  (const AjPStr thys, const char* text);
AjBool     ajStrMatchWildCaseS  (const AjPStr thys, const AjPStr wild);
AjBool     ajStrMatchWildWordC (const AjPStr str, const char* text);
AjBool     ajStrMatchWildWordS (const AjPStr str, const AjPStr text);
AjBool     ajStrMatchWildWordCaseC (const AjPStr str, const char* text);
AjBool     ajStrMatchWildWordCaseS (const AjPStr str, const AjPStr text);
AjBool     ajStrMatchWordAllS(const AjPStr str, const AjPStr str2);
AjBool     ajStrMatchWordOneS(const AjPStr str, const AjPStr str2);
AjBool     ajStrPrefixC(const AjPStr str, const char* txt2);
AjBool     ajStrPrefixS(const AjPStr str, const AjPStr str2);
AjBool     ajStrPrefixCaseC (const AjPStr str, const char* pref);
AjBool     ajStrPrefixCaseS (const AjPStr str, const AjPStr pref);
AjBool     ajStrSuffixC (const AjPStr thys, const char* suff);
AjBool     ajStrSuffixS (const AjPStr thys, const AjPStr suff);
AjBool     ajStrSuffixCaseC (const AjPStr str, const char* pref);
AjBool     ajStrSuffixCaseS (const AjPStr str, const AjPStr pref);

/* comparison (sorting) */

#define MAJSTRCMPC(str1,txt2) strcmp((str1)->Ptr, txt2)
#define MAJSTRCMPS(str1,str2) strcmp((str1)->Ptr, (str2)->Ptr)

int        ajStrCmpC(const AjPStr thys, const char *text);
int        ajStrCmpS(const AjPStr str, const AjPStr str2);
int        ajStrCmpCaseS (const AjPStr str1, const AjPStr str2);
ajint      ajStrCmpLenC (const AjPStr thys, const char *text, ajuint len);
int        ajStrCmpLenS(const AjPStr str, const AjPStr str2, ajuint len);
int        ajStrCmpWildC (const AjPStr thys, const char* text);
int        ajStrCmpWildS (const AjPStr thys, const AjPStr str);
int        ajStrCmpWildCaseC (const AjPStr thys, const char* text);
int        ajStrCmpWildCaseS (const AjPStr thys, const AjPStr str);
int        ajStrVcmp  (const void* str1, const void* str2);

/* comparison (search) */

ajint      ajStrFindC  (const AjPStr str, const char* txt);
ajint      ajStrFindS (const AjPStr str, const AjPStr str2);
ajint      ajStrFindAnyC  (const AjPStr str, const char* txt);
ajint      ajStrFindAnyK(const AjPStr str, char chr);
ajint      ajStrFindAnyS (const AjPStr str, const AjPStr str2);
ajint      ajStrFindCaseC (const AjPStr str, const char* txt);
ajint      ajStrFindCaseS (const AjPStr str, const AjPStr str2);
ajint      ajStrFindNextC  (const AjPStr str, ajint pos, const char* txt);
ajint      ajStrFindNextK(const AjPStr str, ajint pos, char chr);
ajint      ajStrFindNextS (const AjPStr str, ajint pos, const AjPStr str2);
ajint      ajStrFindRestC (const AjPStr str, const char* txt);
ajint      ajStrFindRestS (const AjPStr str, const AjPStr str2);
ajint      ajStrFindRestCaseC (const AjPStr str, const char* txt);
ajint      ajStrFindRestCaseS (const AjPStr str, const AjPStr str2);
ajint      ajStrFindlastC(const AjPStr str, const char* txt);
ajint      ajStrFindlastK(const AjPStr str, char chr);
ajint      ajStrFindlastS(const AjPStr str, const AjPStr str2);

/* parsing */

AjBool     ajStrExtractFirst(const AjPStr str, AjPStr* Prest, AjPStr* Pword);
AjBool     ajStrExtractWord(const AjPStr str, AjPStr* Prest, AjPStr* Pword);
const AjPStr ajStrParseC(const AjPStr str, const char* txtdelim);
ajuint     ajStrParseCount(const AjPStr line);
ajuint     ajStrParseCountC(const AjPStr line, const char *txtdelim);
ajuint     ajStrParseCountS(const AjPStr line, const AjPStr strdelim);
ajuint     ajStrParseCountMultiC(const AjPStr str, const char *txtdelim);
ajuint     ajStrParseSplit(const AjPStr str, AjPStr **PPstr);
const AjPStr ajStrParseWhite(const AjPStr str);

/* debug */

void       ajStrProbe (AjPStr const * Pstr);
void       ajStrStat (const char* title);
void       ajStrTrace (const AjPStr thys);
void       ajStrTraceFull (const AjPStr thys);
void       ajStrTraceTitle (const AjPStr thys, const char* title);

/* exit */

void       ajStrExit (void);

/* === string iterator === */

/* constructors */

AjIStr     ajStrIterNew (const AjPStr thys);
AjIStr     ajStrIterNewBack (const AjPStr thys);

/* destructors */

void       ajStrIterDel (AjIStr *iter);

/* tests */

AjBool     ajStrIterDone(const AjIStr iter);
AjBool     ajStrIterDoneBack(const AjIStr iter);

/* resets */

void       ajStrIterBegin(AjIStr iter);
void       ajStrIterEnd(AjIStr iter);

/* attributes */

const char* ajStrIterGetC(const AjIStr iter);
char       ajStrIterGetK(const AjIStr iter);

/* modifiers */

void       ajStrIterPutK(AjIStr iter, char chr);

/* stepping */

AjIStr     ajStrIterNext (AjIStr iter);
AjIStr     ajStrIterNextBack (AjIStr iter);

/* === string token parser === */

/* constructors */

AjPStrTok  ajStrTokenNewC(const AjPStr str, const char* txtdelim);
AjPStrTok  ajStrTokenNewS(const AjPStr str, const AjPStr strdelim);

/* destructors */

void       ajStrTokenDel(AjPStrTok* Ptoken);

/* assignment */

AjBool     ajStrTokenAssign(AjPStrTok* Ptoken, const AjPStr str);
AjBool     ajStrTokenAssignC(AjPStrTok* Ptoken, const AjPStr str,
			     const char* txtdelim);
AjBool     ajStrTokenAssignS(AjPStrTok* Ptoken, const AjPStr str,
			     const AjPStr strdelim);

/* reset */

void       ajStrTokenReset(AjPStrTok* Ptoken);

/* debug */

void       ajStrTokenTrace(const AjPStrTok token);

/* parsing */

AjBool     ajStrTokenNextFind(AjPStrTok* Ptoken, AjPStr* Pstr);
AjBool     ajStrTokenNextFindC(AjPStrTok* Ptoken, const char* strdelim,
			       AjPStr* Pstr);
AjBool     ajStrTokenNextParse(AjPStrTok* Ptoken, AjPStr* Pstr);
AjBool     ajStrTokenNextParseC(AjPStrTok* Ptoken, const char* txtdelim,
				AjPStr* Pstr);
AjBool     ajStrTokenNextParseS(AjPStrTok* Ptoken, const AjPStr strdelim,
				AjPStr* Pstr);
AjBool     ajStrTokenNextParseNoskip(AjPStrTok* Ptoken, AjPStr* Pstr);
AjBool     ajStrTokenRestParse(AjPStrTok* Ptoken, AjPStr* Pstr);



/*
** End of prototype definitions
*/


/* =====================================================================
** Deprecated functions - renamed or replaced
** __deprecated The  tag is used by the gcc compiler to report calls
** for other compilers it is defined as an empty string (i.e. removed)
** ===================================================================== */

__deprecated void        ajCharFree (char** txt);
__deprecated char        *ajCharNew (const AjPStr thys);
__deprecated char        *ajCharNewL (size_t size);
__deprecated char        *ajCharNewLS (size_t size, const AjPStr thys);
__deprecated ajint       ajCharPos (const char* txt, ajint ipos);
__deprecated void        ajCharToLower (char *txt);
__deprecated void        ajCharToUpper (char *txt);

__deprecated AjBool      ajStrApp  (AjPStr* pthis, const AjPStr src);
__deprecated AjBool      ajStrAppC (AjPStr* pthis, const char *txt);
__deprecated AjBool      ajStrAppCI (AjPStr* pthis, const char *txt, size_t i);
__deprecated AjBool      ajStrAppK (AjPStr* pthis, const char chr);
__deprecated AjBool      ajStrAppKI (AjPStr* pthis, const char chr,
				    ajint number);
__deprecated AjBool      ajStrAppSub (AjPStr* pthis, const AjPStr src,
				     ajint begin, ajint end);
__deprecated void        ajStrArrayDel (AjPStr** pthis);
__deprecated AjBool      ajStrAss   (AjPStr* pthis, AjPStr str); /* not const */
__deprecated AjBool      ajStrAssC  (AjPStr* pthis, const char* txt);
__deprecated AjBool      ajStrAssCI (AjPStr* pthis, const char* txt, size_t i);
__deprecated AjBool      ajStrAssCL (AjPStr* pthis, const char* txt, size_t i);
__deprecated AjBool      ajStrAssI  (AjPStr* pthis, const AjPStr str, size_t i);
__deprecated AjBool      ajStrAssK  (AjPStr* pthis, const char text);
__deprecated AjBool      ajStrAssL  (AjPStr* pthis, const AjPStr str, size_t i);
__deprecated AjBool      ajStrAssS  (AjPStr* pthis, const AjPStr str);
__deprecated AjBool      ajStrAssSub  (AjPStr* pthis, const AjPStr str,
				      ajint begin, ajint end);
__deprecated AjBool      ajStrAssSubC (AjPStr* pthis, const char* txt,
				      ajint begin, ajint end);
__deprecated AjBool      ajStrBlock (AjPStr* pthis, ajint blksize);
__deprecated char        ajStrChar (const AjPStr thys, ajint pos);
__deprecated AjBool      ajStrChomp (AjPStr* pthis);
__deprecated AjBool      ajStrChompC (AjPStr* pthis, const char* delim);
__deprecated AjBool      ajStrChompEnd (AjPStr* pthis);
__deprecated AjBool      ajStrChop  (AjPStr* pthis);
__deprecated AjBool      ajStrClean (AjPStr* s);
__deprecated AjBool      ajStrCleanWhite (AjPStr* s);
__deprecated AjBool      ajStrClear (AjPStr* pthis);
__deprecated int         ajStrCmp(const void* str, const void* str2);
__deprecated int         ajStrCmpCase(const AjPStr str, const AjPStr str2);
__deprecated int         ajStrCmpCaseCC (const char* str1, const char* str2);
__deprecated int         ajStrCmpO  (const AjPStr thys, const AjPStr anoth);
__deprecated int         ajStrCmpWild(const AjPStr str, const AjPStr str2);
__deprecated int         ajStrCmpWildCC (const char* str, const char* text);
__deprecated AjBool      ajStrConvert   (AjPStr* pthis, const AjPStr oldc,
					const AjPStr newc);
__deprecated AjBool      ajStrConvertCC (AjPStr* pthis, const char* oldc,
					const char* newc);
__deprecated AjBool      ajStrCopy (AjPStr* pthis, AjPStr str); /* not const */
__deprecated AjBool      ajStrCopyC (AjPStr* pthis, const char* str);
__deprecated ajint       ajStrCountC (const AjPStr thys, const char* str);
__deprecated ajint       ajStrCountK (const AjPStr thys, char ch);
__deprecated AjBool      ajStrCut(AjPStr* pthis, ajint begin, ajint end);
__deprecated void        ajStrDegap(AjPStr* pthis);
__deprecated AjBool      ajStrDelReuse (AjPStr* pthis);
__deprecated AjBool      ajStrDelim (AjPStr* pthis, AjPStrTok *ptoken,
				    const char *delim);
__deprecated AjPStr      ajStrDup (AjPStr thys);
__deprecated void        ajStrFill (AjPStr* pthis, ajint count, char fill);
__deprecated ajint       ajStrFind(const AjPStr str, const AjPStr str2);
__deprecated ajint       ajStrFindCase(const AjPStr str, const AjPStr str2);
__deprecated ajint       ajStrFindK  (const AjPStr thys, const char chr);
__deprecated void        ajStrFix (AjPStr *pthys);
__deprecated void        ajStrFixI (AjPStr *pthys, ajint ilen);
__deprecated AjBool      ajStrFromDoubleE(AjPStr* Pstr, double val,
					 ajint precision);
__deprecated AjBool      ajStrInsert(AjPStr* Pstr, ajint pos,
				    const AjPStr str );
__deprecated AjBool      ajStrIsSpace (const AjPStr thys);
__deprecated AjBool      ajStrKeepAlphaC (AjPStr* pthis, const char* chars);
__deprecated AjBool      ajStrKeepC (AjPStr* pthis, const char* chars);
__deprecated ajint        ajStrLen (const AjPStr thys);
__deprecated ajint       ajStrListToArray(const AjPStr str, AjPStr **array);
__deprecated AjBool      ajStrMask(AjPStr* str, ajint begin, ajint end,
                                   char maskchar);
__deprecated AjBool      ajStrMatchCaseCC(const char* thys, const char* text);
__deprecated AjBool      ajStrMatchCC    (const char* thys, const char* text);
__deprecated AjBool      ajStrMatchWildCC(const char* str, const char* text);
__deprecated AjBool      ajStrMatchWildCO(const char* str, const AjPStr wild);
__deprecated AjBool      ajStrMatchWord  (const AjPStr str, const AjPStr text);
__deprecated AjBool      ajStrMatchWordCC (const char* str, const char* text);
__deprecated AjBool      ajStrMod (AjPStr* pthis);
__deprecated AjBool      ajStrModL (AjPStr* pthis, size_t size);
__deprecated AjBool      ajStrModMinL (AjPStr* pthis, ajuint size);
__deprecated AjPStr      ajStrNewL (size_t size);
__deprecated AjBool      ajStrMatch(const AjPStr str, const AjPStr str2);
__deprecated AjBool      ajStrMatchCase(const AjPStr str, const AjPStr str2);
__deprecated AjBool      ajStrMatchWild(const AjPStr str, const AjPStr str2);
__deprecated int         ajStrNCmpC(const AjPStr str, const char* txt,
				   ajint len);
__deprecated ajint 	 ajStrNCmpCaseCC (const char* str1, const char* str2,
					 ajint len);
__deprecated ajint       ajStrNCmpO (const AjPStr thys, const AjPStr anoth,
				    ajint n);
__deprecated AjPStr      ajStrNewCL (const char *txt, size_t size);
__deprecated AjPStr      ajStrNewCIL (const char *txt, ajint len, size_t size);
__deprecated const AjPStr ajStrNull(void);
__deprecated AjBool      ajStrParentheses(const AjPStr s);
__deprecated ajint       ajStrPos  (const AjPStr thys, ajint ipos);
__deprecated ajint       ajStrPosI (const AjPStr thys, ajint imin, ajint ipos);
__deprecated ajint       ajStrPosII (ajint ilen, ajint imin, ajint ipos);
__deprecated AjBool      ajStrPrefix(const AjPStr str, const AjPStr str2);
__deprecated AjBool      ajStrPrefixCase(const AjPStr str, const AjPStr str2);
__deprecated AjBool      ajStrPrefixCaseCC (const char *str, const char* pref);
__deprecated AjBool      ajStrPrefixCaseCO (const char* thys,
					   const AjPStr pref);
__deprecated AjBool      ajStrPrefixCC (const char *str, const char* pref);
__deprecated AjBool      ajStrPrefixCO (const char *str, const AjPStr thys);
__deprecated void        ajStrQuote(AjPStr *s);
__deprecated AjBool      ajStrReplace  (AjPStr* pthis, ajint pos1,
			  const AjPStr overwrite, ajint len);
__deprecated AjBool      ajStrReplaceC (AjPStr* pthis, ajint pos1,
			  const char* overwrite, ajint len);
__deprecated AjBool      ajStrReplaceK (AjPStr* pthis, ajint pos1,
			  char overwrite, ajint len);
__deprecated AjBool      ajStrReplaceS( AjPStr* pthis,
				       ajint begin, const AjPStr overwrite);
__deprecated ajint       ajStrRef(const AjPStr thys);
__deprecated void        ajStrRemoveCharsC(AjPStr* thys, const char *strng);
__deprecated void        ajStrRemoveNewline(AjPStr* pthis);
__deprecated AjBool      ajStrRev (AjPStr* pthis);
__deprecated ajint       ajStrRFindC (const AjPStr thys, const char *text);
__deprecated ajint       ajStrRoom(const AjPStr thys);
__deprecated AjBool      ajStrSet  (AjPStr* pthis, const AjPStr str);
__deprecated AjBool      ajStrSetC  (AjPStr* pthis, const char* str);
__deprecated ajint       ajStrSize (const AjPStr thys);
__deprecated const char  *ajStrStr (const AjPStr thys);
__deprecated char        *ajStrStrMod (AjPStr* thys);
__deprecated AjBool      ajStrSub (AjPStr* pthis, ajint begin, ajint len);
__deprecated AjBool      ajStrSubstitute  (AjPStr* pthis, const AjPStr replace,
			      const AjPStr putin);
__deprecated AjBool      ajStrSubstituteCC(AjPStr* pthis, const char* replace,
			      const char* putin);
__deprecated AjBool      ajStrSubstituteKK (AjPStr* pthis, char replace,
			      char putin);
__deprecated AjBool      ajStrSuffix(const AjPStr str, const AjPStr str2);
__deprecated AjBool      ajStrSuffixCC (const char *str, const char* suff);
__deprecated AjBool      ajStrSuffixCO (const char *str, const AjPStr suff);
__deprecated AjBool      ajStrToLower (AjPStr* pthis);
__deprecated AjBool      ajStrToLowerII(AjPStr* pthis, ajint begin, ajint end);
__deprecated AjBool      ajStrToTitle (AjPStr* pthis);
__deprecated AjBool      ajStrToUpper (AjPStr* pthis);
__deprecated AjBool      ajStrToUpperII(AjPStr* pthis, ajint begin, ajint end);
__deprecated AjBool      ajStrTrim  (AjPStr* pthis, ajint num);
__deprecated AjBool      ajStrTruncate(AjPStr* Pstr, ajint pos);
__deprecated AjBool      ajStrUncomment (AjPStr* text);
__deprecated AjBool      ajStrUncommentStart (AjPStr* text);
__deprecated AjBool      ajStrWildPrefix (AjPStr* str);
__deprecated AjBool      ajStrWrap (AjPStr* pthis, ajint width);
__deprecated AjBool      ajStrWrapLeft (AjPStr* pthis, ajint width,
                                        ajint left);




__deprecated AjIStr      ajStrIter (const AjPStr thys);
__deprecated AjIStr      ajStrIterBack (const AjPStr thys);
__deprecated AjBool      ajStrIterBackDone(AjIStr iter);
__deprecated AjIStr      ajStrIterBackNext (AjIStr iter);
__deprecated void        ajStrIterFree (AjIStr *iter);
__deprecated AjBool      ajStrIterMore(AjIStr iter);
__deprecated AjBool      ajStrIterMoreBack(AjIStr iter);


__deprecated const AjPStr ajStrTok (const AjPStr thys);
__deprecated const AjPStr ajStrTokC (const AjPStr thys, const char* delim);
__deprecated const AjPStr ajStrTokCC (const char* thys, const char* delim);
__deprecated AjBool      ajStrToken (AjPStr* pthis, AjPStrTok *ptoken,
				    const char *delim);
__deprecated AjBool      ajStrTokenAss (AjPStrTok *ptok, const AjPStr thys,
			  const char *delim);
__deprecated void        ajStrTokenClear (AjPStrTok *token);
__deprecated ajint       ajStrTokenCount(const AjPStr line, const char *delim);
__deprecated ajint       ajStrTokenCountR(const AjPStr line, const char *delim);
__deprecated AjPStrTok   ajStrTokenInit (const AjPStr thys, const char *delim);
__deprecated AjBool      ajStrTokenRest (AjPStr* pthis, AjPStrTok* ptoken);

/*#define    MAJSTRLEN(str) str->Len*/
__deprecated const char  *MAJSTRSTR(const AjPStr thys);
__deprecated ajint  MAJSTRLEN(const AjPStr thys);
__deprecated ajint  MAJSTRSIZE(const AjPStr thys);
__deprecated ajint  MAJSTRREF(const AjPStr thys);


/*#define    MAJSTRREF(str) str->Use*/
/*#define    MAJSTRSIZE(str) str->Res*/
/*#define    MAJSTRSUBK(str,pos,c) str->Ptr[pos]=c*/
/*#define    MAJSTRSTR(str) str->Ptr*/

#endif

#ifdef __cplusplus
}
#endif