| 6 |
its pattern matching. On a Unix or Win32 system it can recurse into |
its pattern matching. On a Unix or Win32 system it can recurse into |
| 7 |
directories. |
directories. |
| 8 |
|
|
| 9 |
Copyright (c) 1997-2006 University of Cambridge |
Copyright (c) 1997-2007 University of Cambridge |
| 10 |
|
|
| 11 |
----------------------------------------------------------------------------- |
----------------------------------------------------------------------------- |
| 12 |
Redistribution and use in source and binary forms, with or without |
Redistribution and use in source and binary forms, with or without |
| 37 |
----------------------------------------------------------------------------- |
----------------------------------------------------------------------------- |
| 38 |
*/ |
*/ |
| 39 |
|
|
| 40 |
|
#ifdef HAVE_CONFIG_H |
| 41 |
|
# include <config.h> |
| 42 |
|
#endif |
| 43 |
|
|
| 44 |
#include <ctype.h> |
#include <ctype.h> |
| 45 |
#include <locale.h> |
#include <locale.h> |
| 46 |
#include <stdio.h> |
#include <stdio.h> |
| 52 |
#include <sys/stat.h> |
#include <sys/stat.h> |
| 53 |
#include <unistd.h> |
#include <unistd.h> |
| 54 |
|
|
|
#include "config.h" |
|
| 55 |
#include "pcre.h" |
#include "pcre.h" |
| 56 |
|
|
| 57 |
#define FALSE 0 |
#define FALSE 0 |
| 59 |
|
|
| 60 |
typedef int BOOL; |
typedef int BOOL; |
| 61 |
|
|
|
#define VERSION "4.4 29-Nov-2006" |
|
| 62 |
#define MAX_PATTERN_COUNT 100 |
#define MAX_PATTERN_COUNT 100 |
| 63 |
|
|
| 64 |
#if BUFSIZ > 8192 |
#if BUFSIZ > 8192 |
| 246 |
|
|
| 247 |
/************* Directory scanning in Unix ***********/ |
/************* Directory scanning in Unix ***********/ |
| 248 |
|
|
| 249 |
#if IS_UNIX |
#if defined HAVE_SYS_STAT_H && defined HAVE_DIRENT_H && defined HAVE_SYS_TYPES_H |
| 250 |
#include <sys/types.h> |
#include <sys/types.h> |
| 251 |
#include <sys/stat.h> |
#include <sys/stat.h> |
| 252 |
#include <dirent.h> |
#include <dirent.h> |
| 316 |
when it did not exist. */ |
when it did not exist. */ |
| 317 |
|
|
| 318 |
|
|
| 319 |
#elif HAVE_WIN32API |
#elif HAVE_WINDOWS_H |
| 320 |
|
|
| 321 |
#ifndef STRICT |
#ifndef STRICT |
| 322 |
# define STRICT |
# define STRICT |
| 438 |
typedef void directory_type; |
typedef void directory_type; |
| 439 |
|
|
| 440 |
int isdirectory(char *filename) { return 0; } |
int isdirectory(char *filename) { return 0; } |
| 441 |
directory_type * opendirectory(char *filename) {} |
directory_type * opendirectory(char *filename) { return (directory_type*)0;} |
| 442 |
char *readdirectory(directory_type *dir) {} |
char *readdirectory(directory_type *dir) { return (char*)0;} |
| 443 |
void closedirectory(directory_type *dir) {} |
void closedirectory(directory_type *dir) {} |
| 444 |
|
|
| 445 |
|
|
| 1330 |
case 'x': process_options |= PO_LINE_MATCH; break; |
case 'x': process_options |= PO_LINE_MATCH; break; |
| 1331 |
|
|
| 1332 |
case 'V': |
case 'V': |
| 1333 |
fprintf(stderr, "pcregrep version %s using ", VERSION); |
fprintf(stderr, "pcregrep version %s\n", pcre_version()); |
|
fprintf(stderr, "PCRE version %s\n", pcre_version()); |
|
| 1334 |
exit(0); |
exit(0); |
| 1335 |
break; |
break; |
| 1336 |
|
|