Skip to content

Commit

Permalink
squash. more deprecations.
Browse files Browse the repository at this point in the history
  • Loading branch information
korydraughn committed Mar 20, 2024
1 parent 513703a commit 639d46c
Show file tree
Hide file tree
Showing 11 changed files with 38 additions and 14 deletions.
1 change: 1 addition & 0 deletions lib/api/include/irods/apiNumberData.h
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ API_NUMBER(MOD_AVU_METADATA_AN, 706)
API_NUMBER(MOD_ACCESS_CONTROL_AN, 707)
API_NUMBER(RULE_EXEC_MOD_AN, 708)
API_NUMBER(GET_TEMP_PASSWORD_AN, 709)
// DEPRECATED: GeneralUpdate is deprecated. Its use should be avoided.
API_NUMBER(GENERAL_UPDATE_AN, 710)
API_NUMBER(READ_COLLECTION_AN, 713)
API_NUMBER(USER_ADMIN_AN, 714)
Expand Down
5 changes: 2 additions & 3 deletions lib/api/include/irods/generalUpdate.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@
extern "C" {
#endif

int rcGeneralUpdate(rcComm_t* conn, generalUpdateInp_t* generalUpdateInp)
__attribute__((deprecated("rcGeneralUpdate is deprecated and will be removed in a later release. If you are "
"reaching for this, consider revising your approach.")));
__attribute__((deprecated("Its use should be avoided.")))
int rcGeneralUpdate(rcComm_t* conn, generalUpdateInp_t* generalUpdateInp);

#ifdef __cplusplus
} // extern "C"
Expand Down
4 changes: 2 additions & 2 deletions lib/core/include/irods/rodsGeneralUpdate.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@
#define UPDATE_NOW_TIME "update_now_time"

