comparison libpurple/plugins/tcl/tcl_cmds.c @ 32819:2c6510167895 default tip

propagate from branch 'im.pidgin.pidgin.2.x.y' (head 3315c5dfbd0ad16511bdcf865e5b07c02d07df24) to branch 'im.pidgin.pidgin' (head cbd1eda6bcbf0565ae7766396bb8f6f419cb6a9a)
author Elliott Sales de Andrade <qulogic@pidgin.im>
date Sat, 02 Jun 2012 02:30:49 +0000
parents 80eabeb5b794
children
comparison
equal deleted inserted replaced
32818:01ff09d4a463 32819:2c6510167895
1638 } 1638 }
1639 1639
1640 int tcl_cmd_status_type(ClientData unused, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) 1640 int tcl_cmd_status_type(ClientData unused, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])
1641 { 1641 {
1642 const char *cmds[] = { "attr", "attrs", "available", "exclusive", "id", 1642 const char *cmds[] = { "attr", "attrs", "available", "exclusive", "id",
1643 "independent", "name", "primary_attr", 1643 "independent", "name",
1644 "primitive", "saveable", "user_settable", 1644 "primitive", "saveable", "user_settable",
1645 NULL }; 1645 NULL };
1646 enum { CMD_STATUS_TYPE_ATTR, CMD_STATUS_TYPE_ATTRS, 1646 enum { CMD_STATUS_TYPE_ATTR, CMD_STATUS_TYPE_ATTRS,
1647 CMD_STATUS_TYPE_AVAILABLE, CMD_STATUS_TYPE_EXCLUSIVE, 1647 CMD_STATUS_TYPE_AVAILABLE, CMD_STATUS_TYPE_EXCLUSIVE,
1648 CMD_STATUS_TYPE_ID, CMD_STATUS_TYPE_INDEPENDENT, 1648 CMD_STATUS_TYPE_ID, CMD_STATUS_TYPE_INDEPENDENT,
1649 CMD_STATUS_TYPE_NAME, CMD_STATUS_TYPE_PRIMARY_ATTR, 1649 CMD_STATUS_TYPE_NAME,
1650 CMD_STATUS_TYPE_PRIMITIVE, CMD_STATUS_TYPE_SAVEABLE, 1650 CMD_STATUS_TYPE_PRIMITIVE, CMD_STATUS_TYPE_SAVEABLE,
1651 CMD_STATUS_TYPE_USER_SETTABLE } cmd; 1651 CMD_STATUS_TYPE_USER_SETTABLE } cmd;
1652 PurpleStatusType *status_type; 1652 PurpleStatusType *status_type;
1653 Tcl_Obj *list, *elem; 1653 Tcl_Obj *list, *elem;
1654 GList *cur; 1654 GList *cur;
1749 return TCL_ERROR; 1749 return TCL_ERROR;
1750 Tcl_SetObjResult(interp, 1750 Tcl_SetObjResult(interp,
1751 Tcl_NewStringObj(purple_primitive_get_id_from_type 1751 Tcl_NewStringObj(purple_primitive_get_id_from_type
1752 (purple_status_type_get_primitive(status_type)), -1)); 1752 (purple_status_type_get_primitive(status_type)), -1));
1753 break; 1753 break;
1754 case CMD_STATUS_TYPE_PRIMARY_ATTR:
1755 #if !(defined PURPLE_DISABLE_DEPRECATED)
1756 if (objc != 3) {
1757 Tcl_WrongNumArgs(interp, 2, objv, "statustype");
1758 return TCL_ERROR;
1759 }
1760 if ((status_type = purple_tcl_ref_get(interp, objv[2], PurpleTclRefStatusType)) == NULL)
1761 return TCL_ERROR;
1762 Tcl_SetObjResult(interp,
1763 Tcl_NewStringObj(purple_status_type_get_primary_attr(status_type), -1));
1764 #endif
1765 break;
1766 case CMD_STATUS_TYPE_SAVEABLE: 1754 case CMD_STATUS_TYPE_SAVEABLE:
1767 if (objc != 3) { 1755 if (objc != 3) {
1768 Tcl_WrongNumArgs(interp, 2, objv, "statustype"); 1756 Tcl_WrongNumArgs(interp, 2, objv, "statustype");
1769 return TCL_ERROR; 1757 return TCL_ERROR;
1770 } 1758 }