Changeset e19eb97 for util.c


Ignore:
Timestamp:
Aug 15, 2009, 7:08:18 PM (12 years ago)
Author:
Anders Kaseorg <andersk@mit.edu>
Branches:
master, 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
  • util.c

    rfa4562c re19eb97  
    66#include <pwd.h>
    77
    8 void sepbar(char *in)
     8void sepbar(const char *in)
    99{
    1010  char buff[1024];
     
    1313  owl_view *v;
    1414  int x, y, i;
    15   char *foo, *appendtosepbar;
     15  const char *foo, *appendtosepbar;
    1616
    1717  sepwin=owl_global_get_curs_sepwin(&g);
     
    125125}
    126126
    127 char **atokenize(char *buffer, char *sep, int *i)
     127char **atokenize(const char *buffer, const char *sep, int *i)
    128128{
    129129  /* each element of return must be freed by user */
     
    157157}
    158158
    159 char *skiptokens(char *buff, int n) {
     159const char *skiptokens(const char *buff, int n) {
    160160  /* skips n tokens and returns where that would be.
    161161   * TODO: handle quotes more sanely. */
     
    177177 * duplicate slashes are removed.  Caller must free the return.
    178178 */
    179 char *owl_util_makepath(char *in)
     179char *owl_util_makepath(const char *in)
    180180{
    181181  int i, j, x;
     
    262262}
    263263
    264 char **owl_parseline(char *line, int *argc)
     264char **owl_parseline(const char *line, int *argc)
    265265{
    266266  /* break a command line up into argv, argc.  The caller must free
     
    409409 * if the named color is not available
    410410 */
    411 int owl_util_string_to_color(char *color)
     411int owl_util_string_to_color(const char *color)
    412412{
    413413  int c;
     
    439439
    440440/* Return a string name of the given owl color */
    441 char *owl_util_color_to_string(int color)
     441const char *owl_util_color_to_string(int color)
    442442{
    443443  if (color==OWL_COLOR_BLACK)   return("black");
     
    456456char *owl_util_get_default_tty()
    457457{
    458   char *tmp;
     458  const char *tmp;
    459459  char *out;
    460460
     
    480480  owl_message *m;
    481481  owl_fmtext *fm;
    482   char *text, *ptr;
     482  const char *text, *ptr;
    483483  int place;
    484484
     
    532532 * return.
    533533 */
    534 char *owl_util_stripnewlines(char *in)
     534char *owl_util_stripnewlines(const char *in)
    535535{
    536536 
     
    558558 * memory.
    559559 */
    560 void owl_util_file_deleteline(char *filename, char *line, int backup)
     560void owl_util_file_deleteline(const char *filename, const char *line, int backup)
    561561{
    562562  char buff[LINE], *text;
     
    646646   The caller is responsible for freeing the allocated string.
    647647*/
    648 char * owl_util_baseclass(char * class)
     648char * owl_util_baseclass(const char * class)
    649649{
    650650  char *start, *end;
     
    664664}
    665665
    666 char * owl_get_datadir()
    667 {
    668   char * datadir = getenv("BARNOWL_DATA_DIR");
     666const char * owl_get_datadir()
     667{
     668  const char * datadir = getenv("BARNOWL_DATA_DIR");
    669669  if(datadir != NULL)
    670670    return datadir;
Note: See TracChangeset for help on using the changeset viewer.