Mercurial > hg > xemacs-beta
diff src/tooltalk.c @ 173:8eaf7971accc r20-3b13
Import from CVS: tag r20-3b13
author | cvs |
---|---|
date | Mon, 13 Aug 2007 09:49:09 +0200 |
parents | 15872534500d |
children | 3d6bfa290dbd |
line wrap: on
line diff
--- a/src/tooltalk.c Mon Aug 13 09:47:55 2007 +0200 +++ b/src/tooltalk.c Mon Aug 13 09:49:09 2007 +0200 @@ -184,23 +184,23 @@ static Lisp_Object make_tooltalk_message (Tt_message m) { - struct Lisp_Tooltalk_Message *msg + struct Lisp_Tooltalk_Message *message_ = alloc_lcrecord (sizeof (struct Lisp_Tooltalk_Message), lrecord_tooltalk_message); Lisp_Object val; - msg->m = m; - msg->callback = Qnil; - msg->plist_sym = Fmake_symbol (Tooltalk_Message_plist_str); - XSETTOOLTALK_MESSAGE (val, msg); + message_->m = m; + message_->callback = Qnil; + message_->plist_sym = Fmake_symbol (Tooltalk_Message_plist_str); + XSETTOOLTALK_MESSAGE (val, message_); return val; } Tt_message -unbox_tooltalk_message (Lisp_Object msg) +unbox_tooltalk_message (Lisp_Object message_) { - CHECK_TOOLTALK_MESSAGE (msg); - return XTOOLTALK_MESSAGE (msg)->m; + CHECK_TOOLTALK_MESSAGE (message_); + return XTOOLTALK_MESSAGE (message_)->m; } DEFUN ("tooltalk-message-p", Ftooltalk_message_p, 1, 1, 0, /* @@ -208,7 +208,7 @@ */ (object)) { - return (TOOLTALK_MESSAGEP (object) ? Qt : Qnil); + return TOOLTALK_MESSAGEP (object) ? Qt : Qnil; } @@ -285,7 +285,7 @@ */ (object)) { - return (TOOLTALK_PATTERNP (object) ? Qt : Qnil); + return TOOLTALK_PATTERNP (object) ? Qt : Qnil; } @@ -318,13 +318,12 @@ { /* This function can GC */ Tt_message mess = tt_message_receive (); - Lisp_Object msg = make_tooltalk_message (mess); + Lisp_Object message_ = make_tooltalk_message (mess); struct gcpro gcpro1; - GCPRO1 (msg); + GCPRO1 (message_); if (mess != NULL && !NILP (Vtooltalk_unprocessed_message_hook)) - va_run_hook_with_args (Qtooltalk_unprocessed_message_hook, 1, - msg); + va_run_hook_with_args (Qtooltalk_unprocessed_message_hook, 1, message_); UNGCPRO; /* see comment in event-stream.c about this return value. */ @@ -336,7 +335,7 @@ { /* This function can GC */ Lisp_Object cb; - Lisp_Object msg; + Lisp_Object message_; Lisp_Object pattern; struct gcpro gcpro1, gcpro2; @@ -354,22 +353,22 @@ fflush (tooltalk_log_file); #endif - VOID_TO_LISP (msg, tt_message_user (m, TOOLTALK_MESSAGE_KEY)); + VOID_TO_LISP (message_, tt_message_user (m, TOOLTALK_MESSAGE_KEY)); pattern = make_tooltalk_pattern (p); - cb = XTOOLTALK_MESSAGE (msg)->callback; - GCPRO2 (msg, pattern); + cb = XTOOLTALK_MESSAGE (message_)->callback; + GCPRO2 (message_, pattern); if (!NILP (Vtooltalk_message_handler_hook)) - va_run_hook_with_args (Qtooltalk_message_handler_hook, 2, msg, - pattern); + va_run_hook_with_args (Qtooltalk_message_handler_hook, 2, + message_, pattern); if ((SYMBOLP (cb) && EQ (Qt, Ffboundp (cb))) || (CONSP (cb) && EQ (Qlambda, Fcar (cb)) && !NILP (Flistp (Fcar (Fcdr (cb)))))) - call2 (cb, msg, pattern); + call2 (cb, message_, pattern); UNGCPRO; tt_message_destroy (m); - Fremhash (msg, Vtooltalk_message_gcpro); + Fremhash (message_, Vtooltalk_message_gcpro); return TT_CALLBACK_PROCESSED; } @@ -379,7 +378,7 @@ { /* This function can GC */ Lisp_Object cb; - Lisp_Object msg; + Lisp_Object message_; Lisp_Object pattern; struct gcpro gcpro1, gcpro2; @@ -397,16 +396,16 @@ fflush (tooltalk_log_file); #endif - msg = make_tooltalk_message (m); + message_ = make_tooltalk_message (m); VOID_TO_LISP (pattern, tt_pattern_user (p, TOOLTALK_PATTERN_KEY)); cb = XTOOLTALK_PATTERN (pattern)->callback; - GCPRO2 (msg, pattern); + GCPRO2 (message_, pattern); if (!NILP (Vtooltalk_pattern_handler_hook)) - va_run_hook_with_args (Qtooltalk_pattern_handler_hook, 2, msg, - pattern); + va_run_hook_with_args (Qtooltalk_pattern_handler_hook, 2, + message_, pattern); if (SYMBOLP (cb) && EQ (Qt, Ffboundp (cb))) - call2 (cb, msg, pattern); + call2 (cb, message_, pattern); UNGCPRO; tt_message_destroy (m); @@ -543,7 +542,8 @@ return make_string (value, len); } -DEFUN ("get-tooltalk-message-attribute", Fget_tooltalk_message_attribute, 2, 3, 0, /* +DEFUN ("get-tooltalk-message-attribute", + Fget_tooltalk_message_attribute, 2, 3, 0, /* Return the indicated Tooltalk message attribute. Attributes are identified by symbols with the same name (underscores and all) as the suffix of the Tooltalk tt_message_<attribute> function that extracts the value. @@ -573,9 +573,9 @@ Emacs Lisp stores the lengths of strings explicitly (unlike C) so treating the value returned by 'arg_bval like a string is fine. */ - (msg, attribute, argn)) + (message_, attribute, argn)) { - Tt_message m = unbox_tooltalk_message (msg); + Tt_message m = unbox_tooltalk_message (message_); int n = 0; CHECK_SYMBOL (attribute); @@ -668,14 +668,14 @@ return make_int (tt_message_uid (m)); else if (EQ (attribute, Qtt_callback)) - return XTOOLTALK_MESSAGE (msg)->callback; + return XTOOLTALK_MESSAGE (message_)->callback; else if (EQ (attribute, Qtt_prop)) - return Fget (XTOOLTALK_MESSAGE (msg)->plist_sym, argn, Qnil); + return Fget (XTOOLTALK_MESSAGE (message_)->plist_sym, argn, Qnil); else if (EQ (attribute, Qtt_plist)) - return Fcopy_sequence (Fsymbol_plist (XTOOLTALK_MESSAGE (msg)-> - plist_sym)); + return Fcopy_sequence (Fsymbol_plist + (XTOOLTALK_MESSAGE (message_)->plist_sym)); else signal_simple_error ("invalid value for `get-tooltalk-message-attribute'", @@ -703,9 +703,9 @@ 'arg_bval then argn must be the number of an already created argument. New arguments can be added to a message with add-tooltalk-message-arg. */ - (value, msg, attribute, argn)) + (value, message_, attribute, argn)) { - Tt_message m = unbox_tooltalk_message (msg); + Tt_message m = unbox_tooltalk_message (message_); int n = 0; CHECK_SYMBOL (attribute); @@ -831,11 +831,11 @@ else if (EQ (attribute, Qtt_callback)) { CHECK_SYMBOL (value); - XTOOLTALK_MESSAGE (msg)->callback = value; + XTOOLTALK_MESSAGE (message_)->callback = value; } else if (EQ (attribute, Qtt_prop)) { - return Fput (XTOOLTALK_MESSAGE (msg)->plist_sym, argn, value); + return Fput (XTOOLTALK_MESSAGE (message_)->plist_sym, argn, value); } else signal_simple_error ("invalid value for `set-tooltalk-message-attribute'", @@ -849,9 +849,9 @@ a reply all message arguments whose mode is TT_INOUT or TT_OUT should have been filled in - see set-tooltalk-message-attribute. */ - (msg, mode)) + (message_, mode)) { - Tt_message m = unbox_tooltalk_message (msg); + Tt_message m = unbox_tooltalk_message (message_); if (NILP (mode)) mode = Qtt_reply; @@ -883,14 +883,14 @@ (no_callback)) { Tt_message m = tt_message_create (); - Lisp_Object msg = make_tooltalk_message (m); + Lisp_Object message_ = make_tooltalk_message (m); if (NILP (no_callback)) { tt_message_callback_add (m, tooltalk_message_callback); } tt_message_session_set (m, tt_default_session ()); - tt_message_user_set (m, TOOLTALK_MESSAGE_KEY, LISP_TO_VOID (msg)); - return msg; + tt_message_user_set (m, TOOLTALK_MESSAGE_KEY, LISP_TO_VOID (message_)); + return message_; } DEFUN ("destroy-tooltalk-message", Fdestroy_tooltalk_message, 1, 1, 0, /* @@ -899,9 +899,9 @@ a message or pattern callback; the Lisp/Tooltalk callback machinery does this for you. */ - (msg)) + (message_)) { - Tt_message m = unbox_tooltalk_message (msg); + Tt_message m = unbox_tooltalk_message (message_); if (VALID_TOOLTALK_MESSAGEP (m)) /* #### Should we call Fremhash() here? It seems that @@ -937,9 +937,9 @@ want to initialize the argument with a string that can contain embedded nulls (use 'arg_bval). */ - (msg, mode, vtype, value)) + (message_, mode, vtype, value)) { - Tt_message m = unbox_tooltalk_message (msg); + Tt_message m = unbox_tooltalk_message (message_); Tt_mode n; CHECK_STRING (vtype); @@ -973,14 +973,14 @@ Once the message has been sent it's almost always a good idea to get rid of it with `destroy-tooltalk-message'. */ - (msg)) + (message_)) { - Tt_message m = unbox_tooltalk_message (msg); + Tt_message m = unbox_tooltalk_message (message_); if (VALID_TOOLTALK_MESSAGEP (m)) { tt_message_send (m); - Fputhash (msg, Qnil, Vtooltalk_message_gcpro); + Fputhash (message_, Qnil, Vtooltalk_message_gcpro); } return Qnil; @@ -1227,8 +1227,8 @@ (pattern)) { CHECK_TOOLTALK_PATTERN (pattern); - return Fcopy_sequence - (Fsymbol_plist (XTOOLTALK_PATTERN (pattern)->plist_sym)); + return + Fcopy_sequence (Fsymbol_plist (XTOOLTALK_PATTERN (pattern)->plist_sym)); } DEFUN ("tooltalk-default-procid", Ftooltalk_default_procid, 0, 0, 0, /* @@ -1312,7 +1312,7 @@ if (noninteractive) error ("Can't connect to ToolTalk in batch mode."); init_tooltalk (); - return (NILP (Vtooltalk_fd) ? Qnil : Qt); + return NILP (Vtooltalk_fd) ? Qnil : Qt; }