static void rpmverify_additem(probe_ctx *ctx, struct rpmverify_res *res) { SEXP_t *item; #define VF_RESULT(f) (res->oflags & (f) ? "not performed" : (res->vflags & RPMVERIFY_FAILURES ? "not performed" : (res->vflags & (f) ? "fail" : "pass"))) #define FF_RESULT(f) (res->fflags & (f) ? true : false) item = probe_item_create(OVAL_LINUX_RPMVERIFY, NULL, "name", OVAL_DATATYPE_STRING, res->name, "filepath", OVAL_DATATYPE_STRING, res->file, "size_differs", OVAL_DATATYPE_STRING, VF_RESULT(RPMVERIFY_FILESIZE), "mode_differs", OVAL_DATATYPE_STRING, VF_RESULT(RPMVERIFY_MODE), "md5_differs", OVAL_DATATYPE_STRING, VF_RESULT(RPMVERIFY_MD5), "device_differs", OVAL_DATATYPE_STRING, VF_RESULT(RPMVERIFY_RDEV), "link_mismatch", OVAL_DATATYPE_STRING, VF_RESULT(RPMVERIFY_LINKTO), "ownership_differs", OVAL_DATATYPE_STRING, VF_RESULT(RPMVERIFY_USER), "group_differs", OVAL_DATATYPE_STRING, VF_RESULT(RPMVERIFY_GROUP), "mtime_differs", OVAL_DATATYPE_STRING, VF_RESULT(RPMVERIFY_MTIME), #ifndef HAVE_LIBRPM44 "capabilities_differ", OVAL_DATATYPE_STRING, VF_RESULT(RPMVERIFY_CAPS), #endif "configuration_file", OVAL_DATATYPE_BOOLEAN, FF_RESULT(RPMFILE_CONFIG), "documentation_file", OVAL_DATATYPE_BOOLEAN, FF_RESULT(RPMFILE_DOC), "ghost_file", OVAL_DATATYPE_BOOLEAN, FF_RESULT(RPMFILE_GHOST), "license_file", OVAL_DATATYPE_BOOLEAN, FF_RESULT(RPMFILE_LICENSE), "readme_file", OVAL_DATATYPE_BOOLEAN, FF_RESULT(RPMFILE_README), NULL); probe_item_collect(ctx, item); }
////-------- /// FF_Shake //------------ // Shake the mouse (play the special "shake" effect) at a given strength // for a given duration. The shake effect can be a compound containing // multiple component effects, but each component effect's magnitude and // duration will be set to the parameters passed in this function. // // Parameters: // * intensity [0..10000] - Magnitude of effect // * duration [0..MAXINT] - Length of shake in milliseconds // // Returns: // - qtrue: shake started // - qfalse: shake did not start // qboolean FF_Shake(int intensity, int duration) { char message[64]; message[0] = 0; sprintf( message, "intensity=%d, duration=%d", intensity, duration ); FF_PROLOGUE_NOQUOTE( FF_Shake, message ); FF_RESULT( gFFSystem.Shake( intensity, duration, qboolean( ensureShake->integer != qfalse ) ) ); FF_EPILOGUE; }
////------- /// FF_Stop //----------- // Stop an effect. Only returns qfalse if there's an error // // Parameters: // * ff: handle to a playing effect // // Returns: // - qtrue: no errors occurred // - qfalse: an error occurred // qboolean FF_Stop(ffHandle_t ff) { FF_PROLOGUE( FF_Stop, gFFSystem.GetName( ff ) ); FF_RESULT( gFFSystem.Stop( ff ) ); FF_EPILOGUE; }
////---------- /// FF_StopAll //-------------- // Stop all currently playing effects. // // Parameters: // None // // Returns: // - qtrue: no errors occurred // - qfalse: an error occurred // qboolean FF_StopAll(void) { FF_PROLOGUE( FF_StopAll, "" ); FF_RESULT( gFFSystem.StopAll() ); FF_EPILOGUE; }
////------- /// FF_Play //----------- // Start an effect on its registered channel. // // Parameters // * ff: handle to an effect // // Returns: // - qtrue: effect started // - qfalse: effect was not started // qboolean FF_Play(ffHandle_t ff) { FF_PROLOGUE( FF_Play, gFFSystem.GetName( ff ) ); FF_RESULT( gFFSystem.Play( ff ) ); FF_EPILOGUE; }
////---------------- /// FF_EnsurePlaying //-------------------- // Starts an effect if the effect is not currently playing. // Does not restart currently playing effects. // // Parameters: // * ff: handle of an effect // // Returns: // - qtrue: effect started // - qfalse: effect was not started // qboolean FF_EnsurePlaying(ffHandle_t ff) { FF_PROLOGUE( FF_EnsurePlaying, gFFSystem.GetName( ff ) ); FF_RESULT( gFFSystem.EnsurePlaying( ff ) ); FF_EPILOGUE; }