Changeset e19eb97


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>
Files:
39 edited

Legend:

Unmodified
Added
Removed
  • aim.c

    rfa4562c re19eb97  
    2626};
    2727
    28 static char *msgerrreasons[] = {
     28static const char *msgerrreasons[] = {
    2929        "Invalid error",
    3030        "Invalid SNAC",
     
    136136
    137137
    138 int owl_aim_login(char *screenname, char *password)
     138int owl_aim_login(const char *screenname, const char *password)
    139139{
    140140  struct owlfaim_priv *priv;
     
    209209
    210210/* stuff to run once login has been successful */
    211 void owl_aim_successful_login(char *screenname)
     211void owl_aim_successful_login(const char *screenname)
    212212{
    213213  char *buff;
     
    248248}
    249249
    250 void owl_aim_login_error(char *message)
     250void owl_aim_login_error(const char *message)
    251251{
    252252  if (message) {
     
    261261}
    262262
    263 int owl_aim_send_im(char *to, char *msg)
     263int owl_aim_send_im(const char *to, const char *msg)
    264264{
    265265  int ret;
     
    271271}
    272272
    273 int owl_aim_send_awaymsg(char *to, char *msg)
     273int owl_aim_send_awaymsg(const char *to, const char *msg)
    274274{
    275275  int ret;
     
    281281}
    282282
    283 void owl_aim_addbuddy(char *name)
     283void owl_aim_addbuddy(const char *name)
    284284{
    285285
     
    295295}
    296296
    297 void owl_aim_delbuddy(char *name)
     297void owl_aim_delbuddy(const char *name)
    298298{
    299299  aim_ssi_delbuddy(owl_global_get_aimsess(&g), name, "Buddies");
     
    301301}
    302302
    303 void owl_aim_search(char *email)
     303void owl_aim_search(const char *email)
    304304{
    305305  int ret;
     
    314314
    315315
    316 int owl_aim_set_awaymsg(char *msg)
     316int owl_aim_set_awaymsg(const char *msg)
    317317{
    318318  int len;
     
    341341}
    342342
    343 void owl_aim_chat_join(char *name, int exchange)
     343void owl_aim_chat_join(const char *name, int exchange)
    344344{
    345345  int ret;
     
    347347  /*
    348348  OscarData *od = g->proto_data;
    349   char *name, *exchange;
     349  const char *name, *exchange;
    350350  */
    351351
     
    392392}
    393393
    394 void owl_aim_chat_leave(char *chatroom)
    395 {
    396 }
    397 
    398 int owl_aim_chat_sendmsg(char *chatroom, char *msg)
     394void owl_aim_chat_leave(const char *chatroom)
     395{
     396}
     397
     398int owl_aim_chat_sendmsg(const char *chatroom, const char *msg)
    399399{
    400400  return(0);
     
    402402
    403403/* caller must free the return */
    404 char *owl_aim_normalize_screenname(char *in)
     404char *owl_aim_normalize_screenname(const char *in)
    405405{
    406406  char *out;
     
    482482  struct client_info_s info = CLIENTINFO_AIM_KNOWNGOOD;
    483483   
    484   char *key;
    485   va_list ap;
    486 
    487   va_start(ap, fr);
    488   key = va_arg(ap, char *);
     484  const char *key;
     485  va_list ap;
     486
     487  va_start(ap, fr);
     488  key = va_arg(ap, const char *);
    489489  va_end(ap);
    490490
     
    706706  va_list ap;
    707707  fu16_t code;
    708   char *msg;
     708  const char *msg;
    709709 
    710710  va_start(ap, fr);
    711711  code = va_arg(ap, int);
    712   msg = va_arg(ap, char *);
     712  msg = va_arg(ap, const char *);
    713713  va_end(ap);
    714714 
     
    740740  fu16_t change = 0, perms, type;
    741741  int length, str;
    742   char *val;
     742  const char *val;
    743743  va_list ap;
    744744 
     
    748748  type = (fu16_t)va_arg(ap, unsigned int);
    749749  length = va_arg(ap, int);
    750   val = va_arg(ap, char *);
     750  val = va_arg(ap, const char *);
    751751  str = va_arg(ap, int);
    752752  va_end(ap);
     
    900900static int faimtest_parse_motd(aim_session_t *sess, aim_frame_t *fr, ...)
    901901{
    902   char *msg;
     902  const char *msg;
    903903  fu16_t id;
    904904  va_list ap;
    905905  static int codeslen = 5;
    906   static char *codes[] = {
     906  static const char *codes[] = {
    907907    "Unknown",
    908908    "Mandatory upgrade",
     
    914914  va_start(ap, fr);
    915915  id = va_arg(ap, int);
    916   msg = va_arg(ap, char *);
     916  msg = va_arg(ap, const char *);
    917917  va_end(ap);
    918918
     
    10721072  va_list ap;
    10731073  fu32_t offset, len;
    1074   char *modname;
     1074  const char *modname;
    10751075  unsigned char *buf;
    10761076  int buflen;
     
    10791079  offset = va_arg(ap, fu32_t);
    10801080  len = va_arg(ap, fu32_t);
    1081   modname = va_arg(ap, char *);
     1081  modname = va_arg(ap, const char *);
    10821082  va_end(ap);
    10831083 
     
    11121112{
    11131113  aim_userinfo_t *userinfo;
    1114   char *prof_encoding = NULL;
    1115   char *prof = NULL;
     1114  const char *prof_encoding = NULL;
     1115  const char *prof = NULL;
    11161116  fu16_t inforeq = 0;
    11171117  owl_buddy *b;
     
    11201120  userinfo = va_arg(ap, aim_userinfo_t *);
    11211121  inforeq = (fu16_t)va_arg(ap, unsigned int);
    1122   prof_encoding = va_arg(ap, char *);
    1123   prof = va_arg(ap, char *);
     1122  prof_encoding = va_arg(ap, const char *);
     1123  prof = va_arg(ap, const char *);
    11241124  va_end(ap);
    11251125
     
    14971497{
    14981498  va_list ap;
    1499   char *destsn;
     1499  const char *destsn;
    15001500  fu16_t reason;
    15011501 
    15021502  va_start(ap, fr);
    15031503  reason = (fu16_t)va_arg(ap, unsigned int);
    1504   destsn = va_arg(ap, char *);
     1504  destsn = va_arg(ap, const char *);
    15051505  va_end(ap);
    15061506 
     
    15181518{
    15191519  va_list ap;
    1520   char *destsn;
     1520  const char *destsn;
    15211521  fu16_t reason;
    15221522 
    15231523  va_start(ap, fr);
    15241524  reason = (fu16_t)va_arg(ap, unsigned int);
    1525   destsn = va_arg(ap, char *);
     1525  destsn = va_arg(ap, const char *);
    15261526  va_end(ap);
    15271527 
     
    15341534static int faimtest_parse_misses(aim_session_t *sess, aim_frame_t *fr, ...)
    15351535{
    1536   static char *missedreasons[] = {
     1536  static const char *missedreasons[] = {
    15371537    "Invalid (0)",
    15381538    "Message too large",
     
    15661566  va_list ap;
    15671567  fu16_t type;
    1568   char *sn = NULL;
     1568  const char *sn = NULL;
    15691569 
    15701570  va_start(ap, fr);
    15711571  type = (fu16_t)va_arg(ap, unsigned int);
    1572   sn = va_arg(ap, char *);
     1572  sn = va_arg(ap, const char *);
    15731573  va_end(ap);
    15741574 
     
    15801580static int faimtest_parse_ratechange(aim_session_t *sess, aim_frame_t *fr, ...)
    15811581{
    1582   static char *codes[5] = {
     1582  static const char *codes[5] = {
    15831583    "invalid",
    15841584    "change",
     
    16561656{
    16571657  va_list ap;
    1658   char *address, *SNs;
     1658  const char *address, *SNs;
    16591659  int num, i;
    16601660  owl_list list;
    16611661 
    16621662  va_start(ap, fr);
    1663   address = va_arg(ap, char *);
     1663  address = va_arg(ap, const char *);
    16641664  num = va_arg(ap, int);
    1665   SNs = va_arg(ap, char *);
     1665  SNs = va_arg(ap, const char *);
    16661666  va_end(ap);
    16671667
     
    16811681{
    16821682  va_list ap;
    1683   char *address;
    1684  
    1685   va_start(ap, fr);
    1686   address = va_arg(ap, char *);
     1683  const char *address;
     1684 
     1685  va_start(ap, fr);
     1686  address = va_arg(ap, const char *);
    16871687  va_end(ap);
    16881688
     
    16961696{
    16971697  va_list ap;
    1698   char *msg, *url;
     1698  const char *msg, *url;
    16991699  fu16_t width, height, delay;
    17001700 
    17011701  va_start(ap, fr);
    1702   msg = va_arg(ap, char *);
    1703   url = va_arg(ap, char *);
     1702  msg = va_arg(ap, const char *);
     1703  url = va_arg(ap, const char *);
    17041704  width = va_arg(ap, unsigned int);
    17051705  height = va_arg(ap, unsigned int);
     
    17221722  va_list ap;
    17231723  aim_conn_t *bosconn;
    1724   char *bosip;
     1724  const char *bosip;
    17251725  fu8_t *cookie;
    17261726 
    17271727  va_start(ap, fr);
    1728   bosip = va_arg(ap, char *);
     1728  bosip = va_arg(ap, const char *);
    17291729  cookie = va_arg(ap, fu8_t *);
    17301730  va_end(ap);
     
    18731873  aim_userinfo_t *userinfo;
    18741874  struct aim_chat_roominfo *roominfo;
    1875   char *roomname;
     1875  const char *roomname;
    18761876  int usercount;
    1877   char *roomdesc;
     1877  const char *roomdesc;
    18781878  fu16_t flags, unknown_d2, unknown_d5, maxmsglen, maxvisiblemsglen;
    18791879  fu32_t creationtime;
     
    18851885  va_start(ap, fr);
    18861886  roominfo = va_arg(ap, struct aim_chat_roominfo *);
    1887   roomname = va_arg(ap, char *);
     1887  roomname = va_arg(ap, const char *);
    18881888  usercount = va_arg(ap, int);
    18891889  userinfo = va_arg(ap, aim_userinfo_t *);
    1890   roomdesc = va_arg(ap, char *);
     1890  roomdesc = va_arg(ap, const char *);
    18911891  flags = (fu16_t)va_arg(ap, unsigned int);
    18921892  creationtime = va_arg(ap, fu32_t);
     
    19281928  va_list ap;
    19291929  aim_userinfo_t *userinfo;
    1930   char *msg;
     1930  const char *msg;
    19311931  char tmpbuf[1152];
    19321932 
    19331933  va_start(ap, fr);
    19341934  userinfo = va_arg(ap, aim_userinfo_t *);     
    1935   msg = va_arg(ap, char *);
     1935  msg = va_arg(ap, const char *);
    19361936  va_end(ap);
    19371937
  • buddy.c

    rd43edd2 re19eb97  
    11#include "owl.h"
    22
    3 void owl_buddy_create(owl_buddy *b, int proto, char *name)
     3void owl_buddy_create(owl_buddy *b, int proto, const char *name)
    44{
    55  b->proto=proto;
     
    88}
    99
    10 char *owl_buddy_get_name(owl_buddy *b)
     10const char *owl_buddy_get_name(owl_buddy *b)
    1111{
    1212  if (b->name) return(b->name);
  • buddylist.c

    rd43edd2 re19eb97  
    88/* add a (logged-in) AIM buddy to the buddy list
    99 */
    10 void owl_buddylist_add_aim_buddy(owl_buddylist *bl, char *screenname)
     10void owl_buddylist_add_aim_buddy(owl_buddylist *bl, const char *screenname)
    1111{
    1212  owl_buddy *b;
     
    1919/* remove an AIM buddy from the buddy list
    2020 */
    21 int owl_buddylist_remove_aim_buddy(owl_buddylist *bl, char *name)
     21int owl_buddylist_remove_aim_buddy(owl_buddylist *bl, const char *name)
    2222{
    2323  int i, j;
     
    4040 * logged in.
    4141 */
    42 void owl_buddylist_oncoming(owl_buddylist *bl, char *screenname)
     42void owl_buddylist_oncoming(owl_buddylist *bl, const char *screenname)
    4343{
    4444  owl_message *m;
     
    6666 * has logged out, and sending a message if they were logged in.
    6767 */
    68 void owl_buddylist_offgoing(owl_buddylist *bl, char *screenname)
     68void owl_buddylist_offgoing(owl_buddylist *bl, const char *screenname)
    6969{
    7070  owl_message *m;
     
    103103 * no such buddy is logged in, return NULL.
    104104 */
    105 owl_buddy *owl_buddylist_get_aim_buddy(owl_buddylist *bl, char *name)
     105owl_buddy *owl_buddylist_get_aim_buddy(owl_buddylist *bl, const char *name)
    106106{
    107107  int i, j;
     
    119119 * otherwise return 0
    120120 */
    121 int owl_buddylist_is_aim_buddy_loggedin(owl_buddylist *bl, char *screenname)
     121int owl_buddylist_is_aim_buddy_loggedin(owl_buddylist *bl, const char *screenname)
    122122{
    123123  owl_buddy *b;
  • cmd.c

    rfa4562c re19eb97  
    3838}
    3939
    40 owl_cmd *owl_cmddict_find(owl_cmddict *d, char *name) {
     40owl_cmd *owl_cmddict_find(owl_cmddict *d, const char *name) {
    4141  return owl_dict_find_element(d, name);
    4242}
     
    4747
    4848/* creates a new command alias */
    49 int owl_cmddict_add_alias(owl_cmddict *cd, char *alias_from, char *alias_to) {
     49int owl_cmddict_add_alias(owl_cmddict *cd, const char *alias_from, const char *alias_to) {
    5050  owl_cmd *cmd;
    5151  cmd = owl_malloc(sizeof(owl_cmd));
     
    6565}
    6666
    67 char *_owl_cmddict_execute(owl_cmddict *cd, owl_context *ctx, char **argv, int argc, char *buff) {
     67char *_owl_cmddict_execute(owl_cmddict *cd, owl_context *ctx, const char *const *argv, int argc, const char *buff) {
    6868  char *retval = NULL;
    6969  owl_cmd *cmd;
     
    7878}
    7979
    80 char *owl_cmddict_execute(owl_cmddict *cd, owl_context *ctx, char *cmdbuff) {
     80char *owl_cmddict_execute(owl_cmddict *cd, owl_context *ctx, const char *cmdbuff) {
    8181  char **argv;
    8282  int argc;
     
    103103}
    104104
    105 char *owl_cmddict_execute_argv(owl_cmddict *cd, owl_context *ctx, char **argv, int argc) {
     105char *owl_cmddict_execute_argv(owl_cmddict *cd, owl_context *ctx, const char *const *argv, int argc) {
    106106  char *buff, *ptr;
    107107  int len = 0, i;
     
    143143}
    144144
    145 int owl_cmd_create_alias(owl_cmd *cmd, char *name, char *aliased_to) {
     145int owl_cmd_create_alias(owl_cmd *cmd, const char *name, const char *aliased_to) {
    146146  memset(cmd, 0, sizeof(owl_cmd));
    147147  cmd->name = owl_strdup(name);
     
    167167}
    168168
    169 char *owl_cmd_execute(owl_cmd *cmd, owl_cmddict *cd, owl_context *ctx, int argc, char **argv, char *cmdbuff) {
     169char *owl_cmd_execute(owl_cmd *cmd, owl_cmddict *cd, owl_context *ctx, int argc, const char *const *argv, const char *cmdbuff) {
    170170  static int alias_recurse_depth = 0;
    171171  int ival=0;
    172   char *cmdbuffargs;
     172  const char *cmdbuffargs;
    173173  char *newcmd, *rv=NULL;
    174174
     
    206206
    207207  if (cmd->cmd_i_fn || cmd->cmd_ctxi_fn) {
    208       char *ep = "x";
     208      const char *ep = "x";
    209209      if (argc != 2) {
    210210        owl_function_makemsg("Wrong number of arguments for %s command.", argv[0]);
     
    238238
    239239/* returns a reference */
    240 char *owl_cmd_get_summary(owl_cmd *cmd) {
     240const char *owl_cmd_get_summary(owl_cmd *cmd) {
    241241  return cmd->summary;
    242242}
     
    255255
    256256
    257 void owl_cmd_get_help(owl_cmddict *d, char *name, owl_fmtext *fm) {
    258   char *s;
     257void owl_cmd_get_help(owl_cmddict *d, const char *name, owl_fmtext *fm) {
     258  const char *s;
    259259  char *indent;
    260260  owl_cmd *cmd;
  • commands.c

    rfa4562c re19eb97  
    55#include "owl.h"
    66
    7 /* fn is "char *foo(int argc, char **argv, char *buff)" */
     7/* fn is "char *foo(int argc, const char *const *argv, const char *buff)" */
    88#define OWLCMD_ARGS(name, fn, ctx, summary, usage, description) \
    99        { name, summary, usage, description, ctx, \
     
    2424          actualname, NULL, NULL, NULL, NULL, NULL, NULL, NULL }
    2525
    26 /* fn is "char *foo(void *ctx, int argc, char **argv, char *buff)" */
     26/* fn is "char *foo(void *ctx, int argc, const char *const *argv, const char *buff)" */
    2727#define OWLCMD_ARGS_CTX(name, fn, ctx, summary, usage, description) \
    2828        { name, summary, usage, description, ctx, \
    29           NULL, NULL, NULL, NULL, ((char*(*)(void*,int,char**,char*))fn), NULL, NULL, NULL }
     29          NULL, NULL, NULL, NULL, ((char*(*)(void*,int,const char*const *,const char*))fn), NULL, NULL, NULL }
    3030
    3131/* fn is "void foo(void)" */
     
    10041004}
    10051005
    1006 char *owl_command_help(int argc, char **argv, char *buff)
     1006char *owl_command_help(int argc, const char *const *argv, const char *buff)
    10071007{
    10081008  if (argc!=2) {
     
    10151015}
    10161016
    1017 char *owl_command_zlist(int argc, char **argv, char *buff)
     1017char *owl_command_zlist(int argc, const char *const *argv, const char *buff)
    10181018{
    10191019  int elapsed=0, timesort=0;
    1020   char *file=NULL;
     1020  const char *file=NULL;
    10211021
    10221022  argc--;
     
    10761076}
    10771077
    1078 char *owl_command_aim(int argc, char **argv, char *buff)
     1078char *owl_command_aim(int argc, const char *const *argv, const char *buff)
    10791079{
    10801080  if (argc<2) {
     
    10961096}
    10971097
    1098 char *owl_command_addbuddy(int argc, char **argv, char *buff)
     1098char *owl_command_addbuddy(int argc, const char *const *argv, const char *buff)
    10991099{
    11001100  if (argc!=3) {
     
    11241124}
    11251125
    1126 char *owl_command_delbuddy(int argc, char **argv, char *buff)
     1126char *owl_command_delbuddy(int argc, const char *const *argv, const char *buff)
    11271127{
    11281128  if (argc!=3) {
     
    11481148}
    11491149
    1150 char *owl_command_join(int argc, char **argv, char *buff)
     1150char *owl_command_join(int argc, const char *const *argv, const char *buff)
    11511151{
    11521152  if (argc!=3 && argc!=4) {
     
    11721172}
    11731173
    1174 char *owl_command_startup(int argc, char **argv, char *buff)
    1175 {
    1176   char *ptr;
     1174char *owl_command_startup(int argc, const char *const *argv, const char *buff)
     1175{
     1176  const char *ptr;
    11771177
    11781178  if (argc<2) {
     
    11931193}
    11941194
    1195 char *owl_command_unstartup(int argc, char **argv, char *buff)
    1196 {
    1197   char *ptr;
     1195char *owl_command_unstartup(int argc, const char *const *argv, const char *buff)
     1196{
     1197  const char *ptr;
    11981198
    11991199  if (argc<2) {
     
    12131213}
    12141214
    1215 char *owl_command_dump(int argc, char **argv, char *buff)
     1215char *owl_command_dump(int argc, const char *const *argv, const char *buff)
    12161216{
    12171217  char *filename;
     
    12271227}
    12281228
    1229 char *owl_command_source(int argc, char **argv, char *buff)
     1229char *owl_command_source(int argc, const char *const *argv, const char *buff)
    12301230{
    12311231  if (argc!=2) {
     
    12381238}
    12391239
    1240 char *owl_command_next(int argc, char **argv, char *buff)
     1240char *owl_command_next(int argc, const char *const *argv, const char *buff)
    12411241{
    12421242  char *filter=NULL;
     
    12681268}
    12691269
    1270 char *owl_command_prev(int argc, char **argv, char *buff)
     1270char *owl_command_prev(int argc, const char *const *argv, const char *buff)
    12711271{
    12721272  char *filter=NULL;
     
    12981298}
    12991299
    1300 char *owl_command_smartnarrow(int argc, char **argv, char *buff)
     1300char *owl_command_smartnarrow(int argc, const char *const *argv, const char *buff)
    13011301{
    13021302  char *filtname = NULL;
     
    13161316}
    13171317
    1318 char *owl_command_smartfilter(int argc, char **argv, char *buff)
     1318char *owl_command_smartfilter(int argc, const char *const *argv, const char *buff)
    13191319{
    13201320  char *filtname = NULL;
     
    13721372}
    13731373
    1374 char *owl_command_loadsubs(int argc, char **argv, char *buff)
     1374char *owl_command_loadsubs(int argc, const char *const *argv, const char *buff)
    13751375{
    13761376  if (argc == 2) {
     
    13861386
    13871387
    1388 char *owl_command_loadloginsubs(int argc, char **argv, char *buff)
     1388char *owl_command_loadloginsubs(int argc, const char *const *argv, const char *buff)
    13891389{
    13901390  if (argc == 2) {
     
    14041404}
    14051405
    1406 char *owl_command_start_command(int argc, char **argv, char *buff)
     1406char *owl_command_start_command(int argc, const char *const *argv, const char *buff)
    14071407{
    14081408  buff = skiptokens(buff, 1);
     
    14111411}
    14121412
    1413 char *owl_command_zaway(int argc, char **argv, char *buff)
     1413char *owl_command_zaway(int argc, const char *const *argv, const char *buff)
    14141414{
    14151415  if ((argc==1) ||
     
    14371437
    14381438
    1439 char *owl_command_aaway(int argc, char **argv, char *buff)
     1439char *owl_command_aaway(int argc, const char *const *argv, const char *buff)
    14401440{
    14411441  if ((argc==1) ||
     
    14631463
    14641464
    1465 char *owl_command_away(int argc, char **argv, char *buff)
     1465char *owl_command_away(int argc, const char *const *argv, const char *buff)
    14661466{
    14671467  if ((argc==1) ||
     
    15061506}
    15071507
    1508 char *owl_command_set(int argc, char **argv, char *buff)
    1509 {
    1510   char *var, *val;
     1508char *owl_command_set(int argc, const char *const *argv, const char *buff)
     1509{
     1510  const char *var, *val;
    15111511  int  silent=0;
    15121512  int requirebool=0;
     
    15371537}
    15381538
    1539 char *owl_command_unset(int argc, char **argv, char *buff)
    1540 {
    1541   char *var, *val;
     1539char *owl_command_unset(int argc, const char *const *argv, const char *buff)
     1540{
     1541  const char *var, *val;
    15421542  int  silent=0;
    15431543
     
    15571557}
    15581558
    1559 char *owl_command_print(int argc, char **argv, char *buff)
    1560 {
    1561   char *var;
     1559char *owl_command_print(int argc, const char *const *argv, const char *buff)
     1560{
     1561  const char *var;
    15621562  char valbuff[1024];
    15631563
     
    15821582
    15831583
    1584 char *owl_command_exec(int argc, char **argv, char *buff)
     1584char *owl_command_exec(int argc, const char *const *argv, const char *buff)
    15851585{
    15861586  return owl_function_exec(argc, argv, buff, 0);
    15871587}
    15881588
    1589 char *owl_command_pexec(int argc, char **argv, char *buff)
     1589char *owl_command_pexec(int argc, const char *const *argv, const char *buff)
    15901590{
    15911591  return owl_function_exec(argc, argv, buff, 1);
    15921592}
    15931593
    1594 char *owl_command_aexec(int argc, char **argv, char *buff)
     1594char *owl_command_aexec(int argc, const char *const *argv, const char *buff)
    15951595{
    15961596  return owl_function_exec(argc, argv, buff, 2);
    15971597}
    15981598
    1599 char *owl_command_perl(int argc, char **argv, char *buff)
     1599char *owl_command_perl(int argc, const char *const *argv, const char *buff)
    16001600{
    16011601  return owl_function_perl(argc, argv, buff, 0);
    16021602}
    16031603
    1604 char *owl_command_pperl(int argc, char **argv, char *buff)
     1604char *owl_command_pperl(int argc, const char *const *argv, const char *buff)
    16051605{
    16061606  return owl_function_perl(argc, argv, buff, 1);
    16071607}
    16081608
    1609 char *owl_command_aperl(int argc, char **argv, char *buff)
     1609char *owl_command_aperl(int argc, const char *const *argv, const char *buff)
    16101610{
    16111611  return owl_function_perl(argc, argv, buff, 2);
    16121612}
    16131613
    1614 char *owl_command_multi(int argc, char **argv, char *buff)
     1614char *owl_command_multi(int argc, const char *const *argv, const char *buff)
    16151615{
    16161616  char *lastrv = NULL, *newbuff;
     
    16471647
    16481648
    1649 char *owl_command_alias(int argc, char **argv, char *buff)
     1649char *owl_command_alias(int argc, const char *const *argv, const char *buff)
    16501650{
    16511651  if (argc < 3) {
     
    16591659
    16601660
    1661 char *owl_command_bindkey(int argc, char **argv, char *buff)
     1661char *owl_command_bindkey(int argc, const char *const *argv, const char *buff)
    16621662{
    16631663  owl_keymap *km;
     
    16881688}
    16891689
    1690 char *owl_command_debug(int argc, char **argv, char *buff)
     1690char *owl_command_debug(int argc, const char *const *argv, const char *buff)
    16911691{
    16921692  if (argc<2) {
     
    17041704}
    17051705
    1706 char *owl_command_term(int argc, char **argv, char *buff)
     1706char *owl_command_term(int argc, const char *const *argv, const char *buff)
    17071707{
    17081708  if (argc<2) {
     
    17211721}
    17221722
    1723 char *owl_command_zlog(int argc, char **argv, char *buff)
     1723char *owl_command_zlog(int argc, const char *const *argv, const char *buff)
    17241724{
    17251725  if ((argc<2) || (argc>3)) {
     
    17451745}
    17461746
    1747 char *owl_command_subscribe(int argc, char **argv, char *buff)
    1748 {
    1749   char *class, *instance, *recip="";
     1747char *owl_command_subscribe(int argc, const char *const *argv, const char *buff)
     1748{
     1749  const char *class, *instance, *recip="";
    17501750  int temp=0;
    17511751  int ret=0;
     
    17951795
    17961796
    1797 char *owl_command_unsubscribe(int argc, char **argv, char *buff)
    1798 {
    1799   char *class, *instance, *recip="";
     1797char *owl_command_unsubscribe(int argc, const char *const *argv, const char *buff)
     1798{
     1799  const char *class, *instance, *recip="";
    18001800  int temp=0;
    18011801
     
    18431843}
    18441844
    1845 char *owl_command_echo(int argc, char **argv, char *buff)
     1845char *owl_command_echo(int argc, const char *const *argv, const char *buff)
    18461846{
    18471847  buff = skiptokens(buff, 1);
     
    18601860}
    18611861
    1862 char *owl_command_zwrite(int argc, char **argv, char *buff)
     1862char *owl_command_zwrite(int argc, const char *const *argv, const char *buff)
    18631863{
    18641864  owl_zwrite z;
     
    18841884}
    18851885
    1886 char *owl_command_aimwrite(int argc, char **argv, char *buff)
     1886char *owl_command_aimwrite(int argc, const char *const *argv, const char *buff)
    18871887{
    18881888  char *newbuff, *recip;
    1889   char **myargv;
     1889  const char *const *myargv;
    18901890  int i, j, myargc;
    18911891  owl_message *m;
     
    19641964}
    19651965
    1966 char *owl_command_loopwrite(int argc, char **argv, char *buff)
     1966char *owl_command_loopwrite(int argc, const char *const *argv, const char *buff)
    19671967{
    19681968  owl_function_loopwrite_setup();
     
    19701970}
    19711971
    1972 char *owl_command_zcrypt(int argc, char **argv, char *buff)
     1972char *owl_command_zcrypt(int argc, const char *const *argv, const char *buff)
    19731973{
    19741974#ifdef OWL_ENABLE_ZCRYPT
     
    19981998}
    19991999
    2000 char *owl_command_reply(int argc, char **argv, char *buff)
     2000char *owl_command_reply(int argc, const char *const *argv, const char *buff)
    20012001{
    20022002  int edit=0;
     
    20242024}
    20252025
    2026 char *owl_command_filter(int argc, char **argv, char *buff)
     2026char *owl_command_filter(int argc, const char *const *argv, const char *buff)
    20272027{
    20282028  owl_function_create_filter(argc, argv);
     
    20302030}
    20312031
    2032 char *owl_command_zlocate(int argc, char **argv, char *buff)
     2032char *owl_command_zlocate(int argc, const char *const *argv, const char *buff)
    20332033{
    20342034  int auth;
     
    20642064 * view --home
    20652065 */
    2066 char *owl_command_view(int argc, char **argv, char *buff)
     2066char *owl_command_view(int argc, const char *const *argv, const char *buff)
    20672067{
    20682068  /* First take the 'view --home' and 'view -r' cases */
     
    20882088  /* Now get 'view -d <expression>' */
    20892089  if (argc>=3 && !strcmp(argv[1], "-d")) {
    2090     char **myargv;
     2090    const char **myargv;
    20912091    int i;
    20922092
    2093     myargv=owl_malloc((argc*sizeof(char *))+50);
     2093    myargv=owl_malloc((argc*sizeof(const char *))+50);
    20942094    myargv[0]="";
    20952095    myargv[1]="owl-dynamic";
     
    21362136      argv++;
    21372137    } else if (!strcmp(argv[0], "-r")) {
    2138       char *foo;
     2138      const char *foo;
    21392139      foo=owl_function_create_negative_filter(owl_view_get_filtname(owl_global_get_current_view(&g)));
    21402140      owl_function_change_currentview_filter(foo);
     
    21562156}
    21572157
    2158 char *owl_command_show(int argc, char **argv, char *buff)
     2158char *owl_command_show(int argc, const char *const *argv, const char *buff)
    21592159{
    21602160  if (argc<2) {
     
    22132213    owl_function_show_quickstart();
    22142214  } else if (!strcmp(argv[1], "startup")) {
    2215     char *filename;
     2215    const char *filename;
    22162216   
    22172217    filename=owl_global_get_startupfile(&g);
     
    22262226}
    22272227
    2228 char *owl_command_viewclass(int argc, char **argv, char *buff)
     2228char *owl_command_viewclass(int argc, const char *const *argv, const char *buff)
    22292229{
    22302230  char *filtname;
     
    22392239}
    22402240
    2241 char *owl_command_viewuser(int argc, char **argv, char *buff)
     2241char *owl_command_viewuser(int argc, const char *const *argv, const char *buff)
    22422242{
    22432243  char *filtname;
     
    22582258}
    22592259
    2260 char *owl_command_delete(int argc, char **argv, char *buff)
     2260char *owl_command_delete(int argc, const char *const *argv, const char *buff)
    22612261{
    22622262  int move_after = 1;
     
    22922292}
    22932293
    2294 char *owl_command_undelete(int argc, char **argv, char *buff)
     2294char *owl_command_undelete(int argc, const char *const *argv, const char *buff)
    22952295{
    22962296  int move_after = 1;
     
    23262326}
    23272327
    2328 char *owl_command_colorview(int argc, char **argv, char *buff)
     2328char *owl_command_colorview(int argc, const char *const *argv, const char *buff)
    23292329{
    23302330  if (argc < 2 || argc > 3) {
     
    23362336}
    23372337
    2338 char *owl_command_colorclass(int argc, char **argv, char *buff)
    2339 {
    2340   char *filtname;
     2338char *owl_command_colorclass(int argc, const char *const *argv, const char *buff)
     2339{
     2340  const char *filtname;
    23412341 
    23422342  if (argc < 3 || argc > 4) {
     
    23502350}
    23512351
    2352 char *owl_command_zpunt(int argc, char **argv, char *buff)
     2352char *owl_command_zpunt(int argc, const char *const *argv, const char *buff)
    23532353{
    23542354  owl_command_zpunt_and_zunpunt(argc, argv, 0);
     
    23562356}
    23572357
    2358 char *owl_command_zunpunt(int argc, char **argv, char *buff)
     2358char *owl_command_zunpunt(int argc, const char *const *argv, const char *buff)
    23592359{
    23602360  owl_command_zpunt_and_zunpunt(argc, argv, 1);
     
    23622362}
    23632363
    2364 void owl_command_zpunt_and_zunpunt(int argc, char **argv, int type)
     2364void owl_command_zpunt_and_zunpunt(int argc, const char *const *argv, int type)
    23652365{
    23662366  /* if type==0 then zpunt
    23672367   * if type==1 then zunpunt
    23682368   */
    2369   char *class, *inst, *recip;
     2369  const char *class, *inst, *recip;
    23702370
    23712371  class="message";
     
    23992399}
    24002400
    2401 char *owl_command_smartzpunt(int argc, char **argv, char *buff)
     2401char *owl_command_smartzpunt(int argc, const char *const *argv, const char *buff)
    24022402{
    24032403  if (argc == 1) {
     
    24112411}
    24122412
    2413 char *owl_command_punt(int argc, char **argv, char *buff)
     2413char *owl_command_punt(int argc, const char *const *argv, const char *buff)
    24142414{
    24152415  owl_command_punt_unpunt(argc, argv, buff, 0);
     
    24172417}
    24182418
    2419 char *owl_command_unpunt(int argc, char **argv, char *buff)
     2419char *owl_command_unpunt(int argc, const char *const *argv, const char *buff)
    24202420{
    24212421  owl_command_punt_unpunt(argc, argv, buff, 1);
     
    24232423}
    24242424
    2425 void owl_command_punt_unpunt(int argc, char ** argv, char *buff, int unpunt)
     2425void owl_command_punt_unpunt(int argc, const char *const * argv, const char *buff, int unpunt)
    24262426{
    24272427  owl_list * fl;
     
    24572457
    24582458
    2459 char *owl_command_getview(int argc, char **argv, char *buff)
    2460 {
    2461   char *filtname;
     2459char *owl_command_getview(int argc, const char *const *argv, const char *buff)
     2460{
     2461  const char *filtname;
    24622462  if (argc != 1) {
    24632463    owl_function_makemsg("Wrong number of arguments for %s", argv[0]);
     
    24692469}
    24702470
    2471 char *owl_command_getvar(int argc, char **argv, char *buff)
     2471char *owl_command_getvar(int argc, const char *const *argv, const char *buff)
    24722472{
    24732473  char tmpbuff[1024];
     
    24832483}
    24842484
    2485 char *owl_command_getfilter(int argc, char **argv, char *buf)
     2485char *owl_command_getfilter(int argc, const char *const *argv, const char *buf)
    24862486{
    24872487  owl_filter *f;
     
    24972497}
    24982498
    2499 char *owl_command_search(int argc, char **argv, char *buff)
     2499char *owl_command_search(int argc, const char *const *argv, const char *buff)
    25002500{
    25012501  int direction;
    2502   char *buffstart;
     2502  const char *buffstart;
    25032503
    25042504  direction=OWL_DIRECTION_DOWNWARDS;
     
    25182518}
    25192519
    2520 char *owl_command_setsearch(int argc, char **argv, char *buff)
    2521 {
    2522   char *buffstart;
     2520char *owl_command_setsearch(int argc, const char *const *argv, const char *buff)
     2521{
     2522  const char *buffstart;
    25232523
    25242524  buffstart=skiptokens(buff, 1);
     
    25282528}
    25292529
    2530 char *owl_command_aimlogin(int argc, char **argv, char *buff)
     2530char *owl_command_aimlogin(int argc, const char *const *argv, const char *buff)
    25312531{
    25322532  if ((argc<2) || (argc>3)) {
     
    25492549}
    25502550
    2551 char *owl_command_aimlogout(int argc, char **argv, char *buff)
     2551char *owl_command_aimlogout(int argc, const char *const *argv, const char *buff)
    25522552{
    25532553  /* clear the buddylist */
     
    25582558}
    25592559
    2560 char *owl_command_getstyle(int argc, char **argv, char *buff)
    2561 {
    2562   char *stylename;
     2560char *owl_command_getstyle(int argc, const char *const *argv, const char *buff)
     2561{
     2562  const char *stylename;
    25632563  if (argc != 1) {
    25642564    owl_function_makemsg("Wrong number of arguments for %s", argv[0]);
     
    25702570}
    25712571
    2572 char *owl_command_error(int argc, char **argv, char *buff)
     2572char *owl_command_error(int argc, const char *const *argv, const char *buff)
    25732573{
    25742574    buff = skiptokens(buff, 1);
     
    25772577}
    25782578
    2579 char *owl_command_message(int argc, char **argv, char *buff)
     2579char *owl_command_message(int argc, const char *const *argv, const char *buff)
    25802580{
    25812581    buff = skiptokens(buff, 1);
     
    25882588  owl_message *m;
    25892589  owl_view *v;
    2590   char *cmd;
     2590  const char *cmd;
    25912591
    25922592  v = owl_global_get_current_view(&g);
     
    26222622  owl_message *m;
    26232623  owl_view *v;
    2624   char *cmd;
     2624  const char *cmd;
    26252625
    26262626  v = owl_global_get_current_view(&g);
     
    26802680{
    26812681  owl_history *hist;
    2682   char *ptr;
     2682  const char *ptr;
    26832683
    26842684  hist=owl_editwin_get_history(e);
     
    27012701{
    27022702  owl_history *hist;
    2703   char *ptr;
     2703  const char *ptr;
    27042704
    27052705  hist=owl_editwin_get_history(e);
     
    27152715}
    27162716
    2717 char *owl_command_edit_insert_text(owl_editwin *e, int argc, char **argv, char *buff)
     2717char *owl_command_edit_insert_text(owl_editwin *e, int argc, const char *const *argv, const char *buff)
    27182718{
    27192719  buff = skiptokens(buff, 1);
  • dict.c

    r2b37be2 re19eb97  
    3131 * this element would logically go, and stores the index in pos.
    3232 * Returns 1 if found, else 0. */
    33 int _owl_dict_find_pos(owl_dict *d, char *k, int *pos) {
     33int _owl_dict_find_pos(owl_dict *d, const char *k, int *pos) {
    3434  int lo = 0, hi = d->size;
    3535  while (lo < hi) {
     
    5050
    5151/* returns the value corresponding to key k */
    52 void *owl_dict_find_element(owl_dict *d, char *k) {
     52void *owl_dict_find_element(owl_dict *d, const char *k) {
    5353  int found, pos;
    5454  found = _owl_dict_find_pos(d, k, &pos);
     
    8282   Will return -2 if replace=NULL and match was found.
    8383*/
    84 int owl_dict_insert_element(owl_dict *d, char *k, void *v, void (*free_on_replace)(void *old)) {
     84int owl_dict_insert_element(owl_dict *d, const char *k, void *v, void (*free_on_replace)(void *old)) {
    8585  int pos, found;
    8686  char *dupk;
     
    113113/* Doesn't free the value of the element, but does
    114114 * return it so the caller can free it. */
    115 void *owl_dict_remove_element(owl_dict *d, char *k) {
     115void *owl_dict_remove_element(owl_dict *d, const char *k) {
    116116  int i;
    117117  int pos, found;
  • editwin.c

    r65b2173 re19eb97  
    4545static void oe_restore_excursion(owl_editwin *e, oe_excursion *x);
    4646static void oe_restore_mark_only(owl_editwin *e, oe_excursion *x);
    47 static int oe_count_glyphs(char *s);
     47static int oe_count_glyphs(const char *s);
    4848static int oe_char_width(gunichar c, int column);
    4949static int oe_region_width(owl_editwin *e, int start, int end, int width);
     
    5252static int owl_editwin_limit_maxcols(int v, int maxv);
    5353static int owl_editwin_check_dotsend(owl_editwin *e);
    54 static int owl_editwin_is_char_in(owl_editwin *e, char *set);
     54static int owl_editwin_is_char_in(owl_editwin *e, const char *set);
    5555static gunichar owl_editwin_get_char_at_point(owl_editwin *e);
    56 static int owl_editwin_replace_internal(owl_editwin *e, int replace, char *s);
    57 static char *oe_copy_buf(owl_editwin *e, char *buf, int len);
     56static int owl_editwin_replace_internal(owl_editwin *e, int replace, const char *s);
     57static const char *oe_copy_buf(owl_editwin *e, const char *buf, int len);
    5858static int oe_copy_region(owl_editwin *e);
    5959static char *oe_chunk(owl_editwin *e, int start, int end);
     
    7171}
    7272
    73 static int oe_count_glyphs(char *s)
     73static int oe_count_glyphs(const char *s)
    7474{
    7575  int count = 0;
    76   char *p;
     76  const char *p;
    7777
    7878  for(p = s; *p != 0; p = g_utf8_find_next_char(p, NULL))
     
    175175}
    176176
    177 void owl_editwin_set_command(owl_editwin *e, char *command)
     177void owl_editwin_set_command(owl_editwin *e, const char *command)
    178178{
    179179  if(e->command) owl_free(e->command);
     
    181181}
    182182
    183 char *owl_editwin_get_command(owl_editwin *e)
     183const char *owl_editwin_get_command(owl_editwin *e)
    184184{
    185185  if(e->command) return e->command;
     
    230230 * previous text (including locked text) will be overwritten
    231231 */
    232 void owl_editwin_set_locktext(owl_editwin *e, char *text)
     232void owl_editwin_set_locktext(owl_editwin *e, const char *text)
    233233{
    234234  oe_set_index(e, 0);
     
    378378}
    379379
    380 static inline char *oe_next_point(owl_editwin *e, char *p)
    381 {
    382   char *boundary = e->buff + e->bufflen + 1;
    383   char *q;
     380static inline const char *oe_next_point(owl_editwin *e, const char *p)
     381{
     382  const char *boundary = e->buff + e->bufflen + 1;
     383  const char *q;
    384384
    385385  q = g_utf8_find_next_char(p, boundary);
     
    392392}
    393393
    394 static inline char *oe_prev_point(owl_editwin *e, char *p)
    395 {
    396   char *boundary = e->buff + e->lock;
     394static inline const char *oe_prev_point(owl_editwin *e, const char *p)
     395{
     396  const char *boundary = e->buff + e->lock;
    397397
    398398  p = g_utf8_find_prev_char(boundary, p);
     
    422422  int width = 0, cw;
    423423  gunichar c;
    424   char *p;
     424  const char *p;
    425425
    426426  while(1) {
     
    576576}
    577577
    578 int owl_editwin_replace_region(owl_editwin *e, char *s)
     578int owl_editwin_replace_region(owl_editwin *e, const char *s)
    579579{
    580580  oe_excursion x;
     
    594594
    595595/* replace 'replace' characters at the point with s, returning the change in size */
    596 int owl_editwin_replace(owl_editwin *e, int replace, char *s)
     596int owl_editwin_replace(owl_editwin *e, int replace, const char *s)
    597597{
    598598  int start, end, i;
    599   char *p;
     599  const char *p;
    600600
    601601  if (!g_utf8_validate(s, -1, NULL)) {
     
    615615}
    616616
    617 static int owl_editwin_replace_internal(owl_editwin *e, int replace, char *s)
     617static int owl_editwin_replace_internal(owl_editwin *e, int replace, const char *s)
    618618{
    619619  int start, end, free, need, size, change;
     
    694694void owl_editwin_transpose_chars(owl_editwin *e)
    695695{
    696   char *middle, *end, *start;
     696  const char *middle, *end, *start;
    697697  char *tmp;
    698698
     
    728728 * right
    729729 */
    730 void owl_editwin_insert_string(owl_editwin *e, char *s)
     730void owl_editwin_insert_string(owl_editwin *e, const char *s)
    731731{
    732732  owl_editwin_replace(e, 0, s);
     
    751751int owl_editwin_point_move(owl_editwin *e, int delta)
    752752{
    753   char *p;
     753  const char *p;
    754754  int change, d = 0;
    755755
     
    801801}
    802802
    803 static int owl_editwin_is_char_in(owl_editwin *e, char *set)
    804 {
    805   char *p;
     803static int owl_editwin_is_char_in(owl_editwin *e, const char *set)
     804{
     805  const char *p;
    806806
    807807  for (p = set; *p != 0; p = g_utf8_find_next_char(p, NULL))
     
    811811}
    812812
    813 int owl_editwin_move_if_in(owl_editwin *e, int delta, char *set)
     813int owl_editwin_move_if_in(owl_editwin *e, int delta, const char *set)
    814814{
    815815  int change, distance = 0;
     
    823823}
    824824
    825 int owl_editwin_move_if_not_in(owl_editwin *e, int delta, char *set)
     825int owl_editwin_move_if_not_in(owl_editwin *e, int delta, const char *set)
    826826{
    827827  int change, distance = 0;
     
    10301030}
    10311031
    1032 static char *oe_copy_buf(owl_editwin *e, char *buf, int len)
     1032static const char *oe_copy_buf(owl_editwin *e, const char *buf, int len)
    10331033{
    10341034  char *p;
     
    10481048static int oe_copy_region(owl_editwin *e)
    10491049{
    1050   char *p;
     1050  const char *p;
    10511051  int start, end;
    10521052
     
    12371237static int oe_region_width(owl_editwin *e, int start, int end, int offset)
    12381238{
    1239   char *p;
     1239  const char *p;
    12401240  int width = offset;
    12411241 
     
    13171317}
    13181318
    1319 char *owl_editwin_get_text(owl_editwin *e)
     1319const char *owl_editwin_get_text(owl_editwin *e)
    13201320{
    13211321  return(e->buff+e->lock);
  • errqueue.c

    rec6ff52 re19eb97  
    66}
    77
    8 void owl_errqueue_append_err(owl_errqueue *eq, char *msg)
     8void owl_errqueue_append_err(owl_errqueue *eq, const char *msg)
    99{
    1010  owl_list_append_element(&(eq->errlist), owl_strdup(msg));
  • filter.c

    rc529ac8 re19eb97  
    22#include "owl.h"
    33
    4 int owl_filter_init_fromstring(owl_filter *f, char *name, char *string)
     4int owl_filter_init_fromstring(owl_filter *f, const char *name, const char *string)
    55{
    66  char **argv;
     
    1313}
    1414
    15 int owl_filter_init(owl_filter *f, char *name, int argc, char **argv)
     15int owl_filter_init(owl_filter *f, const char *name, int argc, const char *const *argv)
    1616{
    1717  f->name=owl_strdup(name);
     
    5656/* A primitive expression is one without any toplevel ``and'' or ``or''s*/
    5757
    58 static owl_filterelement * owl_filter_parse_primitive_expression(int argc, char **argv, int *next)
     58static owl_filterelement * owl_filter_parse_primitive_expression(int argc, const char *const *argv, int *next)
    5959{
    6060  owl_filterelement *fe, *op;
     
    112112}
    113113
    114 owl_filterelement * owl_filter_parse_expression(int argc, char **argv, int *next)
     114owl_filterelement * owl_filter_parse_expression(int argc, const char *const *argv, int *next)
    115115{
    116116  int i = 0, skip;
     
    151151}
    152152
    153 char *owl_filter_get_name(owl_filter *f)
     153const char *owl_filter_get_name(owl_filter *f)
    154154{
    155155  return(f->name);
     
    270270#ifdef OWL_INCLUDE_REG_TESTS
    271271
    272 int owl_filter_test_string(char * filt, owl_message *m, int shouldmatch) /* noproto */ {
     272int owl_filter_test_string(const char * filt, owl_message *m, int shouldmatch) /* noproto */ {
    273273  owl_filter f;
    274274  int ok;
  • filterelement.c

    r65b2173 re19eb97  
    11#include "owl.h"
    22
    3 static char * owl_filterelement_get_field(owl_message *m, char * field)
    4 {
    5   char *match;
     3static const char * owl_filterelement_get_field(owl_message *m, const char * field)
     4{
     5  const char *match;
    66  if (!strcasecmp(field, "class")) {
    77    match=owl_message_get_class(m);
     
    6060static int owl_filterelement_match_re(owl_filterelement *fe, owl_message *m)
    6161{
    62   char * val = owl_filterelement_get_field(m, fe->field);
     62  const char * val = owl_filterelement_get_field(m, fe->field);
    6363  return !owl_regex_compare(&(fe->re), val, NULL, NULL);
    6464}
     
    7979static int owl_filterelement_match_perl(owl_filterelement *fe, owl_message *m)
    8080{
    81   char *subname;
     81  const char *subname;
    8282  char *perlrv;
    8383  int   tf=0;
     
    137137static void owl_filterelement_print_re(owl_filterelement *fe, GString *buf)
    138138{
    139   char *re, *q;
     139  const char *re, *q;
    140140  g_string_append(buf, fe->field);
    141141  g_string_append(buf, " ");
     
    212212}
    213213
    214 int owl_filterelement_create_re(owl_filterelement *fe, char *field, char *re)
     214int owl_filterelement_create_re(owl_filterelement *fe, const char *field, const char *re)
    215215{
    216216  owl_filterelement_create(fe);
     
    226226}
    227227
    228 void owl_filterelement_create_filter(owl_filterelement *fe, char *name)
     228void owl_filterelement_create_filter(owl_filterelement *fe, const char *name)
    229229{
    230230  owl_filterelement_create(fe);
     
    234234}
    235235
    236 void owl_filterelement_create_perl(owl_filterelement *fe, char *name)
     236void owl_filterelement_create_perl(owl_filterelement *fe, const char *name)
    237237{
    238238  owl_filterelement_create(fe);
  • fmtext.c

    r65b2173 re19eb97  
    4343 * 'color'
    4444 */
    45 void owl_fmtext_append_attr(owl_fmtext *f, char *text, char attr, short fgcolor, short bgcolor)
     45void owl_fmtext_append_attr(owl_fmtext *f, const char *text, char attr, short fgcolor, short bgcolor)
    4646{
    4747  char attrbuff[6];
     
    8383
    8484/* Append normal, uncolored text 'text' to 'f' */
    85 void owl_fmtext_append_normal(owl_fmtext *f, char *text)
     85void owl_fmtext_append_normal(owl_fmtext *f, const char *text)
    8686{
    8787  owl_fmtext_append_attr(f, text, OWL_FMTEXT_ATTR_NONE, OWL_COLOR_DEFAULT, OWL_COLOR_DEFAULT);
     
    8989
    9090/* Append normal, uncolored text specified by format string to 'f' */
    91 void owl_fmtext_appendf_normal(owl_fmtext *f, char *fmt, ...)
     91void owl_fmtext_appendf_normal(owl_fmtext *f, const char *fmt, ...)
    9292{
    9393  va_list ap;
     
    103103
    104104/* Append normal text 'text' to 'f' with color 'color' */
    105 void owl_fmtext_append_normal_color(owl_fmtext *f, char *text, int fgcolor, int bgcolor)
     105void owl_fmtext_append_normal_color(owl_fmtext *f, const char *text, int fgcolor, int bgcolor)
    106106{
    107107  owl_fmtext_append_attr(f, text, OWL_FMTEXT_ATTR_NONE, fgcolor, bgcolor);
     
    109109
    110110/* Append bold text 'text' to 'f' */
    111 void owl_fmtext_append_bold(owl_fmtext *f, char *text)
     111void owl_fmtext_append_bold(owl_fmtext *f, const char *text)
    112112{
    113113  owl_fmtext_append_attr(f, text, OWL_FMTEXT_ATTR_BOLD, OWL_COLOR_DEFAULT, OWL_COLOR_DEFAULT);
     
    115115
    116116/* Append reverse video text 'text' to 'f' */
    117 void owl_fmtext_append_reverse(owl_fmtext *f, char *text)
     117void owl_fmtext_append_reverse(owl_fmtext *f, const char *text)
    118118{
    119119  owl_fmtext_append_attr(f, text, OWL_FMTEXT_ATTR_REVERSE, OWL_COLOR_DEFAULT, OWL_COLOR_DEFAULT);
     
    121121
    122122/* Append reversed and bold, uncolored text 'text' to 'f' */
    123 void owl_fmtext_append_reversebold(owl_fmtext *f, char *text)
     123void owl_fmtext_append_reversebold(owl_fmtext *f, const char *text)
    124124{
    125125  owl_fmtext_append_attr(f, text, OWL_FMTEXT_ATTR_REVERSE | OWL_FMTEXT_ATTR_BOLD, OWL_COLOR_DEFAULT, OWL_COLOR_DEFAULT);
     
    172172void _owl_fmtext_scan_attributes(owl_fmtext *f, int start, char *attr, short *fgcolor, short *bgcolor) /*noproto*/
    173173{
    174   char *p;
     174  const char *p;
    175175  p = strchr(f->textbuff, OWL_FMTEXT_UC_STARTBYTE_UTF8);
    176176  while (p && p < f->textbuff + start) {
     
    382382int owl_fmtext_truncate_lines(owl_fmtext *in, int aline, int lines, owl_fmtext *out)
    383383{
    384   char *ptr1, *ptr2;
     384  const char *ptr1, *ptr2;
    385385  int i, offset;
    386386 
     
    426426void owl_fmtext_truncate_cols(owl_fmtext *in, int acol, int bcol, owl_fmtext *out)
    427427{
    428   char *ptr_s, *ptr_e, *ptr_c, *last;
     428  const char *ptr_s, *ptr_e, *ptr_c, *last;
    429429  int col, st, padding, chwidth;
    430430
     
    517517}
    518518
    519 char *owl_fmtext_get_text(owl_fmtext *f)
     519const char *owl_fmtext_get_text(owl_fmtext *f)
    520520{
    521521  return(f->textbuff);
     
    565565 * formatting syntax to set appropriate attributes.
    566566 */
    567 void owl_fmtext_append_ztext(owl_fmtext *f, char *text)
     567void owl_fmtext_append_ztext(owl_fmtext *f, const char *text)
    568568{
    569569  int stacksize, curattrs, curcolor;
    570   char *ptr, *txtptr, *tmpptr;
     570  const char *ptr, *txtptr, *tmpptr;
    571571  char *buff;
    572572  int attrstack[32], chrstack[32], colorstack[32];
     
    770770 * If format_fn is specified, passes it the list element value
    771771 * and it will return a string which this needs to free. */
    772 void owl_fmtext_append_list(owl_fmtext *f, owl_list *l, char *join_with, char *(format_fn)(char *))
     772void owl_fmtext_append_list(owl_fmtext *f, owl_list *l, const char *join_with, char *(format_fn)(const char *))
    773773{
    774774  int i, size;
    775   char *elem;
     775  const char *elem;
    776776  char *text;
    777777
  • functions.c

    r65b2173 re19eb97  
    1313#include "owl.h"
    1414
    15 char *owl_function_command(char *cmdbuff)
     15char *owl_function_command(const char *cmdbuff)
    1616{
    1717  owl_function_debugmsg("executing command: %s", cmdbuff);
     
    2020}
    2121
    22 char *owl_function_command_argv(char **argv, int argc)
     22char *owl_function_command_argv(const char *const *argv, int argc)
    2323{
    2424  return owl_cmddict_execute_argv(owl_global_get_cmddict(&g),
     
    2727}
    2828
    29 void owl_function_command_norv(char *cmdbuff)
     29void owl_function_command_norv(const char *cmdbuff)
    3030{
    3131  char *rv;
     
    3434}
    3535
    36 void owl_function_command_alias(char *alias_from, char *alias_to)
     36void owl_function_command_alias(const char *alias_from, const char *alias_to)
    3737{
    3838  owl_cmddict_add_alias(owl_global_get_cmddict(&g), alias_from, alias_to);
    3939}
    4040
    41 owl_cmd *owl_function_get_cmd(char *name)
     41owl_cmd *owl_function_get_cmd(const char *name)
    4242{
    4343  return owl_cmddict_find(owl_global_get_cmddict(&g), name);
     
    6060}
    6161
    62 void owl_function_show_view(char *viewname)
     62void owl_function_show_view(const char *viewname)
    6363{
    6464  owl_view *v;
     
    9292}
    9393
    94 char *owl_function_style_describe(char *name) {
    95   char *desc;
     94char *owl_function_style_describe(const char *name) {
     95  const char *desc;
    9696  char *s;
    9797  owl_style *style;
     
    108108}
    109109
    110 char *owl_function_cmd_describe(char *name)
     110char *owl_function_cmd_describe(const char *name)
    111111{
    112112  owl_cmd *cmd = owl_cmddict_find(owl_global_get_cmddict(&g), name);
     
    115115}
    116116
    117 void owl_function_show_command(char *name)
     117void owl_function_show_command(const char *name)
    118118{
    119119  owl_function_help_for_command(name);
     
    122122void owl_function_show_license()
    123123{
    124   char *text;
     124  const char *text;
    125125
    126126  text=""
     
    168168void owl_function_show_quickstart()
    169169{
    170     char *message =
     170    const char *message =
    171171    "Move between messages with the arrow keys, and press 'r' to reply.\n"
    172172    "For more info, press 'h' or visit http://barnowl.mit.edu/\n\n"
     
    199199 * and redisplay if necessary.
    200200 */
    201 void owl_function_adminmsg(char *header, char *body)
     201void owl_function_adminmsg(const char *header, const char *body)
    202202{
    203203  owl_message *m;
     
    226226 * that.
    227227 */
    228 owl_message *owl_function_make_outgoing_zephyr(char *body, char *zwriteline, char *zsig)
     228owl_message *owl_function_make_outgoing_zephyr(const char *body, const char *zwriteline, const char *zsig)
    229229{
    230230  owl_message *m;
     
    247247 * owl_global_messagequeue_addmsg() for that .
    248248 */
    249 owl_message *owl_function_make_outgoing_aim(char *body, char *to)
     249owl_message *owl_function_make_outgoing_aim(const char *body, const char *to)
    250250{
    251251  owl_message *m;
     
    268268 * owl_global_messagequeue_addmsg() for that.
    269269 */
    270 owl_message *owl_function_make_outgoing_loopback(char *body)
     270owl_message *owl_function_make_outgoing_loopback(const char *body)
    271271{
    272272  owl_message *m;
     
    280280}
    281281
    282 void owl_function_zwrite_setup(char *line)
     282void owl_function_zwrite_setup(const char *line)
    283283{
    284284  owl_editwin *e;
     
    325325}
    326326
    327 void owl_function_aimwrite_setup(char *line)
     327void owl_function_aimwrite_setup(const char *line)
    328328{
    329329  owl_editwin *e;
     
    389389 * the message is expected to be set from the zwrite line itself
    390390 */
    391 void owl_function_zwrite(char *line, char *msg)
     391void owl_function_zwrite(const char *line, const char *msg)
    392392{
    393393  owl_zwrite z;
    394   char *mymsg;
     394  const char *mymsg;
    395395  owl_message *m;
    396396
     
    429429 * the message is expected to be set from the zwrite line itself
    430430 */
    431 void owl_function_zcrypt(char *line, char *msg)
     431void owl_function_zcrypt(const char *line, const char *msg)
    432432{
    433433  owl_zwrite z;
    434   char *mymsg;
     434  const char *mymsg;
    435435  char *cryptmsg;
    436436  owl_message *m;
     
    498498}
    499499
    500 void owl_function_aimwrite(char *line, char *msg)
     500void owl_function_aimwrite(const char *line, const char *msg)
    501501{
    502502  int ret;
    503   char *to;
     503  const char *to;
    504504  char *format_msg;
    505505  owl_message *m;
     
    531531}
    532532
    533 void owl_function_send_aimawymsg(char *to, char *msg)
     533void owl_function_send_aimawymsg(const char *to, const char *msg)
    534534{
    535535  int ret;
     
    563563}
    564564
    565 void owl_function_loopwrite(char *msg)
     565void owl_function_loopwrite(const char *msg)
    566566{
    567567  owl_message *min, *mout;
     
    590590 * If last_if_none, will stop at the last message in the view
    591591 * if no matching messages are found.  */
    592 void owl_function_nextmsg_full(char *filter, int skip_deleted, int last_if_none)
     592void owl_function_nextmsg_full(const char *filter, int skip_deleted, int last_if_none)
    593593{
    594594  int curmsg, i, viewsize, found;
     
    643643}
    644644
    645 void owl_function_prevmsg_full(char *filter, int skip_deleted, int first_if_none)
     645void owl_function_prevmsg_full(const char *filter, int skip_deleted, int first_if_none)
    646646{
    647647  int curmsg, i, viewsize, found;
     
    881881 * only, no error message is printed.
    882882 */
    883 void owl_function_loadsubs(char *file)
     883void owl_function_loadsubs(const char *file)
    884884{
    885885  int ret, ret2;
    886   char *foo;
     886  const char *foo;
    887887  char *path;
    888888
     
    914914}
    915915
    916 void owl_function_loadloginsubs(char *file)
     916void owl_function_loadloginsubs(const char *file)
    917917{
    918918  int ret;
     
    934934}
    935935
    936 void owl_function_aimlogin(char *user, char *passwd) {
     936void owl_function_aimlogin(const char *user, const char *passwd) {
    937937  int ret;
    938938
     
    12361236}
    12371237
    1238 void owl_function_debugmsg(char *fmt, ...)
     1238void owl_function_debugmsg(const char *fmt, ...)
    12391239{
    12401240  FILE *file;
     
    12711271}
    12721272
    1273 int owl_function_subscribe(char *class, char *inst, char *recip)
     1273int owl_function_subscribe(const char *class, const char *inst, const char *recip)
    12741274{
    12751275  int ret;
     
    12841284}
    12851285
    1286 void owl_function_unsubscribe(char *class, char *inst, char *recip)
     1286void owl_function_unsubscribe(const char *class, const char *inst, const char *recip)
    12871287{
    12881288  int ret;
     
    13261326}
    13271327
    1328 void owl_function_popless_text(char *text)
     1328void owl_function_popless_text(const char *text)
    13291329{
    13301330  owl_popwin *pw;
     
    13601360}
    13611361
    1362 void owl_function_popless_file(char *filename)
     1362void owl_function_popless_file(const char *filename)
    13631363{
    13641364  owl_fmtext fm;
     
    16651665void owl_function_printallvars()
    16661666{
    1667   char *name;
     1667  const char *name;
    16681668  char var[LINE];
    16691669  owl_list varnames;
     
    16951695  owl_fmtext fm; 
    16961696  int i, numvarnames;
    1697   char *varname;
     1697  const char *varname;
    16981698
    16991699  owl_fmtext_init_null(&fm);
     
    17131713}
    17141714
    1715 void owl_function_show_variable(char *name)
     1715void owl_function_show_variable(const char *name)
    17161716{
    17171717  owl_fmtext fm; 
     
    19391939}
    19401940
    1941 void owl_function_zlocate(int argc, char **argv, int auth)
     1941void owl_function_zlocate(int argc, const char *const *argv, int auth)
    19421942{
    19431943  owl_fmtext fm;
     
    19581958}
    19591959
    1960 void owl_function_start_command(char *line)
     1960void owl_function_start_command(const char *line)
    19611961{
    19621962  owl_editwin *tw;
     
    19771977}
    19781978
    1979 void owl_function_start_question(char *line)
     1979void owl_function_start_question(const char *line)
    19801980{
    19811981  owl_editwin *tw;
     
    19941994}
    19951995
    1996 void owl_function_start_password(char *line)
     1996void owl_function_start_password(const char *line)
    19971997{
    19981998  owl_editwin *tw;
     
    20122012}
    20132013
    2014 char *owl_function_exec(int argc, char **argv, char *buff, int type)
     2014char *owl_function_exec(int argc, const char *const *argv, const char *buff, int type)
    20152015{
    20162016  /* if type == 1 display in a popup
     
    20192019   * else display in a popup
    20202020   */
    2021   char *redirect = " 2>&1 < /dev/null";
     2021  const char *redirect = " 2>&1 < /dev/null";
    20222022  char *newbuff;
    20232023  char *out, buff2[1024];
     
    20672067}
    20682068
    2069 char *owl_function_perl(int argc, char **argv, char *buff, int type)
     2069char *owl_function_perl(int argc, const char *const *argv, const char *buff, int type)
    20702070{
    20712071  /* if type == 1 display in a popup
     
    21042104 * should have the pointer.
    21052105 */
    2106 void owl_function_change_currentview_filter(char *filtname)
     2106void owl_function_change_currentview_filter(const char *filtname)
    21072107{
    21082108  owl_view *v;
     
    21522152 * with a new definition.
    21532153 */
    2154 void owl_function_create_filter(int argc, char **argv)
     2154void owl_function_create_filter(int argc, const char *const *argv)
    21552155{
    21562156  owl_filter *f;
     
    22442244 * Returns the name of the negated filter, which the caller must free.
    22452245 */
    2246 char *owl_function_create_negative_filter(char *filtername)
     2246char *owl_function_create_negative_filter(const char *filtername)
    22472247{
    22482248  char *newname;
    22492249  owl_filter *tmpfilt;
    2250   char *argv[5];
     2250  const char *argv[5];
    22512251
    22522252  owl_function_debugmsg("owl_function_create_negative_filter");
     
    23002300}
    23012301
    2302 void owl_function_show_filter(char *name)
     2302void owl_function_show_filter(const char *name)
    23032303{
    23042304  owl_filter *f;
     
    23482348 * name of the filter, which the caller must free.
    23492349 */
    2350 char *owl_function_classinstfilt(char *c, char *i)
     2350char *owl_function_classinstfilt(const char *c, const char *i)
    23512351{
    23522352  owl_filter *f;
     
    24262426 * the filter, which the caller must free.
    24272427 */
    2428 char *owl_function_zuserfilt(char *user)
     2428char *owl_function_zuserfilt(const char *user)
    24292429{
    24302430  owl_filter *f;
     
    24732473 * Returns the name of the filter, which the caller must free.
    24742474 */
    2475 char *owl_function_aimuserfilt(char *user)
     2475char *owl_function_aimuserfilt(const char *user)
    24762476{
    24772477  owl_filter *f;
     
    25092509}
    25102510
    2511 char *owl_function_typefilt(char *type)
     2511char *owl_function_typefilt(const char *type)
    25122512{
    25132513  owl_filter *f;
     
    25822582  owl_message *m;
    25832583  char *zperson, *filtname=NULL;
    2584   char *argv[1];
     2584  const char *argv[1];
    25852585 
    25862586  v=owl_global_get_current_view(&g);
     
    26532653  owl_view *v;
    26542654  owl_message *m;
    2655   char *cmdprefix, *mclass, *minst;
     2655  const char *cmdprefix, *mclass, *minst;
    26562656  char *cmd;
    26572657 
     
    27022702 * be 'color'
    27032703 */
    2704 void owl_function_color_current_filter(char *fgcolor, char *bgcolor)
    2705 {
    2706   char *name;
     2704void owl_function_color_current_filter(const char *fgcolor, const char *bgcolor)
     2705{
     2706  const char *name;
    27072707
    27082708  name=owl_view_get_filtname(owl_global_get_current_view(&g));
     
    27142714 * the "all" filter, return -2.  Return 0 on success
    27152715 */
    2716 int owl_function_color_filter(char *filtname, char *fgcolor, char *bgcolor)
     2716int owl_function_color_filter(const char *filtname, const char *fgcolor, const char *bgcolor)
    27172717{
    27182718  owl_filter *f;
     
    27972797 *   if direction==1 then unpunt
    27982798 */
    2799 void owl_function_zpunt(char *class, char *inst, char *recip, int direction)
     2799void owl_function_zpunt(const char *class, const char *inst, const char *recip, int direction)
    28002800{
    28012801  char *puntexpr, *classexpr, *instexpr, *recipexpr;
     
    28442844}
    28452845
    2846 void owl_function_punt(char *filter, int direction)
     2846void owl_function_punt(const char *filter, int direction)
    28472847{
    28482848  owl_filter *f;
     
    28902890}
    28912891
    2892 void owl_function_activate_keymap(char *keymap)
     2892void owl_function_activate_keymap(const char *keymap)
    28932893{
    28942894  if (!owl_keyhandler_activate(owl_global_get_keyhandler(&g), keymap)) {
     
    29042904  owl_keyhandler *kh;
    29052905  int i, numkm;
    2906   char *kmname;
     2906  const char *kmname;
    29072907
    29082908  kh = owl_global_get_keyhandler(&g);
     
    29282928}
    29292929
    2930 char *owl_function_keymap_summary(char *name)
     2930char *owl_function_keymap_summary(const char *name)
    29312931{
    29322932  owl_keymap *km
     
    29372937
    29382938/* TODO: implement for real */
    2939 void owl_function_show_keymap(char *name)
     2939void owl_function_show_keymap(const char *name)
    29402940{
    29412941  owl_fmtext fm;
     
    29532953}
    29542954
    2955 void owl_function_help_for_command(char *cmdname)
     2955void owl_function_help_for_command(const char *cmdname)
    29562956{
    29572957  owl_fmtext fm;
     
    29632963}
    29642964
    2965 void owl_function_search_start(char *string, int direction)
     2965void owl_function_search_start(const char *string, int direction)
    29662966{
    29672967  /* direction is OWL_DIRECTION_DOWNWARDS or OWL_DIRECTION_UPWARDS or
     
    30593059/* strips formatting from ztext and returns the unformatted text.
    30603060 * caller is responsible for freeing. */
    3061 char *owl_function_ztext_stylestrip(char *zt)
     3061char *owl_function_ztext_stylestrip(const char *zt)
    30623062{
    30633063  owl_fmtext fm;
     
    30723072
    30733073/* Popup a buddylisting.  If filename is NULL use the default .anyone */
    3074 void owl_function_buddylist(int aim, int zephyr, char *filename)
     3074void owl_function_buddylist(int aim, int zephyr, const char *filename)
    30753075{
    30763076  int i, j, idle;
     
    30833083  int x;
    30843084  owl_list anyone;
    3085   char *user;
     3085  const char *user;
    30863086  char *tmp;
    30873087  ZLocations_t location[200];
     
    31893189
    31903190/* Dump messages in the current view to the file 'filename'. */
    3191 void owl_function_dump(char *filename)
     3191void owl_function_dump(const char *filename)
    31923192{
    31933193  int i, j, count;
     
    32993299 * startupfile.
    33003300 */
    3301 void owl_function_addstartup(char *buff)
     3301void owl_function_addstartup(const char *buff)
    33023302{
    33033303  FILE *file;
    3304   char *filename;
     3304  const char *filename;
    33053305
    33063306  filename=owl_global_get_startupfile(&g);
     
    33213321
    33223322/* Remove the specified command from the startup file. */
    3323 void owl_function_delstartup(char *buff)
    3324 {
    3325   char *filename;
     3323void owl_function_delstartup(const char *buff)
     3324{
     3325  const char *filename;
    33263326  filename=owl_global_get_startupfile(&g);
    33273327  owl_util_file_deleteline(filename, buff, 1);
     
    33313331 * is NULL, use the default owl startup commands file.
    33323332 */
    3333 void owl_function_source(char *filename)
     3333void owl_function_source(const char *filename)
    33343334{
    33353335  char *path;
     
    33603360}
    33613361
    3362 void owl_function_change_style(owl_view *v, char *stylename)
     3362void owl_function_change_style(owl_view *v, const char *stylename)
    33633363{
    33643364  owl_style *s;
     
    33943394}
    33953395
    3396 void owl_function_error(char *fmt, ...)
     3396void owl_function_error(const char *fmt, ...)
    33973397{
    33983398  va_list ap;
    33993399  char *buff;
    3400   char *nl;
     3400  const char *nl;
    34013401
    34023402  va_start(ap, fmt);
     
    34163416}
    34173417
    3418 void owl_function_log_err(char *string)
     3418void owl_function_log_err(const char *string)
    34193419{
    34203420  char *date;
     
    34443444}
    34453445
    3446 void owl_function_makemsg(char *fmt, ...)
     3446void owl_function_makemsg(const char *fmt, ...)
    34473447{
    34483448  va_list ap;
     
    34743474  owl_message *m;
    34753475  owl_zbuddylist *zbl;
    3476   char *user;
     3476  const char *user;
    34773477  ZLocations_t location[200];
    34783478  int numlocs, ret;
     
    35253525}
    35263526
    3527 void owl_function_aimsearch_results(char *email, owl_list *namelist)
     3527void owl_function_aimsearch_results(const char *email, owl_list *namelist)
    35283528{
    35293529  owl_fmtext fm;
  • global.c

    r65b2173 re19eb97  
    269269/* buffercommand */
    270270
    271 void owl_global_set_buffercommand(owl_global *g, char *command) {
     271void owl_global_set_buffercommand(owl_global *g, const char *command) {
    272272  owl_editwin_set_command(owl_global_get_typwin(g), command);
    273273}
    274274
    275 char *owl_global_get_buffercommand(owl_global *g) {
     275const char *owl_global_get_buffercommand(owl_global *g) {
    276276  return owl_editwin_get_command(owl_global_get_typwin(g));
    277277}
     
    351351}
    352352
    353 char *owl_global_get_homedir(owl_global *g) {
     353const char *owl_global_get_homedir(owl_global *g) {
    354354  if (g->homedir) return(g->homedir);
    355355  return("/");
    356356}
    357357
    358 char *owl_global_get_confdir(owl_global *g) {
     358const char *owl_global_get_confdir(owl_global *g) {
    359359  if (g->confdir) return(g->confdir);
    360360  return("/");
     
    364364 * Setting this also sets startupfile to confdir/startup
    365365 */
    366 void owl_global_set_confdir(owl_global *g, char *cd) {
     366void owl_global_set_confdir(owl_global *g, const char *cd) {
    367367  free(g->confdir);
    368368  g->confdir = owl_strdup(cd);
     
    371371}
    372372
    373 char *owl_global_get_startupfile(owl_global *g) {
     373const char *owl_global_get_startupfile(owl_global *g) {
    374374  if(g->startupfile) return(g->startupfile);
    375375  return("/");
     
    534534}
    535535
    536 char *owl_global_get_hostname(owl_global *g) {
     536const char *owl_global_get_hostname(owl_global *g) {
    537537  if (g->thishost) return(g->thishost);
    538538  return("");
     
    577577/* startup args */
    578578
    579 void owl_global_set_startupargs(owl_global *g, int argc, char **argv) {
     579void owl_global_set_startupargs(owl_global *g, int argc, const char *const *argv) {
    580580  int i, len;
    581581
     
    595595}
    596596
    597 char *owl_global_get_startupargs(owl_global *g) {
     597const char *owl_global_get_startupargs(owl_global *g) {
    598598  if (g->startupargs) return(g->startupargs);
    599599  return("");
     
    616616}
    617617
    618 owl_filter *owl_global_get_filter(owl_global *g, char *name) {
     618owl_filter *owl_global_get_filter(owl_global *g, const char *name) {
    619619  int i, j;
    620620  owl_filter *f;
     
    634634}
    635635
    636 void owl_global_remove_filter(owl_global *g, char *name) {
     636void owl_global_remove_filter(owl_global *g, const char *name) {
    637637  int i, j;
    638638  owl_filter *f;
     
    741741}
    742742
    743 char *owl_global_get_aim_screenname(owl_global *g)
     743const char *owl_global_get_aim_screenname(owl_global *g)
    744744{
    745745  if (owl_global_is_aimloggedin(g)) {
     
    749749}
    750750
    751 char *owl_global_get_aim_screenname_for_filters(owl_global *g)
     751const char *owl_global_get_aim_screenname_for_filters(owl_global *g)
    752752{
    753753  if (owl_global_is_aimloggedin(g)) {
     
    757757}
    758758
    759 void owl_global_set_aimloggedin(owl_global *g, char *screenname)
     759void owl_global_set_aimloggedin(owl_global *g, const char *screenname)
    760760{
    761761  char *sn_escaped;
    762   char *quote;
     762  const char *quote;
    763763  g->aim_loggedin=1;
    764764  if (g->aim_screenname) owl_free(g->aim_screenname);
     
    843843/* Return the style with name 'name'.  If it does not exist return
    844844 * NULL */
    845 owl_style *owl_global_get_style_by_name(owl_global *g, char *name)
     845owl_style *owl_global_get_style_by_name(owl_global *g, const char *name)
    846846{
    847847  return owl_dict_find_element(&(g->styledict), name);
     
    942942}
    943943
    944 char * owl_global_intern(owl_global *g, char * string)
     944const char * owl_global_intern(owl_global *g, const char * string)
    945945{
    946946  return owl_obarray_insert(&(g->obarray), string);
  • help.c

    rd43edd2 re19eb97  
    55{
    66  owl_fmtext fm;
    7   char *varname;
     7  const char *varname;
    88  owl_list varnames;
    99  int i, numvarnames;
  • history.c

    rd43edd2 re19eb97  
    1515}
    1616
    17 char *owl_history_get_prev(owl_history *h)
     17const char *owl_history_get_prev(owl_history *h)
    1818{
    1919
     
    3232}
    3333
    34 char *owl_history_get_next(owl_history *h)
     34const char *owl_history_get_next(owl_history *h)
    3535{
    3636  if (!h) return NULL;
     
    4444}
    4545
    46 void owl_history_store(owl_history *h, char *line)
     46void owl_history_store(owl_history *h, const char *line)
    4747{
    4848  int size;
  • keybinding.c

    rd43edd2 re19eb97  
    1212
    1313/* sets up a new keybinding for a command */
    14 int owl_keybinding_init(owl_keybinding *kb, char *keyseq, char *command, void (*function_fn)(void), char *desc)
     14int owl_keybinding_init(owl_keybinding *kb, const char *keyseq, const char *command, void (*function_fn)(void), const char *desc)
    1515{
    1616  char **ktokens;
     
    100100}
    101101
    102 char *owl_keybinding_get_desc(owl_keybinding *kb)
     102const char *owl_keybinding_get_desc(owl_keybinding *kb)
    103103{
    104104  return kb->desc;
  • keymap.c

    r4d86e06 re19eb97  
    33
    44/* returns 0 on success */
    5 int owl_keymap_init(owl_keymap *km, char *name, char *desc, void (*default_fn)(owl_input), void (*prealways_fn)(owl_input), void (*postalways_fn)(owl_input))
     5int owl_keymap_init(owl_keymap *km, const char *name, const char *desc, void (*default_fn)(owl_input), void (*prealways_fn)(owl_input), void (*postalways_fn)(owl_input))
    66{
    77  if (!name || !desc) return(-1);
     
    3030
    3131/* creates and adds a key binding */
    32 int owl_keymap_create_binding(owl_keymap *km, char *keyseq, char *command, void (*function_fn)(void), char *desc)
     32int owl_keymap_create_binding(owl_keymap *km, const char *keyseq, const char *command, void (*function_fn)(void), const char *desc)
    3333{
    3434  owl_keybinding *kb, *curkb;
     
    103103    char buff[100];
    104104    owl_cmd *cmd;
    105     char *tmpdesc, *desc = "";
     105    const char *tmpdesc, *desc = "";
    106106
    107107    kb = owl_list_get_element(&km->bindings, i);
     
    149149}
    150150
    151 owl_keymap *owl_keyhandler_create_and_add_keymap(owl_keyhandler *kh, char *name, char *desc, void (*default_fn)(owl_input), void (*prealways_fn)(owl_input), void (*postalways_fn)(owl_input))
     151owl_keymap *owl_keyhandler_create_and_add_keymap(owl_keyhandler *kh, const char *name, const char *desc, void (*default_fn)(owl_input), void (*prealways_fn)(owl_input), void (*postalways_fn)(owl_input))
    152152{
    153153  owl_keymap *km;
     
    167167}
    168168
    169 owl_keymap *owl_keyhandler_get_keymap(owl_keyhandler *kh, char *mapname)
     169owl_keymap *owl_keyhandler_get_keymap(owl_keyhandler *kh, const char *mapname)
    170170{
    171171  return owl_dict_find_element(&kh->keymaps, mapname);
     
    187187/* sets the active keymap, which will also reset any key state.
    188188 * returns the new keymap, or NULL on failure. */
    189 owl_keymap *owl_keyhandler_activate(owl_keyhandler *kh, char *mapname)
     189owl_keymap *owl_keyhandler_activate(owl_keyhandler *kh, const char *mapname)
    190190{
    191191  owl_keymap *km;
  • keypress.c

    r6551eae re19eb97  
    55static struct _owl_keypress_specialmap {
    66  int   kj;
    7   char *ks;
     7  const char *ks;
    88} specialmap[] = {
    99#ifdef KEY_CODE_YES
     
    175175
    176176/* returns ERR on failure, else a keycode */
    177 int owl_keypress_fromstring(char *kb)
     177int owl_keypress_fromstring(const char *kb)
    178178{
    179179  struct _owl_keypress_specialmap *sm;
  • logging.c

    r65b2173 re19eb97  
    105105}
    106106
    107 void owl_log_append(owl_message *m, char *filename) {
     107void owl_log_append(owl_message *m, const char *filename) {
    108108    FILE *file;
    109109    file=fopen(filename, "a");
     
    171171
    172172
    173 void owl_log_outgoing_zephyr_error(char *to, char *text)
     173void owl_log_outgoing_zephyr_error(const char *to, const char *text)
    174174{
    175175  FILE *file;
     
    230230{
    231231  char filename[MAXPATHLEN], allfilename[MAXPATHLEN], *logpath;
    232   char *from=NULL;
     232  const char *from=NULL;
    233233  char *frombuff=NULL;
    234234  int len, ch, i, personal;
     
    243243  } else if (owl_message_is_type_jabber(m)) {
    244244    /* This needs to be fixed to handle groupchat */
    245     char* msgtype = owl_message_get_attribute_value(m,"jtype");
     245    const char* msgtype = owl_message_get_attribute_value(m,"jtype");
    246246    if (msgtype && !strcmp(msgtype,"groupchat")) {
    247247      personal = 0;
  • message.c

    r65b2173 re19eb97  
    5555 * name already exists, replace the old value with the new value
    5656 */
    57 void owl_message_set_attribute(owl_message *m, char *attrname, const char *attrvalue)
     57void owl_message_set_attribute(owl_message *m, const char *attrname, const char *attrvalue)
    5858{
    5959  int i, j;
     
    8282 * the attribute does not exist
    8383 */
    84 char *owl_message_get_attribute_value(owl_message *m, char *attrname)
     84const char *owl_message_get_attribute_value(owl_message *m, const char *attrname)
    8585{
    8686  int i, j;
     
    159159}
    160160
    161 void owl_message_set_class(owl_message *m, char *class)
     161void owl_message_set_class(owl_message *m, const char *class)
    162162{
    163163  owl_message_set_attribute(m, "class", class);
    164164}
    165165
    166 char *owl_message_get_class(owl_message *m)
    167 {
    168   char *class;
     166const char *owl_message_get_class(owl_message *m)
     167{
     168  const char *class;
    169169
    170170  class=owl_message_get_attribute_value(m, "class");
     
    173173}
    174174
    175 void owl_message_set_instance(owl_message *m, char *inst)
     175void owl_message_set_instance(owl_message *m, const char *inst)
    176176{
    177177  owl_message_set_attribute(m, "instance", inst);
    178178}
    179179
    180 char *owl_message_get_instance(owl_message *m)
    181 {
    182   char *instance;
     180const char *owl_message_get_instance(owl_message *m)
     181{
     182  const char *instance;
    183183
    184184  instance=owl_message_get_attribute_value(m, "instance");
     
    187187}
    188188
    189 void owl_message_set_sender(owl_message *m, char *sender)
     189void owl_message_set_sender(owl_message *m, const char *sender)
    190190{
    191191  owl_message_set_attribute(m, "sender", sender);
    192192}
    193193
    194 char *owl_message_get_sender(owl_message *m)
    195 {
    196   char *sender;
     194const char *owl_message_get_sender(owl_message *m)
     195{
     196  const char *sender;
    197197
    198198  sender=owl_message_get_attribute_value(m, "sender");
     
    201201}
    202202
    203 void owl_message_set_zsig(owl_message *m, char *zsig)
     203void owl_message_set_zsig(owl_message *m, const char *zsig)
    204204{
    205205  owl_message_set_attribute(m, "zsig", zsig);
    206206}
    207207
    208 char *owl_message_get_zsig(owl_message *m)
    209 {
    210   char *zsig;
     208const char *owl_message_get_zsig(owl_message *m)
     209{
     210  const char *zsig;
    211211
    212212  zsig=owl_message_get_attribute_value(m, "zsig");
     
    215215}
    216216
    217 void owl_message_set_recipient(owl_message *m, char *recip)
     217void owl_message_set_recipient(owl_message *m, const char *recip)
    218218{
    219219  owl_message_set_attribute(m, "recipient", recip);
    220220}
    221221
    222 char *owl_message_get_recipient(owl_message *m)
     222const char *owl_message_get_recipient(owl_message *m)
    223223{
    224224  /* this is stupid for outgoing messages, we need to fix it. */
    225225
    226   char *recip;
     226  const char *recip;
    227227
    228228  recip=owl_message_get_attribute_value(m, "recipient");
     
    236236}
    237237
    238 char *owl_message_get_realm(owl_message *m)
    239 {
    240   char *realm;
     238const char *owl_message_get_realm(owl_message *m)
     239{
     240  const char *realm;
    241241 
    242242  realm=owl_message_get_attribute_value(m, "realm");
     
    245245}
    246246
    247 void owl_message_set_body(owl_message *m, char *body)
     247void owl_message_set_body(owl_message *m, const char *body)
    248248{
    249249  owl_message_set_attribute(m, "body", body);
    250250}
    251251
    252 char *owl_message_get_body(owl_message *m)
    253 {
    254   char *body;
     252const char *owl_message_get_body(owl_message *m)
     253{
     254  const char *body;
    255255
    256256  body=owl_message_get_attribute_value(m, "body");
     
    260260
    261261
    262 void owl_message_set_opcode(owl_message *m, char *opcode)
     262void owl_message_set_opcode(owl_message *m, const char *opcode)
    263263{
    264264  owl_message_set_attribute(m, "opcode", opcode);
    265265}
    266266
    267 char *owl_message_get_opcode(owl_message *m)
    268 {
    269   char *opcode;
     267const char *owl_message_get_opcode(owl_message *m)
     268{
     269  const char *opcode;
    270270
    271271  opcode=owl_message_get_attribute_value(m, "opcode");
     
    288288int owl_message_is_loginout(owl_message *m)
    289289{
    290   char *res;
     290  const char *res;
    291291
    292292  res=owl_message_get_attribute_value(m, "loginout");
     
    297297int owl_message_is_login(owl_message *m)
    298298{
    299   char *res;
     299  const char *res;
    300300
    301301  res=owl_message_get_attribute_value(m, "loginout");
     
    308308int owl_message_is_logout(owl_message *m)
    309309{
    310   char *res;
     310  const char *res;
    311311
    312312  res=owl_message_get_attribute_value(m, "loginout");
     
    323323int owl_message_is_private(owl_message *m)
    324324{
    325   char *res;
     325  const char *res;
    326326
    327327  res=owl_message_get_attribute_value(m, "isprivate");
     
    330330}
    331331
    332 char *owl_message_get_timestr(owl_message *m)
     332const char *owl_message_get_timestr(owl_message *m)
    333333{
    334334  if (m->timestr) return(m->timestr);
     
    356356}
    357357
    358 void owl_message_set_type(owl_message *m, char* type)
     358void owl_message_set_type(owl_message *m, const char* type)
    359359{
    360360  owl_message_set_attribute(m, "type", type);
    361361}
    362362
    363 int owl_message_is_type(owl_message *m, char *type) {
    364   char * t = owl_message_get_attribute_value(m, "type");
     363int owl_message_is_type(owl_message *m, const char *type) {
     364  const char * t = owl_message_get_attribute_value(m, "type");
    365365  if(!t) return 0;
    366366  return !strcasecmp(t, type);
     
    399399}
    400400
    401 char *owl_message_get_text(owl_message *m)
     401const char *owl_message_get_text(owl_message *m)
    402402{
    403403  owl_message_format(m);
     
    462462}
    463463
    464 char *owl_message_get_zwriteline(owl_message *m)
    465 {
    466   char *z = owl_message_get_attribute_value(m, "zwriteline");
     464const char *owl_message_get_zwriteline(owl_message *m)
     465{
     466  const char *z = owl_message_get_attribute_value(m, "zwriteline");
    467467  if (!z) return "";
    468468  return z;
    469469}
    470470
    471 void owl_message_set_zwriteline(owl_message *m, char *line)
     471void owl_message_set_zwriteline(owl_message *m, const char *line)
    472472{
    473473  owl_message_set_attribute(m, "zwriteline", line);
     
    493493#endif
    494494
    495 void owl_message_set_hostname(owl_message *m, char *hostname)
     495void owl_message_set_hostname(owl_message *m, const char *hostname)
    496496{
    497497  m->hostname=owl_global_intern(&g, hostname);
    498498}
    499499
    500 char *owl_message_get_hostname(owl_message *m)
     500const char *owl_message_get_hostname(owl_message *m)
    501501{
    502502  return(m->hostname);
     
    542542
    543543int owl_message_is_answered(owl_message *m) {
    544   char *q;
     544  const char *q;
    545545  if(!owl_message_is_question(m)) return 0;
    546546  q = owl_message_get_attribute_value(m, "question");
     
    568568char *owl_message_get_cc(owl_message *m)
    569569{
    570   char *cur;
     570  const char *cur;
    571571  char *out, *end;
    572572
     
    586586{
    587587  char *cc, *out, *end, *shortuser, *recip;
    588   char *user;
     588  const char *user;
    589589
    590590  cc = owl_message_get_cc(m);
     
    625625}
    626626
    627 char *owl_message_get_type(owl_message *m) {
    628   char * type = owl_message_get_attribute_value(m, "type");
     627const char *owl_message_get_type(owl_message *m) {
     628  const char * type = owl_message_get_attribute_value(m, "type");
    629629  if(!type) {
    630630    return "generic";
     
    633633}
    634634
    635 char *owl_message_get_direction(owl_message *m) {
     635const char *owl_message_get_direction(owl_message *m) {
    636636  switch (m->direction) {
    637637  case OWL_MESSAGE_DIRECTION_IN:
     
    646646}
    647647
    648 int owl_message_parse_direction(char *d) {
     648int owl_message_parse_direction(const char *d) {
    649649  if(!strcmp(d, "in")) {
    650650    return OWL_MESSAGE_DIRECTION_IN;
     
    657657
    658658
    659 char *owl_message_get_login(owl_message *m) {
     659const char *owl_message_get_login(owl_message *m) {
    660660  if (owl_message_is_login(m)) {
    661661    return "login";
     
    668668
    669669
    670 char *owl_message_get_header(owl_message *m) {
     670const char *owl_message_get_header(owl_message *m) {
    671671  return owl_message_get_attribute_value(m, "adminheader");
    672672}
     
    688688 *                 1 it's a login message
    689689 */
    690 void owl_message_create_aim(owl_message *m, char *sender, char *recipient, char *text, int direction, int loginout)
     690void owl_message_create_aim(owl_message *m, const char *sender, const char *recipient, const char *text, int direction, int loginout)
    691691{
    692692  owl_message_init(m);
     
    714714}
    715715
    716 void owl_message_create_admin(owl_message *m, char *header, char *text)
     716void owl_message_create_admin(owl_message *m, const char *header, const char *text)
    717717{
    718718  owl_message_init(m);
     
    723723
    724724/* caller should set the direction */
    725 void owl_message_create_loopback(owl_message *m, char *text)
     725void owl_message_create_loopback(owl_message *m, const char *text)
    726726{
    727727  owl_message_init(m);
     
    737737{
    738738  struct hostent *hent;
    739   char *ptr;
     739  const char *ptr;
    740740  char *tmp, *tmp2;
    741741  int len;
     
    852852
    853853/* If 'direction' is '0' it is a login message, '1' is a logout message. */
    854 void owl_message_create_pseudo_zlogin(owl_message *m, int direction, char *user, char *host, char *time, char *tty)
     854void owl_message_create_pseudo_zlogin(owl_message *m, int direction, const char *user, const char *host, const char *time, const char *tty)
    855855{
    856856  char *longuser;
    857   char *ptr;
     857  const char *ptr;
    858858
    859859#ifdef HAVE_LIBZEPHYR
     
    898898}
    899899
    900 void owl_message_create_from_zwriteline(owl_message *m, char *line, char *body, char *zsig)
     900void owl_message_create_from_zwriteline(owl_message *m, const char *line, const char *body, const char *zsig)
    901901{
    902902  owl_zwrite z;
  • obarray.c

    rfa4562c re19eb97  
    1414 * the index it should be inserted at.
    1515 */
    16 int owl_obarray_lookup(owl_obarray *oa, char * key, char ** val) /*noproto*/
     16int owl_obarray_lookup(owl_obarray *oa, const char * key, const char ** val) /*noproto*/
    1717{
    1818  int first, last, mid;
    19   char * str;
     19  const char * str;
    2020  int cmp;
    2121
     
    4141
    4242/* Returns NULL if the string doesn't exist in the obarray */
    43 char * owl_obarray_find(owl_obarray *oa, char * string)
     43const char * owl_obarray_find(owl_obarray *oa, const char * string)
    4444{
    45   char *v;
     45  const char *v;
    4646  owl_obarray_lookup(oa, string, &v);
    4747  return v;
     
    4949
    5050/* Inserts the string into the obarray if it doesn't exist */
    51 char * owl_obarray_insert(owl_obarray *oa, char * string)
     51const char * owl_obarray_insert(owl_obarray *oa, const char * string)
    5252{
    53   char *v;
     53  const char *v;
    5454  int i;
    5555  i = owl_obarray_lookup(oa, string, &v);
     
    7777int owl_obarray_regtest(void) {
    7878  int numfailed = 0;
    79   char *p,*p2;
     79  const char *p,*p2;
    8080
    8181  owl_obarray oa;
  • owl.c

    r65b2173 re19eb97  
    4444  int newmsgs, nexttimediff;
    4545  struct sigaction sigact;
    46   char *configfile, *tty, **argvsave;
     46  const char *configfile, *tty, *const *argvsave;
    4747  char *perlout, *perlerr;
    48   char *confdir;
     48  const char *confdir;
    4949  owl_filter *f;
    5050  owl_style *s;
    5151  time_t nexttime, now;
    5252  struct tm *today;
    53   char *dir;
     53  const char *dir;
    5454  struct termios tio;
    5555  owl_message *m;
  • owl.h

    rc529ac8 re19eb97  
    202202#endif
    203203
    204 /* Convert char ** into char **.  This conversion is safe,
     204/* Convert char *const * into const char *const *.  This conversion is safe,
    205205 * and implicit in C++ (conv.qual 4) but for some reason not in C. */
    206 static inline char **strs(char **pstr)
     206static inline const char *const *strs(char *const *pstr)
    207207{
    208   return (char **)pstr;
     208  return (const char *const *)pstr;
    209209}
    210210
     
    218218  char *description;            /* detailed description */
    219219  void *val;                    /* current value */
    220   int  (*validate_fn)(struct _owl_variable *v, void *newval);
     220  int  (*validate_fn)(struct _owl_variable *v, const void *newval);
    221221                                /* returns 1 if newval is valid */
    222   int  (*set_fn)(struct _owl_variable *v, void *newval);
     222  int  (*set_fn)(struct _owl_variable *v, const void *newval);
    223223                                /* sets the variable to a value
    224224                                 * of the appropriate type.
     
    226226                                 * should make a copy.
    227227                                 * returns 0 on success. */
    228   int  (*set_fromstring_fn)(struct _owl_variable *v, char *newval);
     228  int  (*set_fromstring_fn)(struct _owl_variable *v, const char *newval);
    229229                                /* sets the variable to a value
    230230                                 * of the appropriate type.
     
    232232                                 * should make a copy.
    233233                                 * returns 0 on success. */
    234   void *(*get_fn)(struct _owl_variable *v);
     234  const void *(*get_fn)(struct _owl_variable *v);
    235235                                /* returns a reference to the current value.
    236236                                 * WARNING:  this approach is hard to make
    237237                                 * thread-safe... */
    238238  int  (*get_tostring_fn)(struct _owl_variable *v,
    239                           char *buf, int bufsize, void *val);
     239                          char *buf, int bufsize, const void *val);
    240240                                /* converts val to a string
    241241                                 * and puts into buf */
     
    299299 
    300300  /* These don't take any context */
    301   char *(*cmd_args_fn)(int argc, char **argv, char *buff); 
     301  char *(*cmd_args_fn)(int argc, const char *const *argv, const char *buff); 
    302302                                /* takes argv and the full command as buff.
    303303                                 * caller must free return value if !NULL */
     
    306306
    307307  /* The following also take the active context if it's valid */
    308   char *(*cmd_ctxargs_fn)(void *ctx, int argc, char **argv, char *buff); 
     308  char *(*cmd_ctxargs_fn)(void *ctx, int argc, const char *const *argv, const char *buff); 
    309309                                /* takes argv and the full command as buff.
    310310                                 * caller must free return value if !NULL */
     
    328328
    329329typedef struct _owl_pair {
    330   char *key;
     330  const char *key;
    331331  char *value;
    332332} owl_pair;
     
    342342  struct _owl_fmtext_cache * fmtext;
    343343  int delete;
    344   char *hostname;
     344  const char *hostname;
    345345  owl_list attributes;            /* this is a list of pairs */
    346346  char *timestr;
  • pair.c

    rde1c8a5 re19eb97  
    11#include "owl.h"
    22
    3 void owl_pair_create(owl_pair *p, char *key, char *value) {
     3void owl_pair_create(owl_pair *p, const char *key, char *value) {
    44  p->key=key;
    55  p->value=value;
    66}
    77
    8 void owl_pair_set_key(owl_pair *p, char *key) {
     8void owl_pair_set_key(owl_pair *p, const char *key) {
    99  p->key=key;
    1010}
     
    1414}
    1515
    16 char *owl_pair_get_key(owl_pair *p) {
     16const char *owl_pair_get_key(owl_pair *p) {
    1717  return(p->key);
    1818}
  • perlconfig.c

    rfa4562c re19eb97  
    1414static void owl_perl_xs_init(pTHX)
    1515{
    16   char *file = __FILE__;
     16  const char *file = __FILE__;
    1717  dXSUB_SYS;
    1818  {
     
    2626  HV *h, *stash;
    2727  SV *hr;
    28   char *type;
     28  const char *type;
    2929  char *ptr, *utype, *blessas;
    3030  int i, j;
     
    135135  HE * ent;
    136136  I32 count, len;
    137   char *key,*val;
     137  const char *key,*val;
    138138  HV * hash;
    139139  struct tm tm;
     
    197197/* Calls in a scalar context, passing it a hash reference.
    198198   If return value is non-null, caller must free. */
    199 char *owl_perlconfig_call_with_message(char *subname, owl_message *m)
     199char *owl_perlconfig_call_with_message(const char *subname, owl_message *m)
    200200{
    201201  dSP ;
     
    246246   If the return value is non-null, the caller must free it.
    247247 */
    248 char * owl_perlconfig_message_call_method(owl_message *m, char *method, int argc, char ** argv)
     248char * owl_perlconfig_message_call_method(owl_message *m, const char *method, int argc, const char ** argv)
    249249{
    250250  dSP;
     
    296296
    297297
    298 char *owl_perlconfig_initperl(char * file, int *Pargc, char ***Pargv, char *** Penv)
     298char *owl_perlconfig_initperl(const char * file, int *Pargc, char ***Pargv, char *** Penv)
    299299{
    300300  int ret;
    301301  PerlInterpreter *p;
    302302  char *err;
    303   char *args[4] = {"", "-e", "0;", NULL};
     303  const char *args[4] = {"", "-e", "0;", NULL};
    304304  AV *inc;
    305305  char *path;
     
    372372
    373373/* returns whether or not a function exists */
    374 int owl_perlconfig_is_function(char *fn) {
     374int owl_perlconfig_is_function(const char *fn) {
    375375  if (get_cv(fn, FALSE)) return(1);
    376376  else return(0);
     
    378378
    379379/* caller is responsible for freeing returned string */
    380 char *owl_perlconfig_execute(char *line)
     380char *owl_perlconfig_execute(const char *line)
    381381{
    382382  STRLEN len;
    383383  SV *response;
    384   char *preout;
     384  const char *preout;
    385385  char *out;
    386386
     
    408408}
    409409
    410 void owl_perlconfig_getmsg(owl_message *m, char *subname)
     410void owl_perlconfig_getmsg(owl_message *m, const char *subname)
    411411{
    412412  char *ptr = NULL;
     
    419419
    420420/* Called on all new messages; receivemsg is only called on incoming ones */
    421 void owl_perlconfig_newmsg(owl_message *m, char *subname)
     421void owl_perlconfig_newmsg(owl_message *m, const char *subname)
    422422{
    423423  char *ptr = NULL;
     
    429429}
    430430
    431 void owl_perlconfig_new_command(char *name)
     431void owl_perlconfig_new_command(const char *name)
    432432{
    433433  dSP;
     
    452452}
    453453
    454 char *owl_perlconfig_perlcmd(owl_cmd *cmd, int argc, char **argv)
     454char *owl_perlconfig_perlcmd(owl_cmd *cmd, int argc, const char *const *argv)
    455455{
    456456  int i, count;
  • perlglue.xs

    r3ff3d86 re19eb97  
    3232char *
    3333command(cmd, ...)
    34         char *cmd
     34        const char *cmd
    3535        PREINIT:
    3636                char *rv = NULL;
    37                 char **argv;
     37                const char **argv;
    3838                int i;
    3939        CODE:
     
    8585                RETVAL
    8686
    87 char *
     87const char *
    8888zephyr_getsender()
    8989        CODE:
     
    9494void
    9595zephyr_zwrite(cmd,msg)
    96         char *cmd
    97         char *msg
     96        const char *cmd
     97        const char *msg
    9898        PREINIT:
    9999                int i;
     
    103103char *
    104104ztext_stylestrip(ztext)
    105         char *ztext
     105        const char *ztext
    106106        PREINIT:
    107107                char *rv = NULL;
     
    116116char *
    117117zephyr_smartstrip_user(in)
    118         char *in
     118        const char *in
    119119        PREINIT:
    120120                char *rv = NULL;
     
    157157
    158158void admin_message(header, body)
    159         char *header
    160         char *body
     159        const char *header
     160        const char *body
    161161        CODE:
    162162        {
     
    165165
    166166void start_question(line, callback)
    167         char *line
     167        const char *line
    168168        SV *callback
    169169        PREINIT:
     
    181181
    182182void start_password(line, callback)
    183         char *line
     183        const char *line
    184184        SV *callback
    185185        PREINIT:
     
    197197
    198198void start_edit_win(line, callback)
    199         char *line
     199        const char *line
    200200        SV *callback
    201201        PREINIT:
     
    223223
    224224
    225 char *
     225const char *
    226226get_data_dir ()
    227227        CODE:
     
    230230        RETVAL
    231231
    232 char *
     232const char *
    233233get_config_dir ()
    234234        CODE:
     
    239239void
    240240popless_text(text)
    241         char *text
     241        const char *text
    242242        CODE:
    243243        {
     
    247247void
    248248popless_ztext(text)
    249         char *text
     249        const char *text
    250250        CODE:
    251251        {
     
    259259void
    260260error(text)
    261         char *text
     261        const char *text
    262262        CODE:
    263263        {
     
    267267void
    268268debug(text)
    269         char *text
     269        const char *text
    270270        CODE:
    271271        {
     
    275275void
    276276message(text)
    277         char *text
     277        const char *text
    278278        CODE:
    279279        {
     
    283283void
    284284create_style(name, object)
    285      char *name
     285     const char *name
    286286     SV  *object
    287287     PREINIT:
     
    303303void
    304304_remove_filter(filterName)
    305         char *filterName
     305        const char *filterName
    306306        CODE:
    307307        {
     
    315315char *
    316316wordwrap(in, cols)
    317         char *in
     317        const char *in
    318318        int cols
    319319        PREINIT:
     
    368368                AV *styles;
    369369                owl_list l;
    370                 char *name;
     370                const char *name;
    371371                int i;
    372372        CODE:
     
    393393                AV *vars;
    394394                owl_list l;
    395                 char *name;
     395                const char *name;
    396396                int i;
    397397        CODE:
     
    448448void
    449449new_variable_string(name, ival, summ, desc)
    450         char * name
    451         char * ival
    452         char * summ
    453         char * desc
     450        const char * name
     451        const char * ival
     452        const char * summ
     453        const char * desc
    454454        CODE:
    455455        owl_variable_dict_newvar_string(owl_global_get_vardict(&g),
     
    461461void
    462462new_variable_int(name, ival, summ, desc)
    463         char * name
     463        const char * name
    464464        int ival
    465         char * summ
    466         char * desc
     465        const char * summ
     466        const char * desc
    467467        CODE:
    468468        owl_variable_dict_newvar_int(owl_global_get_vardict(&g),
     
    474474void
    475475new_variable_bool(name, ival, summ, desc)
    476         char * name
     476        const char * name
    477477        int ival
    478         char * summ
    479         char * desc
     478        const char * summ
     479        const char * desc
    480480        CODE:
    481481        owl_variable_dict_newvar_bool(owl_global_get_vardict(&g),
     
    520520replace(count, string)
    521521        int count;
    522         char *string;
     522        const char *string;
    523523        CODE:
    524524                RETVAL = owl_editwin_replace(owl_global_get_typwin(&g), count, string);
     
    536536int
    537537replace_region(string)
    538         char *string;
     538        const char *string;
    539539        CODE:
    540540                RETVAL = owl_editwin_replace_region(owl_global_get_typwin(&g), string);
  • popexec.c

    r7565f8f re19eb97  
    99
    1010/* starts up popexec in a new viewwin */
    11 owl_popexec *owl_popexec_new(char *command)
     11owl_popexec *owl_popexec_new(const char *command)
    1212{
    1313  owl_popexec *pe;
  • regex.c

    r41c9a96 re19eb97  
    88}
    99
    10 int owl_regex_create(owl_regex *re, char *string)
     10int owl_regex_create(owl_regex *re, const char *string)
    1111{
    1212  int ret;
    1313  char buff1[LINE];
    14   char *ptr;
     14  const char *ptr;
    1515 
    1616  re->string=owl_strdup(string);
     
    3636}
    3737
    38 int owl_regex_create_quoted(owl_regex *re, char *string)
     38int owl_regex_create_quoted(owl_regex *re, const char *string)
    3939{
    4040  char *quoted;
     
    4646}
    4747
    48 int owl_regex_compare(owl_regex *re, char *string, int *start, int *end)
     48int owl_regex_compare(owl_regex *re, const char *string, int *start, int *end)
    4949{
    5050  int out, ret;
     
    7474}
    7575
    76 char *owl_regex_get_string(owl_regex *re)
     76const char *owl_regex_get_string(owl_regex *re)
    7777{
    7878  return(re->string);
  • stubgen.pl

    r1aee7d9 re19eb97  
    2828        print "  return owl_variable_get_bool(&g->vars, \"$varname\");\n}\n";
    2929    } elsif ($vartype =~ /^PATH/ or $vartype =~ /^STRING/) {
    30         print "void owl_global_set_$altvarname(owl_global *g, char *text) {\n";
     30        print "void owl_global_set_$altvarname(owl_global *g, const char *text) {\n";
    3131        print "  owl_variable_set_string(&g->vars, \"$varname\", text);\n}\n";
    32         print "char *owl_global_get_$altvarname(owl_global *g) {\n";
     32        print "const char *owl_global_get_$altvarname(owl_global *g) {\n";
    3333        print "  return owl_variable_get_string(&g->vars, \"$varname\");\n}\n";
    3434    } elsif ($vartype =~ /^INT/ or $vartype =~ /^ENUM/) {
  • style.c

    r65b2173 re19eb97  
    22#include "owl.h"
    33
    4 void owl_style_create_perl(owl_style *s, char *name, SV *obj)
     4void owl_style_create_perl(owl_style *s, const char *name, SV *obj)
    55{
    66  s->name=owl_strdup(name);
     
    88}
    99
    10 int owl_style_matches_name(owl_style *s, char *name)
     10int owl_style_matches_name(owl_style *s, const char *name)
    1111{
    1212  if (!strcmp(s->name, name)) return(1);
     
    1414}
    1515
    16 char *owl_style_get_name(owl_style *s)
     16const char *owl_style_get_name(owl_style *s)
    1717{
    1818  return(s->name);
    1919}
    2020
    21 char *owl_style_get_description(owl_style *s)
     21const char *owl_style_get_description(owl_style *s)
    2222{
    2323  SV *sv = NULL;
     
    4141void owl_style_get_formattext(owl_style *s, owl_fmtext *fm, owl_message *m)
    4242{
    43   char *body;
     43  const char *body;
    4444  char *indent;
    4545  int curlen;
  • 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;
  • 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;
  • variable.c

    rfa4562c re19eb97  
    375375/* commonly useful */
    376376
    377 int owl_variable_int_validate_gt0(owl_variable *v, void *newval)
     377int owl_variable_int_validate_gt0(owl_variable *v, const void *newval)
    378378{
    379379  if (newval == NULL) return(0);
     
    382382}
    383383
    384 int owl_variable_int_validate_positive(owl_variable *v, void *newval)
     384int owl_variable_int_validate_positive(owl_variable *v, const void *newval)
    385385{
    386386  if (newval == NULL) return(0);
     
    390390
    391391/* typewinsize */
    392 int owl_variable_typewinsize_set(owl_variable *v, void *newval)
     392int owl_variable_typewinsize_set(owl_variable *v, const void *newval)
    393393{
    394394  int rv;
     
    399399
    400400/* debug (cache value in g->debug) */
    401 int owl_variable_debug_set(owl_variable *v, void *newval)
     401int owl_variable_debug_set(owl_variable *v, const void *newval)
    402402{
    403403  if (newval && (*(const int*)newval == 1 || *(const int*)newval == 0)) {
     
    408408
    409409/* When 'aaway' is changed, need to notify the AIM server */
    410 int owl_variable_aaway_set(owl_variable *v, void *newval)
     410int owl_variable_aaway_set(owl_variable *v, const void *newval)
    411411{
    412412  if (newval) {
     
    420420}
    421421
    422 int owl_variable_pseudologins_set(owl_variable *v, void *newval)
     422int owl_variable_pseudologins_set(owl_variable *v, const void *newval)
    423423{
    424424  if (newval) {
     
    432432/* note that changing the value of this will clobber
    433433 * any user setting of this */
    434 int owl_variable_disable_ctrl_d_set(owl_variable *v, void *newval)
     434int owl_variable_disable_ctrl_d_set(owl_variable *v, const void *newval)
    435435{
    436436
     
    449449}
    450450
    451 int owl_variable_tty_set(owl_variable *v, void *newval)
     451int owl_variable_tty_set(owl_variable *v, const void *newval)
    452452{
    453453  owl_zephyr_set_locationinfo(owl_global_get_hostname(&g), newval);
     
    531531}
    532532
    533 owl_variable * owl_variable_newvar(char *name, char *summary, char * description) {
     533owl_variable * owl_variable_newvar(const char *name, const char *summary, const char * description) {
    534534  owl_variable * var = owl_malloc(sizeof(owl_variable));
    535535  memset(var, 0, sizeof(owl_variable));
     
    540540}
    541541
    542 void owl_variable_update(owl_variable *var, char *summary, char *desc) {
     542void owl_variable_update(owl_variable *var, const char *summary, const char *desc) {
    543543  if(var->summary) owl_free(var->summary);
    544544  var->summary = owl_strdup(summary);
     
    547547}
    548548
    549 void owl_variable_dict_newvar_string(owl_vardict * vd, char *name, char *summ, char * desc, char * initval) {
     549void owl_variable_dict_newvar_string(owl_vardict * vd, const char *name, const char *summ, const char * desc, const char * initval) {
    550550  owl_variable *old = owl_variable_get_var(vd, name, OWL_VARIABLE_STRING);
    551551  if(old) {
     
    567567}
    568568
    569 void owl_variable_dict_newvar_int(owl_vardict * vd, char *name, char *summ, char * desc, int initval) {
     569void owl_variable_dict_newvar_int(owl_vardict * vd, const char *name, const char *summ, const char * desc, int initval) {
    570570  owl_variable *old = owl_variable_get_var(vd, name, OWL_VARIABLE_INT);
    571571  if(old) {
     
    588588}
    589589
    590 void owl_variable_dict_newvar_bool(owl_vardict * vd, char *name, char *summ, char * desc, int initval) {
     590void owl_variable_dict_newvar_bool(owl_vardict * vd, const char *name, const char *summ, const char * desc, int initval) {
    591591  owl_variable *old = owl_variable_get_var(vd, name, OWL_VARIABLE_BOOL);
    592592  if(old) {
     
    628628
    629629
    630 char *owl_variable_get_description(owl_variable *v) {
     630const char *owl_variable_get_description(owl_variable *v) {
    631631  return v->description;
    632632}
    633633
    634 char *owl_variable_get_summary(owl_variable *v) {
     634const char *owl_variable_get_summary(owl_variable *v) {
    635635  return v->summary;
    636636}
    637637
    638 char *owl_variable_get_validsettings(owl_variable *v) {
     638const char *owl_variable_get_validsettings(owl_variable *v) {
    639639  if (v->validsettings) {
    640640    return v->validsettings;
     
    647647
    648648/* returns 0 on success, prints a status msg if msg is true */
    649 int owl_variable_set_fromstring(owl_vardict *d, char *name, char *value, int msg, int requirebool) {
     649int owl_variable_set_fromstring(owl_vardict *d, const char *name, const char *value, int msg, int requirebool) {
    650650  owl_variable *v;
    651651  char buff2[1024];
     
    676676}
    677677 
    678 int owl_variable_set_string(owl_vardict *d, char *name, char *newval) {
     678int owl_variable_set_string(owl_vardict *d, const char *name, const char *newval) {
    679679  owl_variable *v;
    680680  if (!name) return(-1);
     
    685685}
    686686 
    687 int owl_variable_set_int(owl_vardict *d, char *name, int newval) {
     687int owl_variable_set_int(owl_vardict *d, const char *name, int newval) {
    688688  owl_variable *v;
    689689  if (!name) return(-1);
     
    694694}
    695695 
    696 int owl_variable_set_bool_on(owl_vardict *d, char *name) {
     696int owl_variable_set_bool_on(owl_vardict *d, const char *name) {
    697697  return owl_variable_set_int(d,name,1);
    698698}
    699699
    700 int owl_variable_set_bool_off(owl_vardict *d, char *name) {
     700int owl_variable_set_bool_off(owl_vardict *d, const char *name) {
    701701  return owl_variable_set_int(d,name,0);
    702702}
    703703
    704 int owl_variable_get_tostring(owl_vardict *d, char *name, char *buf, int bufsize) {
     704int owl_variable_get_tostring(owl_vardict *d, const char *name, char *buf, int bufsize) {
    705705  owl_variable *v;
    706706  if (!name) return(-1);
     
    710710}
    711711
    712 int owl_variable_get_default_tostring(owl_vardict *d, char *name, char *buf, int bufsize) {
     712int owl_variable_get_default_tostring(owl_vardict *d, const char *name, char *buf, int bufsize) {
    713713  owl_variable *v;
    714714  if (!name) return(-1);
     
    722722}
    723723
    724 owl_variable *owl_variable_get_var(owl_vardict *d, char *name, int require_type) {
     724owl_variable *owl_variable_get_var(owl_vardict *d, const char *name, int require_type) {
    725725  owl_variable *v;
    726726  if (!name) return(NULL);
     
    731731
    732732/* returns a reference */
    733 void *owl_variable_get(owl_vardict *d, char *name, int require_type) {
     733const void *owl_variable_get(owl_vardict *d, const char *name, int require_type) {
    734734  owl_variable *v = owl_variable_get_var(d, name, require_type);
    735735  if(v == NULL) return NULL;
     
    738738
    739739/* returns a reference */
    740 char *owl_variable_get_string(owl_vardict *d, char *name) {
     740const char *owl_variable_get_string(owl_vardict *d, const char *name) {
    741741  return owl_variable_get(d,name, OWL_VARIABLE_STRING);
    742742}
    743743
    744744/* returns a reference */
    745 void *owl_variable_get_other(owl_vardict *d, char *name) {
     745const void *owl_variable_get_other(owl_vardict *d, const char *name) {
    746746  return owl_variable_get(d,name, OWL_VARIABLE_OTHER);
    747747}
    748748
    749 int owl_variable_get_int(owl_vardict *d, char *name) {
     749int owl_variable_get_int(owl_vardict *d, const char *name) {
    750750  const int *pi;
    751751  pi = owl_variable_get(d,name,OWL_VARIABLE_INT);
     
    754754}
    755755
    756 int owl_variable_get_bool(owl_vardict *d, char *name) {
     756int owl_variable_get_bool(owl_vardict *d, const char *name) {
    757757  const int *pi;
    758758  pi = owl_variable_get(d,name,OWL_VARIABLE_BOOL);
     
    761761}
    762762
    763 void owl_variable_describe(owl_vardict *d, char *name, owl_fmtext *fm) {
     763void owl_variable_describe(owl_vardict *d, const char *name, owl_fmtext *fm) {
    764764  char defaultbuf[50];
    765765  char buf[1024];
     
    785785}
    786786
    787 void owl_variable_get_help(owl_vardict *d, char *name, owl_fmtext *fm) {
     787void owl_variable_get_help(owl_vardict *d, const char *name, owl_fmtext *fm) {
    788788  char buff[1024];
    789789  int bufflen = 1023;
     
    839839/* default common functions */
    840840
    841 void *owl_variable_get_default(owl_variable *v) {
     841const void *owl_variable_get_default(owl_variable *v) {
    842842  return v->val;
    843843}
     
    849849/* default functions for booleans */
    850850
    851 int owl_variable_bool_validate_default(owl_variable *v, void *newval) {
     851int owl_variable_bool_validate_default(owl_variable *v, const void *newval) {
    852852  if (newval == NULL) return(0);
    853853  else if (*(const int*)newval==1 || *(const int*)newval==0) return(1);
     
    855855}
    856856
    857 int owl_variable_bool_set_default(owl_variable *v, void *newval) {
     857int owl_variable_bool_set_default(owl_variable *v, const void *newval) {
    858858  if (v->validate_fn) {
    859859    if (!v->validate_fn(v, newval)) return(-1);
     
    863863}
    864864
    865 int owl_variable_bool_set_fromstring_default(owl_variable *v, char *newval) {
     865int owl_variable_bool_set_fromstring_default(owl_variable *v, const char *newval) {
    866866  int i;
    867867  if (!strcmp(newval, "on")) i=1;
     
    871871}
    872872
    873 int owl_variable_bool_get_tostring_default(owl_variable *v, char* buf, int bufsize, void *val) {
     873int owl_variable_bool_get_tostring_default(owl_variable *v, char* buf, int bufsize, const void *val) {
    874874  if (val == NULL) {
    875875    snprintf(buf, bufsize, "<null>");
     
    889889/* default functions for integers */
    890890
    891 int owl_variable_int_validate_default(owl_variable *v, void *newval) {
     891int owl_variable_int_validate_default(owl_variable *v, const void *newval) {
    892892  if (newval == NULL) return(0);
    893893  else return (1);
    894894}
    895895
    896 int owl_variable_int_set_default(owl_variable *v, void *newval) {
     896int owl_variable_int_set_default(owl_variable *v, const void *newval) {
    897897  if (v->validate_fn) {
    898898    if (!v->validate_fn(v, newval)) return(-1);
     
    902902}
    903903
    904 int owl_variable_int_set_fromstring_default(owl_variable *v, char *newval) {
     904int owl_variable_int_set_fromstring_default(owl_variable *v, const char *newval) {
    905905  int i;
    906   char *ep = "x";
     906  const char *ep = "x";
    907907  i = strtol(newval, (char **)&ep, 10);
    908908  if (*ep || ep==newval) return(-1);
     
    910910}
    911911
    912 int owl_variable_int_get_tostring_default(owl_variable *v, char* buf, int bufsize, void *val) {
     912int owl_variable_int_get_tostring_default(owl_variable *v, char* buf, int bufsize, const void *val) {
    913913  if (val == NULL) {
    914914    snprintf(buf, bufsize, "<null>");
     
    922922/* default functions for enums (a variant of integers) */
    923923
    924 int owl_variable_enum_validate(owl_variable *v, void *newval) { 
     924int owl_variable_enum_validate(owl_variable *v, const void *newval) { 
    925925  char **enums;
    926926  int nenums, val;
     
    936936}
    937937
    938 int owl_variable_enum_set_fromstring(owl_variable *v, char *newval) {
     938int owl_variable_enum_set_fromstring(owl_variable *v, const char *newval) {
    939939  char **enums;
    940940  int nenums, i, val=-1;
     
    952952}
    953953
    954 int owl_variable_enum_get_tostring(owl_variable *v, char* buf, int bufsize, void *val) {
     954int owl_variable_enum_get_tostring(owl_variable *v, char* buf, int bufsize, const void *val) {
    955955  char **enums;
    956956  int nenums, i;
     
    973973/* default functions for stringeans */
    974974
    975 int owl_variable_string_validate_default(struct _owl_variable *v, void *newval) {
     975int owl_variable_string_validate_default(struct _owl_variable *v, const void *newval) {
    976976  if (newval == NULL) return(0);
    977977  else return (1);
    978978}
    979979
    980 int owl_variable_string_set_default(owl_variable *v, void *newval) {
     980int owl_variable_string_set_default(owl_variable *v, const void *newval) {
    981981  if (v->validate_fn) {
    982982    if (!v->validate_fn(v, newval)) return(-1);
     
    987987}
    988988
    989 int owl_variable_string_set_fromstring_default(owl_variable *v, char *newval) {
     989int owl_variable_string_set_fromstring_default(owl_variable *v, const char *newval) {
    990990  return (v->set_fn(v, newval));
    991991}
    992992
    993 int owl_variable_string_get_tostring_default(owl_variable *v, char* buf, int bufsize, void *val) {
     993int owl_variable_string_get_tostring_default(owl_variable *v, char* buf, int bufsize, const void *val) {
    994994  if (val == NULL) {
    995995    snprintf(buf, bufsize, "<null>");
    996996    return -1;
    997997  } else {
    998     snprintf(buf, bufsize, "%s", (char*)val);
     998    snprintf(buf, bufsize, "%s", (const char*)val);
    999999    return 0;
    10001000  }
     
    10151015  int numfailed=0;
    10161016  char buf[1024];
    1017   void *v;
     1017  const void *v;
    10181018
    10191019  in_regtest = 1;
  • view.c

    r4d86e06 re19eb97  
    22#include "owl.h"
    33
    4 void owl_view_create(owl_view *v, char *name, owl_filter *f, owl_style *s)
     4void owl_view_create(owl_view *v, const char *name, owl_filter *f, owl_style *s)
    55{
    66  v->name=owl_strdup(name);
     
    1111}
    1212
    13 char *owl_view_get_name(owl_view *v)
     13const char *owl_view_get_name(owl_view *v)
    1414{
    1515  return(v->name);
     
    6767}
    6868
    69 char *owl_view_get_style_name(owl_view *v) {
     69const char *owl_view_get_style_name(owl_view *v) {
    7070  return(owl_style_get_name(v->style));
    7171}
     
    154154}
    155155
    156 char *owl_view_get_filtname(owl_view *v)
     156const char *owl_view_get_filtname(owl_view *v)
    157157{
    158158  return(owl_filter_get_name(v->filter));
  • viewwin.c

    rd43edd2 re19eb97  
    77 * window that will be used by viewwin
    88 */
    9 void owl_viewwin_init_text(owl_viewwin *v, WINDOW *win, int winlines, int wincols, char *text)
     9void owl_viewwin_init_text(owl_viewwin *v, WINDOW *win, int winlines, int wincols, const char *text)
    1010{
    1111  owl_fmtext_init_null(&(v->fmtext));
     
    2525}
    2626
    27 void owl_viewwin_append_text(owl_viewwin *v, char *text) {
     27void owl_viewwin_append_text(owl_viewwin *v, const char *text) {
    2828    owl_fmtext_append_normal(&(v->fmtext), text);
    2929    v->textlines=owl_fmtext_num_lines(&(v->fmtext)); 
  • zbuddylist.c

    rd43edd2 re19eb97  
    66}
    77
    8 int owl_zbuddylist_adduser(owl_zbuddylist *zb, char *name)
     8int owl_zbuddylist_adduser(owl_zbuddylist *zb, const char *name)
    99{
    1010  int i, j;
     
    2424}
    2525
    26 int owl_zbuddylist_deluser(owl_zbuddylist *zb, char *name)
     26int owl_zbuddylist_deluser(owl_zbuddylist *zb, const char *name)
    2727{
    2828  int i, j;
     
    4545}
    4646
    47 int owl_zbuddylist_contains_user(owl_zbuddylist *zb, char *name)
     47int owl_zbuddylist_contains_user(owl_zbuddylist *zb, const char *name)
    4848{
    4949  int i, j;
  • zcrypt.c

    r65b2173 re19eb97  
    4949} ZWRITEOPTIONS;
    5050
    51 char *GetZephyrVarKeyFile(char *whoami, char *class, char *instance);
     51char *GetZephyrVarKeyFile(const char *whoami, const char *class, const char *instance);
    5252
    5353#ifndef HAVE_DES_ECB_ENCRYPT_PROTO
     
    6969 * return 0 on success, otherwise -1
    7070 */
    71 int owl_zcrypt_decrypt(char *out, char *in, char *class, char *instance) {
    72   char *inptr, *endptr;
     71int owl_zcrypt_decrypt(char *out, const char *in, const char *class, const char *instance) {
     72  const char *inptr, *endptr;
    7373  char *fname, keystring[MAX_KEY];
    7474  FILE *fkey;
     
    116116}
    117117
    118 int owl_zcrypt_encrypt(char *out, char *in, char *class, char *instance) {
     118int owl_zcrypt_encrypt(char *out, const char *in, const char *class, const char *instance) {
    119119  char *fname, keystring[MAX_KEY];
    120120  FILE *fkey;
     
    123123  char input[8], output[8];
    124124  int size, length, i;
    125   char *inbuff = NULL, *inptr;
     125  const char *inbuff = NULL, *inptr;
    126126  int use_buffer = FALSE;
    127127  int num_blocks=0, last_block_size=0;
     
    183183#define MAX_SEARCH 3
    184184/* Find the class/instance in the .crypt-table */
    185 char *GetZephyrVarKeyFile(char *whoami, char *class, char *instance) {
     185char *GetZephyrVarKeyFile(const char *whoami, const char *class, const char *instance) {
    186186  char *keyfile = NULL;
    187187  char *varname[MAX_SEARCH];
  • zephyr.c

    rfa4562c re19eb97  
    187187}
    188188
    189 char *owl_zephyr_get_sender()
     189const char *owl_zephyr_get_sender()
    190190{
    191191#ifdef HAVE_LIBZEPHYR
     
    235235 * zephyr to load the subscriptions.
    236236 */
    237 int owl_zephyr_loadsubs(char *filename, int error_on_nofile)
     237int owl_zephyr_loadsubs(const char *filename, int error_on_nofile)
    238238{
    239239#ifdef HAVE_LIBZEPHYR
     
    350350}
    351351
    352 int owl_zephyr_loadloginsubs(char *filename)
     352int owl_zephyr_loadloginsubs(const char *filename)
    353353{
    354354#ifdef HAVE_LIBZEPHYR
     
    422422}
    423423
    424 int owl_zephyr_sub(char *class, char *inst, char *recip)
     424int owl_zephyr_sub(const char *class, const char *inst, const char *recip)
    425425{
    426426#ifdef HAVE_LIBZEPHYR
     
    443443
    444444
    445 int owl_zephyr_unsub(char *class, char *inst, char *recip)
     445int owl_zephyr_unsub(const char *class, const char *inst, const char *recip)
    446446{
    447447#ifdef HAVE_LIBZEPHYR
     
    635635
    636636#ifdef HAVE_LIBZEPHYR
    637 char *owl_zephyr_get_zsig(ZNotice_t *n, int *k)
     637const char *owl_zephyr_get_zsig(ZNotice_t *n, int *k)
    638638{
    639639  /* return a pointer to the zsig if there is one */
     
    656656}
    657657#else
    658 char *owl_zephyr_get_zsig(void *n, int *k)
     658const char *owl_zephyr_get_zsig(void *n, int *k)
    659659{
    660660  return("");
     
    662662#endif
    663663
    664 int send_zephyr(char *opcode, char *zsig, char *class, char *instance, char *recipient, char *message)
     664int send_zephyr(const char *opcode, const char *zsig, const char *class, const char *instance, const char *recipient, const char *message)
    665665{
    666666#ifdef HAVE_LIBZEPHYR
     
    717717#endif
    718718
    719 void send_ping(char *to, char *zclass, char *zinstance)
     719void send_ping(const char *to, const char *zclass, const char *zinstance)
    720720{
    721721#ifdef HAVE_LIBZEPHYR
     
    885885#endif
    886886
    887 void owl_zephyr_zlocate(char *user, char *out, int auth)
     887void owl_zephyr_zlocate(const char *user, char *out, int auth)
    888888{
    889889#ifdef HAVE_LIBZEPHYR
     
    920920}
    921921
    922 void owl_zephyr_addsub(char *filename, char *class, char *inst, char *recip)
     922void owl_zephyr_addsub(const char *filename, const char *class, const char *inst, const char *recip)
    923923{
    924924#ifdef HAVE_LIBZEPHYR
     
    963963}
    964964
    965 void owl_zephyr_delsub(char *filename, char *class, char *inst, char *recip)
     965void owl_zephyr_delsub(const char *filename, const char *class, const char *inst, const char *recip)
    966966{
    967967#ifdef HAVE_LIBZEPHYR
     
    985985
    986986/* caller must free the return */
    987 char *owl_zephyr_makesubline(char *class, char *inst, char *recip)
     987char *owl_zephyr_makesubline(const char *class, const char *inst, const char *recip)
    988988{
    989989  char *out;
     
    998998{
    999999#ifdef HAVE_LIBZEPHYR
    1000   char *exposure, *eset;
     1000  const char *exposure, *eset;
    10011001  int ret;
    10021002
     
    10491049}
    10501050
    1051 void owl_zephyr_addbuddy(char *name)
     1051void owl_zephyr_addbuddy(const char *name)
    10521052{
    10531053  char *filename;
     
    10651065}
    10661066
    1067 void owl_zephyr_delbuddy(char *name)
     1067void owl_zephyr_delbuddy(const char *name)
    10681068{
    10691069  char *filename;
     
    10761076/* return auth string */
    10771077#ifdef HAVE_LIBZEPHYR
    1078 char *owl_zephyr_get_authstr(ZNotice_t *n)
     1078const char *owl_zephyr_get_authstr(ZNotice_t *n)
    10791079{
    10801080
     
    10921092}
    10931093#else
    1094 char *owl_zephyr_get_authstr(void *n)
     1094const char *owl_zephyr_get_authstr(void *n)
    10951095{
    10961096  return("");
     
    11561156}
    11571157
    1158 char *owl_zephyr_get_variable(char *var)
     1158const char *owl_zephyr_get_variable(const char *var)
    11591159{
    11601160#ifdef HAVE_LIBZEPHYR
     
    11651165}
    11661166
    1167 void owl_zephyr_set_locationinfo(char *host, char *val)
     1167void owl_zephyr_set_locationinfo(const char *host, const char *val)
    11681168{
    11691169#ifdef HAVE_LIBZEPHYR
     
    11751175 * The caller must free the return
    11761176 */
    1177 char *short_zuser(char *in)
     1177char *short_zuser(const char *in)
    11781178{
    11791179  char *out, *ptr;
     
    11921192 * The caller must free the return.
    11931193 */
    1194 char *long_zuser(char *in)
     1194char *long_zuser(const char *in)
    11951195{
    11961196  if (strchr(in, '@')) {
     
    12041204 * caller must free the return
    12051205 */
    1206 char *owl_zephyr_smartstripped_user(char *in)
     1206char *owl_zephyr_smartstripped_user(const char *in)
    12071207{
    12081208  char *ptr, *realm, *out;
     
    12471247 * -1 on failure, 0 on success.
    12481248 */
    1249 int owl_zephyr_get_anyone_list(owl_list *in, char *filename)
     1249int owl_zephyr_get_anyone_list(owl_list *in, const char *filename)
    12501250{
    12511251#ifdef HAVE_LIBZEPHYR
  • 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.