Changeset e19eb97 for zwrite.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
  • zwrite.c

    r65b2173 re19eb97  
    55#include "owl.h"
    66
    7 int owl_zwrite_create_from_line(owl_zwrite *z, char *line)
     7int owl_zwrite_create_from_line(owl_zwrite *z, const char *line)
    88{
    99  int argc, badargs, myargc, i, len;
    1010  char **argv;
    11   char **myargv;
     11  const char *const *myargv;
    1212  char *msg = NULL;
    1313
     
    152152void owl_zwrite_populate_zsig(owl_zwrite *z)
    153153{
    154   char *zsigproc, *zsigowlvar, *zsigzvar;
     154  const char *zsigproc, *zsigowlvar, *zsigzvar;
    155155  char *ptr;
    156156  struct passwd *pw;
     
    219219  for (i=0; i<j; i++) {
    220220    if (strcmp(z->realm, "")) {
    221       to = owl_sprintf("%s@%s", (char *) owl_list_get_element(&(z->recips), i), z->realm);
     221      to = owl_sprintf("%s@%s", (const char *) owl_list_get_element(&(z->recips), i), z->realm);
    222222    } else {
    223223      to = owl_strdup(owl_list_get_element(&(z->recips), i));
     
    229229}
    230230
    231 void owl_zwrite_set_message(owl_zwrite *z, char *msg)
     231void owl_zwrite_set_message(owl_zwrite *z, const char *msg)
    232232{
    233233  int i, j;
     
    243243      tmp = toline;
    244244      if (strcmp(z->realm, "")) {
    245         toline = owl_sprintf( "%s%s@%s ", toline, (char *) owl_list_get_element(&(z->recips), i), z->realm);
     245        toline = owl_sprintf( "%s%s@%s ", toline, (const char *) owl_list_get_element(&(z->recips), i), z->realm);
    246246      } else {
    247         toline = owl_sprintf( "%s%s ", toline, (char *) owl_list_get_element(&(z->recips), i));
     247        toline = owl_sprintf( "%s%s ", toline, (const char *) owl_list_get_element(&(z->recips), i));
    248248      }
    249249      owl_free(tmp);
     
    263263}
    264264
    265 char *owl_zwrite_get_message(owl_zwrite *z)
     265const char *owl_zwrite_get_message(owl_zwrite *z)
    266266{
    267267  if (z->message) return(z->message);
     
    286286    for (i=0; i<j; i++) {
    287287      if (strcmp(z->realm, "")) {
    288         to = owl_sprintf("%s@%s", (char *) owl_list_get_element(&(z->recips), i), z->realm);
     288        to = owl_sprintf("%s@%s", (const char *) owl_list_get_element(&(z->recips), i), z->realm);
    289289      } else {
    290290        to = owl_strdup( owl_list_get_element(&(z->recips), i));
     
    302302}
    303303
    304 int owl_zwrite_create_and_send_from_line(char *cmd, char *msg)
     304int owl_zwrite_create_and_send_from_line(const char *cmd, const char *msg)
    305305{
    306306  owl_zwrite z;
     
    317317}
    318318
    319 char *owl_zwrite_get_class(owl_zwrite *z)
     319const char *owl_zwrite_get_class(owl_zwrite *z)
    320320{
    321321  return(z->class);
    322322}
    323323
    324 char *owl_zwrite_get_instance(owl_zwrite *z)
     324const char *owl_zwrite_get_instance(owl_zwrite *z)
    325325{
    326326  return(z->inst);
    327327}
    328328
    329 char *owl_zwrite_get_opcode(owl_zwrite *z)
     329const char *owl_zwrite_get_opcode(owl_zwrite *z)
    330330{
    331331  return(z->opcode);
    332332}
    333333
    334 void owl_zwrite_set_opcode(owl_zwrite *z, char *opcode)
     334void owl_zwrite_set_opcode(owl_zwrite *z, const char *opcode)
    335335{
    336336  if (z->opcode) owl_free(z->opcode);
     
    338338}
    339339
    340 char *owl_zwrite_get_realm(owl_zwrite *z)
     340const char *owl_zwrite_get_realm(owl_zwrite *z)
    341341{
    342342  return(z->realm);
    343343}
    344344
    345 char *owl_zwrite_get_zsig(owl_zwrite *z)
     345const char *owl_zwrite_get_zsig(owl_zwrite *z)
    346346{
    347347  if (z->zsig) return(z->zsig);
     
    367367}
    368368
    369 char *owl_zwrite_get_recip_n(owl_zwrite *z, int n)
     369const char *owl_zwrite_get_recip_n(owl_zwrite *z, int n)
    370370{
    371371  return(owl_list_get_element(&(z->recips), n));
Note: See TracChangeset for help on using the changeset viewer.