comparison src/regex.h @ 647:b39c14581166

[xemacs-hg @ 2001-08-13 04:45:47 by ben] removal of unsigned, size_t, etc.
author ben
date Mon, 13 Aug 2001 04:46:48 +0000
parents 7039e6323819
children fdefd0186b75
comparison
equal deleted inserted replaced
646:00c54252fe4f 647:b39c14581166
25 25
26 #ifdef emacs 26 #ifdef emacs
27 #define RE_TRANSLATE_TYPE Lisp_Object 27 #define RE_TRANSLATE_TYPE Lisp_Object
28 #else 28 #else
29 #define RE_TRANSLATE_TYPE char * 29 #define RE_TRANSLATE_TYPE char *
30 #define Element_Count ssize_t
31 #define Memory_Count ssize_t
30 #endif /* emacs */ 32 #endif /* emacs */
31 33
32 /* POSIX says that <sys/types.h> must be included (by the caller) before 34 /* POSIX says that <sys/types.h> must be included (by the caller) before
33 <regex.h>. */ 35 <regex.h>. */
34 36
323 `unsigned char *' because its elements are 325 `unsigned char *' because its elements are
324 sometimes used as array indexes. */ 326 sometimes used as array indexes. */
325 unsigned char *buffer; 327 unsigned char *buffer;
326 328
327 /* Number of bytes to which `buffer' points. */ 329 /* Number of bytes to which `buffer' points. */
328 unsigned long allocated; 330 long allocated;
329 331
330 /* Number of bytes actually used in `buffer'. */ 332 /* Number of bytes actually used in `buffer'. */
331 unsigned long used; 333 long used;
332 334
333 /* Syntax setting with which the pattern was compiled. */ 335 /* Syntax setting with which the pattern was compiled. */
334 reg_syntax_t syntax; 336 reg_syntax_t syntax;
335 337
336 /* Pointer to a fastmap, if any, otherwise zero. re_search uses 338 /* Pointer to a fastmap, if any, otherwise zero. re_search uses
344 when it is matched. */ 346 when it is matched. */
345 RE_TRANSLATE_TYPE translate; 347 RE_TRANSLATE_TYPE translate;
346 348
347 /* Number of returnable groups found by the compiler. (This does 349 /* Number of returnable groups found by the compiler. (This does
348 not count shy groups.) */ 350 not count shy groups.) */
349 size_t re_nsub; 351 int re_nsub;
350 352
351 /* Total number of groups found by the compiler. (Including 353 /* Total number of groups found by the compiler. (Including
352 shy ones.) */ 354 shy ones.) */
353 int re_ngroups; 355 int re_ngroups;
354 356
355 /* Zero if this pattern cannot match the empty string, one else. 357 /* Zero if this pattern cannot match the empty string, one else.
356 Well, in truth it's used only in `re_search_2', to see 358 Well, in truth it's used only in `re_search_2', to see
357 whether or not we should use the fastmap, so we don't set 359 whether or not we should use the fastmap, so we don't set
358 this absolutely perfectly; see `re_compile_fastmap' (the 360 this absolutely perfectly; see `re_compile_fastmap' (the
359 `duplicate' case). */ 361 `duplicate' case). */
360 unsigned can_be_null : 1; 362 unsigned int can_be_null : 1;
361 363
362 /* If REGS_UNALLOCATED, allocate space in the `regs' structure 364 /* If REGS_UNALLOCATED, allocate space in the `regs' structure
363 for `max (RE_NREGS, re_nsub + 1)' groups. 365 for `max (RE_NREGS, re_nsub + 1)' groups.
364 If REGS_REALLOCATE, reallocate space if necessary. 366 If REGS_REALLOCATE, reallocate space if necessary.
365 If REGS_FIXED, use what's there. */ 367 If REGS_FIXED, use what's there. */
366 #define REGS_UNALLOCATED 0 368 #define REGS_UNALLOCATED 0
367 #define REGS_REALLOCATE 1 369 #define REGS_REALLOCATE 1
368 #define REGS_FIXED 2 370 #define REGS_FIXED 2
369 unsigned regs_allocated : 2; 371 unsigned int regs_allocated : 2;
370 372
371 /* Set to zero when `regex_compile' compiles a pattern; set to one 373 /* Set to zero when `regex_compile' compiles a pattern; set to one
372 by `re_compile_fastmap' if it updates the fastmap. */ 374 by `re_compile_fastmap' if it updates the fastmap. */
373 unsigned fastmap_accurate : 1; 375 unsigned int fastmap_accurate : 1;
374 376
375 /* If set, `re_match_2' does not return information about 377 /* If set, `re_match_2' does not return information about
376 subexpressions. */ 378 subexpressions. */
377 unsigned no_sub : 1; 379 unsigned int no_sub : 1;
378 380
379 /* If set, a beginning-of-line anchor doesn't match at the 381 /* If set, a beginning-of-line anchor doesn't match at the
380 beginning of the string. */ 382 beginning of the string. */
381 unsigned not_bol : 1; 383 unsigned int not_bol : 1;
382 384
383 /* Similarly for an end-of-line anchor. */ 385 /* Similarly for an end-of-line anchor. */
384 unsigned not_eol : 1; 386 unsigned int not_eol : 1;
385 387
386 /* If true, an anchor at a newline matches. */ 388 /* If true, an anchor at a newline matches. */
387 unsigned newline_anchor : 1; 389 unsigned int newline_anchor : 1;
388 390
389 unsigned warned_about_incompatible_back_references : 1; 391 unsigned int warned_about_incompatible_back_references : 1;
390 392
391 /* Mapping between back references and groups (may not be 393 /* Mapping between back references and groups (may not be
392 equivalent with shy groups). */ 394 equivalent with shy groups). */
393 int *external_to_internal_register; 395 int *external_to_internal_register;
394 396
405 407
406 /* This is the structure we store register match data in. See 408 /* This is the structure we store register match data in. See
407 regex.texinfo for a full description of what registers match. */ 409 regex.texinfo for a full description of what registers match. */
408 struct re_registers 410 struct re_registers
409 { 411 {
410 unsigned num_regs; 412 int num_regs;
411 regoff_t *start; 413 regoff_t *start;
412 regoff_t *end; 414 regoff_t *end;
413 }; 415 };
414 416
415 417
489 491
490 Unless this function is called, the first search or match using 492 Unless this function is called, the first search or match using
491 PATTERN_BUFFER will allocate its own register data, without 493 PATTERN_BUFFER will allocate its own register data, without
492 freeing the old data. */ 494 freeing the old data. */
493 void re_set_registers (struct re_pattern_buffer *buffer, 495 void re_set_registers (struct re_pattern_buffer *buffer,
494 struct re_registers *regs, unsigned num_regs, 496 struct re_registers *regs, int num_regs,
495 regoff_t *starts, regoff_t *ends); 497 regoff_t *starts, regoff_t *ends);
496 498
497 #ifdef _REGEX_RE_COMP 499 #ifdef _REGEX_RE_COMP
498 /* 4.2 bsd compatibility. */ 500 /* 4.2 bsd compatibility. */
499 char *re_comp (const char *); 501 char *re_comp (const char *);