bool permission_setOp(const char* name) { User* tempuser = User::byNick(name); if (tempuser == NULL) { return false; } tempuser->permissions = 0; // reset any previous permissions SET_OP(tempuser->permissions); return true; }
bool permission_setOp(const char* name) { User* tempuser = userFromName(std::string(name)); if (tempuser == NULL) { return false; } tempuser->permissions = 0; // reset any previous permissions SET_OP(tempuser->permissions); return true; }
GLOBAL void InitOperatorTable() { SET_OP(':', ":", "COLON", 0, 16); SET_OP(DESIGNATED_INITIALIZER, "=", "DESIGNATED_INITIALIZER", 0, 16); /* this is the .x=y syntax*/ SET_OP(ARRAY_LABELED_INITIALIZER, "]=", "ARRAY_LABELED_INITIALIZER", 0, 16); /* this is the [x]=y syntax*/ SET_OP(ARROW, "->", "ARROW", 0, 15); SET_OP('.', ".", "DOT", 0, 15); SET_OP('!', "!", "not", 14, 0); SET_OP('~', "~", "bitnot", 14, 0); SET_OP(ICR, "++", "ICR", 14, 0); SET_OP(POSTINC, "++", "postinc", 14, 0); SET_OP(PREINC, "++", "preinc", 14, 0); SET_OP(DECR, "--", "DECR", 14, 0); SET_OP(POSTDEC, "--", "postdec", 14, 0); SET_OP(PREDEC, "--", "predec", 14, 0); SET_OP(SIZEOF, "sizeof", "sizeof", 14, 0); SET_OP(ALIGNOF, "__alignof__", "alignof", 14, 0); SET_OP(IMAG, "__imag__", "__imag__", 14, 0); SET_OP(REAL, "__real__", "__real__", 14, 0); SET_OP(ADDRESS, "&", "addrof", 14, 0); SET_OP(INDIR, "*", "indir", 14, 0); SET_OP(UPLUS, "+", "UPLUS", 14, 0); SET_OP(UMINUS, "-", "neg", 14, 0); SET_OP('*', "*", "mul", 0, 13); SET_OP('/', "/", "div", 0, 13); SET_OP('%', "%", "mod", 0, 13); SET_OP('+', "+", "add", 0, 12); SET_OP('-', "-", "sub", 0, 12); SET_OP(LS, "<<", "lsh", 0, 11); SET_OP(RS, ">>", "rsh", 0, 11); SET_OP('<', "<", "lt", 0, 10); SET_OP('>', ">", "gt", 0, 10); SET_OP(LE, "<=", "le", 0, 10); SET_OP(GE, ">=", "ge", 0, 10); SET_OP(EQ, "==", "eq", 0, 9); SET_OP(NE, "!=", "ne", 0, 9); SET_OP('&', "&", "band", 0, 8); SET_OP('^', "^", "bxor", 0, 7); SET_OP('|', "|", "bor", 0, 6); SET_OP(ANDAND, "&&", "and", 0, 5); SET_OP(OROR, "||", "or", 0, 4); /* ternary operator has precedence three, but is handled separately */ SET_OP('=', "=", "asgn", 0, 2); RIGHT_ASSOC('='); SET_OP(MULTassign, "*=", "*=", 0, 2); RIGHT_ASSOC(MULTassign); SET_OP(DIVassign, "/=", "/=", 0, 2); RIGHT_ASSOC(DIVassign); SET_OP(MODassign, "%=", "%=", 0, 2); RIGHT_ASSOC(MODassign); SET_OP(PLUSassign, "+=", "+=", 0, 2); RIGHT_ASSOC(PLUSassign); SET_OP(MINUSassign, "-=", "-=", 0, 2); RIGHT_ASSOC(MINUSassign); SET_OP(LSassign, "<<=", "<<=", 0, 2); RIGHT_ASSOC(LSassign); SET_OP(RSassign, ">>=", ">>=", 0, 2); RIGHT_ASSOC(RSassign); SET_OP(ANDassign, "&=", "&=", 0, 2); RIGHT_ASSOC(ANDassign); SET_OP(ERassign, "^=", "^=", 0, 2); RIGHT_ASSOC(ERassign); SET_OP(ORassign, "|=", "|=", 0, 2); RIGHT_ASSOC(ORassign); /* comma operator has precedence one, but is handled separately */ }
int initializeDevDescMethods(pDevDesc dd, SEXP methods) { dd->deviceSpecific = calloc(1, sizeof(RDevDescMethods)); if(!dd->deviceSpecific) return(0); setRMethods((RDevDescMethods *) dd->deviceSpecific, methods); #if 0 dd -> activate = R_activate ; dd -> circle = R_circle ; dd -> clip = R_clip ; dd -> close = R_close ; dd -> deactivate = R_deactivate ; dd -> locator = R_locator ; dd -> line = R_line ; dd -> metricInfo = R_metricInfo ; dd -> mode = R_mode ; dd -> newPage = R_newPage ; dd -> polygon = R_polygon ; dd -> polyline = R_polyline ; dd -> rect = R_rect ; dd -> size = R_size ; dd -> strWidth = R_strWidth ; dd -> text = R_text ; dd -> onExit = R_onExit ; dd -> newFrameConfirm = R_newFrameConfirm ; dd -> textUTF8 = R_textUTF8 ; dd -> strWidthUTF8 = R_strWidthUTF8 ; #else SET_OP(activate ); SET_OP(circle ); SET_OP(clip ); SET_OP(close ); SET_OP(deactivate ); SET_OP(locator ); SET_OP(line ); SET_OP(metricInfo ); SET_OP(mode ); SET_OP(newPage ); SET_OP(polygon ); SET_OP(polyline ); SET_OP(rect ); SET_OP(size ); SET_OP(strWidth ); SET_OP(text ); SET_OP(onExit ); SET_OP(newFrameConfirm ); SET_OP(textUTF8 ); SET_OP(strWidthUTF8 ); #endif return(1); }