comparison src/tooltalk.c @ 70:131b0175ea99 r20-0b30

Import from CVS: tag r20-0b30
author cvs
date Mon, 13 Aug 2007 09:02:59 +0200
parents e04119814345
children c7528f8e288d
comparison
equal deleted inserted replaced
69:804d1389bcd6 70:131b0175ea99
416 static Lisp_Object 416 static Lisp_Object
417 tt_mode_symbol (Tt_mode n) 417 tt_mode_symbol (Tt_mode n)
418 { 418 {
419 switch (n) 419 switch (n)
420 { 420 {
421 case TT_MODE_UNDEFINED: return Q_TT_MODE_UNDEFINED; 421 case TT_MODE_UNDEFINED: return Q_TT_MODE_UNDEFINED;
422 case TT_IN: return Q_TT_IN; 422 case TT_IN: return Q_TT_IN;
423 case TT_OUT: return Q_TT_OUT; 423 case TT_OUT: return Q_TT_OUT;
424 case TT_INOUT: return Q_TT_INOUT; 424 case TT_INOUT: return Q_TT_INOUT;
425 case TT_MODE_LAST: return Q_TT_MODE_LAST; 425 case TT_MODE_LAST: return Q_TT_MODE_LAST;
426 default: return Qnil; 426 default: return Qnil;
427 } 427 }
428 } 428 }
429 429
430 static Lisp_Object 430 static Lisp_Object
431 tt_scope_symbol (Tt_scope n) 431 tt_scope_symbol (Tt_scope n)
432 { 432 {
433 switch (n) 433 switch (n)
434 { 434 {
435 case TT_SCOPE_NONE: return Q_TT_SCOPE_NONE; 435 case TT_SCOPE_NONE: return Q_TT_SCOPE_NONE;
436 case TT_SESSION: return Q_TT_SESSION; 436 case TT_SESSION: return Q_TT_SESSION;
437 case TT_FILE: return Q_TT_FILE; 437 case TT_FILE: return Q_TT_FILE;
438 case TT_BOTH: return Q_TT_BOTH; 438 case TT_BOTH: return Q_TT_BOTH;
439 case TT_FILE_IN_SESSION: return Q_TT_FILE_IN_SESSION; 439 case TT_FILE_IN_SESSION: return Q_TT_FILE_IN_SESSION;
440 default: return Qnil; 440 default: return Qnil;
441 } 441 }
442 } 442 }
443 443
444 444
445 static Lisp_Object 445 static Lisp_Object
446 tt_class_symbol (Tt_class n) 446 tt_class_symbol (Tt_class n)
447 { 447 {
448 switch (n) 448 switch (n)
449 { 449 {
450 case TT_CLASS_UNDEFINED: return Q_TT_CLASS_UNDEFINED; 450 case TT_CLASS_UNDEFINED: return Q_TT_CLASS_UNDEFINED;
451 case TT_NOTICE: return Q_TT_NOTICE; 451 case TT_NOTICE: return Q_TT_NOTICE;
452 case TT_REQUEST: return Q_TT_REQUEST; 452 case TT_REQUEST: return Q_TT_REQUEST;
453 case TT_CLASS_LAST: return Q_TT_CLASS_LAST; 453 case TT_CLASS_LAST: return Q_TT_CLASS_LAST;
454 default: return Qnil; 454 default: return Qnil;
455 } 455 }
456 } 456 }
457 457
458 /* 458 /*
459 * This is not being used. Is that a mistake or is this function 459 * This is not being used. Is that a mistake or is this function
463 static Lisp_Object 463 static Lisp_Object
464 tt_category_symbol (Tt_category n) 464 tt_category_symbol (Tt_category n)
465 { 465 {
466 switch (n) 466 switch (n)
467 { 467 {
468 case TT_CATEGORY_UNDEFINED: return Q_TT_CATEGORY_UNDEFINED; 468 case TT_CATEGORY_UNDEFINED: return Q_TT_CATEGORY_UNDEFINED;
469 case TT_OBSERVE: return Q_TT_OBSERVE; 469 case TT_OBSERVE: return Q_TT_OBSERVE;
470 case TT_HANDLE: return Q_TT_HANDLE; 470 case TT_HANDLE: return Q_TT_HANDLE;
471 case TT_CATEGORY_LAST: return Q_TT_CATEGORY_LAST; 471 case TT_CATEGORY_LAST: return Q_TT_CATEGORY_LAST;
472 default: return Qnil; 472 default: return Qnil;
473 } 473 }
474 } 474 }
475 #endif /* 0 */ 475 #endif /* 0 */
476 476
477 static Lisp_Object 477 static Lisp_Object
478 tt_address_symbol (Tt_address n) 478 tt_address_symbol (Tt_address n)
479 { 479 {
480 switch (n) 480 switch (n)
481 { 481 {
482 case TT_PROCEDURE: return Q_TT_PROCEDURE; 482 case TT_PROCEDURE: return Q_TT_PROCEDURE;
483 case TT_OBJECT: return Q_TT_OBJECT; 483 case TT_OBJECT: return Q_TT_OBJECT;
484 case TT_HANDLER: return Q_TT_HANDLER; 484 case TT_HANDLER: return Q_TT_HANDLER;
485 case TT_OTYPE: return Q_TT_OTYPE; 485 case TT_OTYPE: return Q_TT_OTYPE;
486 case TT_ADDRESS_LAST: return Q_TT_ADDRESS_LAST; 486 case TT_ADDRESS_LAST: return Q_TT_ADDRESS_LAST;
487 default: return Qnil; 487 default: return Qnil;
488 } 488 }
489 } 489 }
490 490
491 static Lisp_Object 491 static Lisp_Object
492 tt_state_symbol (Tt_state n) 492 tt_state_symbol (Tt_state n)
493 { 493 {
494 switch (n) 494 switch (n)
495 { 495 {
496 case TT_CREATED: return Q_TT_CREATED; 496 case TT_CREATED: return Q_TT_CREATED;
497 case TT_SENT: return Q_TT_SENT; 497 case TT_SENT: return Q_TT_SENT;
498 case TT_HANDLED: return Q_TT_HANDLED; 498 case TT_HANDLED: return Q_TT_HANDLED;
499 case TT_FAILED: return Q_TT_FAILED; 499 case TT_FAILED: return Q_TT_FAILED;
500 case TT_QUEUED: return Q_TT_QUEUED; 500 case TT_QUEUED: return Q_TT_QUEUED;
501 case TT_STARTED: return Q_TT_STARTED; 501 case TT_STARTED: return Q_TT_STARTED;
502 case TT_REJECTED: return Q_TT_REJECTED; 502 case TT_REJECTED: return Q_TT_REJECTED;
503 case TT_STATE_LAST: return Q_TT_STATE_LAST; 503 case TT_STATE_LAST: return Q_TT_STATE_LAST;
504 default: return Qnil; 504 default: return Qnil;
505 } 505 }
506 } 506 }
507 507
508 static Lisp_Object 508 static Lisp_Object
509 tt_build_string (char *s) 509 tt_build_string (char *s)
931 and VALUE can be a string or an integer. Tooltalk doesn't 931 and VALUE can be a string or an integer. Tooltalk doesn't
932 define any semantics for VTYPE, so only the participants in the 932 define any semantics for VTYPE, so only the participants in the
933 protocol you're using need to agree what types mean (if anything). 933 protocol you're using need to agree what types mean (if anything).
934 Conventionally \"string\" is used for strings and \"int\" for 32 bit integers. 934 Conventionally \"string\" is used for strings and \"int\" for 32 bit integers.
935 Arguments can initialized by providing a value or with 935 Arguments can initialized by providing a value or with
936 `set-tooltalk-message-attribute'. The latter is necessary if you 936 `set-tooltalk-message-attribute'. The latter is neccessary if you
937 want to initialize the argument with a string that can contain 937 want to initialize the argument with a string that can contain
938 embedded nulls (use 'arg_bval). 938 embedded nulls (use 'arg_bval).
939 */ 939 */
940 (msg, mode, vtype, value)) 940 (msg, mode, vtype, value))
941 { 941 {
1130 Mode must be one of TT_IN, TT_INOUT, or TT_OUT, type must be a string. 1130 Mode must be one of TT_IN, TT_INOUT, or TT_OUT, type must be a string.
1131 Value can be an integer, string or nil. If value is an integer then 1131 Value can be an integer, string or nil. If value is an integer then
1132 an integer argument (tt_pattern_iarg_add) added otherwise a string argument 1132 an integer argument (tt_pattern_iarg_add) added otherwise a string argument
1133 is added. At present there's no way to add a binary data argument. 1133 is added. At present there's no way to add a binary data argument.
1134 */ 1134 */
1135 (pattern, mode, vtype, value)) 1135 (pattern, mode, vtype, value))
1136 { 1136 {
1137 Tt_pattern p = unbox_tooltalk_pattern (pattern); 1137 Tt_pattern p = unbox_tooltalk_pattern (pattern);
1138 Tt_mode n; 1138 Tt_mode n;
1139 1139
1140 CHECK_STRING (vtype); 1140 CHECK_STRING (vtype);