Browse code

Declare some char * arguments as const where appropriate.

Maxim Sobolev authored on 12/09/2004 09:46:54
Showing 2 changed files
... ...
@@ -268,7 +268,7 @@ error:
268 268
 
269 269
 
270 270
 
271
-static int replace_len(char* match, int nmatch, regmatch_t* pmatch,
271
+static int replace_len(const char* match, int nmatch, regmatch_t* pmatch,
272 272
 					struct subst_expr* se, struct sip_msg* msg)
273 273
 {
274 274
 	int r;
... ...
@@ -314,7 +314,7 @@ static int replace_len(char* match, int nmatch, regmatch_t* pmatch,
314 314
 
315 315
 /* rpl.s will be alloc'ed with the proper size & rpl.len set
316 316
  * returns 0 on success, <0 on error*/
317
-static int replace_build(char* match, int nmatch, regmatch_t* pmatch,
317
+static int replace_build(const char* match, int nmatch, regmatch_t* pmatch,
318 318
 					struct subst_expr* se, struct sip_msg* msg, str* rpl)
319 319
 {
320 320
 	int r;
... ...
@@ -386,12 +386,12 @@ error:
386 386
 
387 387
 
388 388
 /* WARNING: input must be 0 terminated! */
389
-struct replace_lst* subst_run(struct subst_expr* se, char* input,
389
+struct replace_lst* subst_run(struct subst_expr* se, const char* input,
390 390
 								struct sip_msg* msg)
391 391
 {
392 392
 	struct replace_lst *head;
393 393
 	struct replace_lst **crt;
394
-	char *p;
394
+	const char *p;
395 395
 	int r;
396 396
 	regmatch_t* pmatch;
397 397
 	int nmatch;
... ...
@@ -453,16 +453,16 @@ error:
453 453
 
454 454
 /* returns the substitution result in a str, input must be 0 term
455 455
  *  0 on no match or malloc error */ 
456
-str* subst_str(char *input, struct sip_msg* msg, struct subst_expr* se)
456
+str* subst_str(const char *input, struct sip_msg* msg, struct subst_expr* se)
457 457
 {
458 458
 	str* res;
459 459
 	struct replace_lst *lst;
460 460
 	struct replace_lst* l;
461 461
 	int len;
462 462
 	int size;
463
-	char* p;
463
+	const char* p;
464 464
 	char* dest;
465
-	char* end;
465
+	const char* end;
466 466
 	
467 467
 	
468 468
 	/* compute the len */
... ...
@@ -73,9 +73,9 @@ struct replace_lst{
73 73
 void subst_expr_free(struct subst_expr* se);
74 74
 void replace_lst_free(struct replace_lst* l);
75 75
 struct subst_expr*  subst_parser(str* subst);
76
-struct replace_lst* subst_run( struct subst_expr* se, char* input, 
76
+struct replace_lst* subst_run( struct subst_expr* se, const char* input, 
77 77
 		                       struct sip_msg* msg);
78
-str* subst_str(char* input, struct sip_msg* msg, struct subst_expr* se);
78
+str* subst_str(const char* input, struct sip_msg* msg, struct subst_expr* se);
79 79
 
80 80
 
81 81