Making parameters "const" where possible.
authorjongfoster <jongfoster@users.sourceforge.net>
Sun, 5 Aug 2001 13:13:11 +0000 (13:13 +0000)
committerjongfoster <jongfoster@users.sourceforge.net>
Sun, 5 Aug 2001 13:13:11 +0000 (13:13 +0000)
pcrs.c
pcrs.h

diff --git a/pcrs.c b/pcrs.c
index 48c78fd..fd8c03f 100644 (file)
--- a/pcrs.c
+++ b/pcrs.c
@@ -1,4 +1,4 @@
-const char pcrs_rcs[] = "$Id: pcrs.c,v 1.8 2001/06/29 21:45:41 oes Exp $";
+const char pcrs_rcs[] = "$Id: pcrs.c,v 1.9 2001/07/18 17:27:00 oes Exp $";
 
 /*********************************************************************
  *
 
 /*********************************************************************
  *
@@ -38,6 +38,9 @@ const char pcrs_rcs[] = "$Id: pcrs.c,v 1.8 2001/06/29 21:45:41 oes Exp $";
  *
  * Revisions   :
  *    $Log: pcrs.c,v $
  *
  * Revisions   :
  *    $Log: pcrs.c,v $
+ *    Revision 1.9  2001/07/18 17:27:00  oes
+ *    Changed interface; Cosmetics
+ *
  *    Revision 1.8  2001/06/29 21:45:41  oes
  *    Indentation, CRLF->LF, Tab-> Space
  *
  *    Revision 1.8  2001/06/29 21:45:41  oes
  *    Indentation, CRLF->LF, Tab-> Space
  *
@@ -171,7 +174,7 @@ const char pcrs_h_rcs[] = PCRS_H_VERSION;
  * Returns     :  option integer suitable for pcre 
  *
  *********************************************************************/
  * Returns     :  option integer suitable for pcre 
  *
  *********************************************************************/
-int pcrs_compile_perl_options(char *optstring, int *flags)
+int pcrs_compile_perl_options(const char *optstring, int *flags)
 {
    size_t i;
    int rc = 0;
 {
    size_t i;
    int rc = 0;
@@ -217,7 +220,7 @@ int pcrs_compile_perl_options(char *optstring, int *flags)
  *                the reason.
  *
  *********************************************************************/
  *                the reason.
  *
  *********************************************************************/
-pcrs_substitute *pcrs_compile_replacement(char *replacement, int trivialflag, int *errptr)
+pcrs_substitute *pcrs_compile_replacement(const char *replacement, int trivialflag, int *errptr)
 {
    int length, i, k = 0, l = 0, quoted = 0, idx;
    char *text, *num_ptr, *numbers = "0123456789";
 {
    int length, i, k = 0, l = 0, quoted = 0, idx;
    char *text, *num_ptr, *numbers = "0123456789";
@@ -386,7 +389,7 @@ void pcrs_free_joblist(pcrs_job *joblist)
  *                has the reason.
  *
  *********************************************************************/
  *                has the reason.
  *
  *********************************************************************/
-pcrs_job *pcrs_compile_command(char *command, int *errptr)
+pcrs_job *pcrs_compile_command(const char *command, int *errptr)
 {
    int i, k, l, limit, quoted = FALSE;
    char delimiter;
 {
    int i, k, l, limit, quoted = FALSE;
    char delimiter;
@@ -472,7 +475,7 @@ pcrs_job *pcrs_compile_command(char *command, int *errptr)
  *                has the reason.
  *
  *********************************************************************/
  *                has the reason.
  *
  *********************************************************************/
-pcrs_job *pcrs_compile(char *pattern, char *substitute, char *options, int *errptr)
+pcrs_job *pcrs_compile(const char *pattern, const char *substitute, const char *options, int *errptr)
 {
    pcrs_job *newjob;
    int flags;
 {
    pcrs_job *newjob;
    int flags;
diff --git a/pcrs.h b/pcrs.h
index 31fb887..8f2af81 100644 (file)
--- a/pcrs.h
+++ b/pcrs.h
@@ -26,6 +26,9 @@
  *
  * Revisions   :
  *    $Log: pcrs.h,v $
  *
  * Revisions   :
  *    $Log: pcrs.h,v $
+ *    Revision 1.6  2001/07/29 18:52:06  jongfoster
+ *    Renaming _PCRS_H, and adding "extern C {}"
+ *
  *    Revision 1.5  2001/07/18 17:27:00  oes
  *    Changed interface; Cosmetics
  *
  *    Revision 1.5  2001/07/18 17:27:00  oes
  *    Changed interface; Cosmetics
  *
@@ -57,7 +60,7 @@
  *
  *********************************************************************/
 
  *
  *********************************************************************/
 
-#define PCRS_H_VERSION "$Id: pcrs.h,v 1.5 2001/07/18 17:27:00 oes Exp $"
+#define PCRS_H_VERSION "$Id: pcrs.h,v 1.6 2001/07/29 18:52:06 jongfoster Exp $"
 \f
 
 #include <pcre.h>
 \f
 
 #include <pcre.h>
@@ -123,8 +126,8 @@ typedef struct PCRS_JOB {
  */
 
 /* Main usage */
  */
 
 /* Main usage */
-extern pcrs_job        *pcrs_compile_command(char *command, int *errptr);
-extern pcrs_job        *pcrs_compile(char *pattern, char *substitute, char *options, int *errptr);
+extern pcrs_job        *pcrs_compile_command(const char *command, int *errptr);
+extern pcrs_job        *pcrs_compile(const char *pattern, const char *substitute, const char *options, int *errptr);
 extern int              pcrs_execute(pcrs_job *job, char *subject, int subject_length, char **result, int *result_length);
 
 /* Freeing jobs */
 extern int              pcrs_execute(pcrs_job *job, char *subject, int subject_length, char **result, int *result_length);
 
 /* Freeing jobs */
@@ -132,8 +135,8 @@ extern pcrs_job        *pcrs_free_job(pcrs_job *job);
 extern void             pcrs_free_joblist(pcrs_job *joblist);
 
 /* Expert usage */
 extern void             pcrs_free_joblist(pcrs_job *joblist);
 
 /* Expert usage */
-extern int              pcrs_compile_perl_options(char *optstring, int *flags);
-extern pcrs_substitute *pcrs_compile_replacement(char *replacement, int trivialflag, int *errptr);
+extern int              pcrs_compile_perl_options(const char *optstring, int *flags);
+extern pcrs_substitute *pcrs_compile_replacement(const char *replacement, int trivialflag, int *errptr);
 
 #ifdef __cplusplus
 } /* extern "C" */
 
 #ifdef __cplusplus
 } /* extern "C" */