#define GeneralUpdateInp_PI "int type; struct InxValPair_PI;"
typedef struct GeneralUpdateInp {

__attribute__((deprecated)) typedef struct __attribute__((deprecated)) GeneralUpdateInp { // NOLINT(modernize-use-using)
int type; /* GEN_UPDATE_INSERT or DELETE */
inxValPair_t values; /* Column IDs (from rodsGenQuery.h) and values */
} generalUpdateInp_t;


#endif // RODS_GENERAL_UPDATE_H__
9 changes: 9 additions & 0 deletions plugins/database/src/db_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15406,11 +15406,17 @@ irods::error db_gen_query_ticket_setup_op(

// =-=-=-=-=-=-=-
// from general_query.cpp ::
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
int chl_general_update_impl( generalUpdateInp_t );
#pragma clang diagnostic pop

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
irods::error db_general_update_op(
irods::plugin_context& _ctx,
generalUpdateInp_t* _update_inp ) {
#pragma clang diagnostic pop
// =-=-=-=-=-=-=-
// check the context
irods::error ret = _ctx.valid();
Expand Down Expand Up @@ -16178,10 +16184,13 @@ irods::database* plugin_factory(
DATABASE_OP_GEN_QUERY,
function<error(plugin_context&,genQueryInp_t*,genQueryOut_t*)>(
db_gen_query_op ) );
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
pg->add_operation(
DATABASE_OP_GENERAL_UPDATE,
function<error(plugin_context&,generalUpdateInp_t*)>(
db_general_update_op ) );
#pragma clang diagnostic pop
pg->add_operation(
DATABASE_OP_GEN_QUERY_ACCESS_CONTROL_SETUP,
function<error(plugin_context&,const char*,const char*,const char*,int,int)>(
Expand Down
9 changes: 9 additions & 0 deletions plugins/database/src/general_update.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,11 @@ int updateDebug = 0;
extern int logSQLGenUpdate;
char tSQL[MAX_SQL_SIZE];

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
int
generalInsert( generalUpdateInp_t generalUpdateInp ) {
#pragma clang diagnostic pop
int i, j;
char *tableName, *columnName;
char *firstTableName;
Expand Down Expand Up @@ -127,8 +130,11 @@ generalInsert( generalUpdateInp_t generalUpdateInp ) {
return 0;
}

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
int
generalDelete( generalUpdateInp_t generalUpdateInp ) {
#pragma clang diagnostic pop
int i, j;
char *tableName, *columnName;
char *firstTableName;
Expand Down Expand Up @@ -180,9 +186,12 @@ generalDelete( generalUpdateInp_t generalUpdateInp ) {
}


#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
/* General Update */
int chl_general_update_impl(
generalUpdateInp_t generalUpdateInp ) {
#pragma clang diagnostic pop
int status;
static int firstCall = 1;
icatSessionStruct *icss;
Expand Down
8 changes: 5 additions & 3 deletions server/api/include/irods/rsGeneralUpdate.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@
#include "irods/rcConnect.h"
#include "irods/rodsGeneralUpdate.h"

int rsGeneralUpdate(rsComm_t* rsComm, generalUpdateInp_t* generalUpdateInp)
__attribute__((deprecated("rsGeneralUpdate is deprecated and will be removed in a later release. If you are "
"reaching for this, consider revising your approach.")));
__attribute__((deprecated("Its use should be avoided.")))
int rsGeneralUpdate(rsComm_t* rsComm, generalUpdateInp_t* generalUpdateInp);

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
int _rsGeneralUpdate( generalUpdateInp_t *generalUpdateInp );
#pragma clang diagnostic pop

#endif // IRODS_RS_GENERAL_UPDATE_HPP
6 changes: 3 additions & 3 deletions server/api/src/rsGeneralUpdate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,10 @@ rsGeneralUpdate( rsComm_t *rsComm, generalUpdateInp_t *generalUpdateInp ) {
return status;
}

int
_rsGeneralUpdate( generalUpdateInp_t *generalUpdateInp ) {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
int
_rsGeneralUpdate( generalUpdateInp_t *generalUpdateInp ) {
return chlGeneralUpdate(*generalUpdateInp);
#pragma clang diagnostic pop
}
#pragma clang diagnostic pop
1 change: 1 addition & 0 deletions server/core/include/irods/irods_api_calling_functions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -601,6 +601,7 @@ int call_getTempPasswordOut(
#endif

#ifdef CREATE_API_TABLE_FOR_SERVER
[[deprecated("GeneralUpdate is deprecated. Its use should be avoided.")]]
int call_generalUpdateInp(
irods::api_entry*,
rsComm_t*,
Expand Down
1 change: 1 addition & 0 deletions server/core/include/irods/irods_database_constants.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ namespace irods
const std::string DATABASE_OP_GEN_QUERY_ACCESS_CONTROL_SETUP( "database_gen_query_access_control_setup" );
const std::string DATABASE_OP_GEN_QUERY_TICKET_SETUP( "database_gen_query_ticket_setup" );
const std::string DATABASE_OP_SPECIFIC_QUERY( "database_specific_query" );
[[deprecated("GeneralUpdate is deprecated. Its use should be avoided.")]]
const std::string DATABASE_OP_GENERAL_UPDATE( "database_general_update" );
const std::string DATABASE_OP_DEL_COLL_BY_ADMIN( "database_del_coll_by_admin" );
const std::string DATABASE_OP_DEL_COLL( "database_del_coll" );
Expand Down
3 changes: 3 additions & 0 deletions server/core/src/irods_api_calling_functions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -647,6 +647,8 @@ int call_ruleExecModInp(
_inp);
}

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
int call_generalUpdateInp(
irods::api_entry* _api,
rsComm_t* _comm,
Expand All @@ -656,6 +658,7 @@ int call_generalUpdateInp(
_comm,
_inp);
}
#pragma clang diagnostic pop

int call_modDataObjMetaInp(
irods::api_entry* _api,
Expand Down
5 changes: 2 additions & 3 deletions server/icat/include/irods/icatHighLevelRoutines.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,8 @@ int chlGenQueryTicketSetup( const char *ticket, const char *clientAddr );
int chlSpecificQuery( specificQueryInp_t specificQueryInp,
genQueryOut_t *genQueryOut );

int chlGeneralUpdate(generalUpdateInp_t generalUpdateInp)
__attribute__((deprecated("chlGeneralUpdate is deprecated and will be removed in a later release. If you are "
"reaching for this, consider revising your approach.")));
__attribute__((deprecated("Its use should be avoided.")))
int chlGeneralUpdate(generalUpdateInp_t generalUpdateInp);

int chlDelCollByAdmin( rsComm_t *rsComm, collInfo_t *collInfo );
int chlDelColl( rsComm_t *rsComm, collInfo_t *collInfo );
Expand Down

0 comments on commit 639d46c

Please sign in to comment.