Changeset e19eb97 for text.c


Ignore:
Timestamp:
Aug 15, 2009, 7:08:18 PM (15 years ago)
Author:
Anders Kaseorg <andersk@mit.edu>
Branches:
master, release-1.10, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
1077891a
Parents:
fa4562c
git-author:
Anders Kaseorg <andersk@mit.edu> (08/04/09 02:37:51)
git-committer:
Anders Kaseorg <andersk@mit.edu> (08/15/09 19:08:18)
Message:
Add const qualifiers for char * and void *.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
File:
1 edited

Legend:

Unmodified
Added
Removed
  • text.c

    r65b2173 re19eb97  
    55#include "owl.h"
    66
    7 void owl_text_indent(char *out, char *in, int n)
    8 {
    9   char *ptr1, *ptr2, *last;
     7void owl_text_indent(char *out, const char *in, int n)
     8{
     9  const char *ptr1, *ptr2, *last;
    1010  int i;
    1111
     
    2929}
    3030
    31 int owl_text_num_lines(char *in)
     31int owl_text_num_lines(const char *in)
    3232{
    3333  int lines, i;
     
    4646
    4747/* caller must free the return */
    48 char *owl_text_htmlstrip(char *in)
    49 {
    50   char *ptr1, *end, *ptr2, *ptr3;
     48char *owl_text_htmlstrip(const char *in)
     49{
     50  const char *ptr1, *end, *ptr2, *ptr3;
    5151  char *out, *out2;
    5252
     
    129129
    130130/* Caller must free return */
    131 char *owl_text_expand_tabs(char *in)
     131char *owl_text_expand_tabs(const char *in)
    132132{
    133133  int ntabs = 0;
    134   char *p = in;
     134  const char *p = in;
    135135  char *ret, *out;
    136136  int col;
     
    166166
    167167/* caller must free the return */
    168 char *owl_text_wordwrap(char *in, int col)
     168char *owl_text_wordwrap(const char *in, int col)
    169169{
    170170  char *out;
     
    227227
    228228/* return 1 if a string is only whitespace, otherwise 0 */
    229 int only_whitespace(char *s)
     229int only_whitespace(const char *s)
    230230{
    231231  if (g_utf8_validate(s,-1,NULL)) {
    232     char *p;
     232    const char *p;
    233233    for(p = s; p[0]; p=g_utf8_next_char(p)) {
    234234      if (!g_unichar_isspace(g_utf8_get_char(p))) return 0;
     
    244244}
    245245
    246 char *owl_getquoting(char *line)
     246const char *owl_getquoting(const char *line)
    247247{
    248248  if (line[0]=='\0') return("'");
     
    257257 * Caller must free returned string.
    258258 */
    259 char *owl_text_substitute(char *in, char *from, char *to)
     259char *owl_text_substitute(const char *in, const char *from, const char *to)
    260260{
    261261 
     
    307307 * On success returns the string, on error returns NULL.
    308308 */
    309 char *owl_text_quote(char *in, char *toquote, char *quotestr)
     309char *owl_text_quote(const char *in, const char *toquote, const char *quotestr)
    310310{
    311311  int i, x, r, place, escape;
Note: See TracChangeset for help on using the changeset viewer.