Skip to content

Commit

Permalink
refactor: remove extern "C" from job code callbacks
Browse files Browse the repository at this point in the history
  • Loading branch information
SamuelBoerlin authored and arogge committed Aug 5, 2023
1 parent 8dc1d2e commit 5ec88ca
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion core/src/dird/dird_conf.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3083,7 +3083,7 @@ static void StoreRunscript(LEX* lc, ResourceItem* item, int index, int pass)
* %m = Prev Backup JobId
* %M = New Backup JobId
*/
extern "C" std::optional<std::string> job_code_callback_director(JobControlRecord* jcr,
std::optional<std::string> job_code_callback_director(JobControlRecord* jcr,
const char* param)
{
static const std::string yes = "yes";
Expand Down
2 changes: 1 addition & 1 deletion core/src/dird/dird_conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -679,7 +679,7 @@ bool print_datatype_schema_json(PoolMem& buffer,
json_t* json_datatype(const int type, ResourceItem items[]);
const char* AuthenticationProtocolTypeToString(uint32_t auth_protocol);
const char* JobLevelToString(int level);
extern "C" std::optional<std::string> job_code_callback_director(JobControlRecord* jcr, const char*);
std::optional<std::string> job_code_callback_director(JobControlRecord* jcr, const char*);
const char* GetUsageStringForConsoleConfigureCommand();
void DestroyConfigureUsageString();
bool PopulateDefs();
Expand Down
2 changes: 0 additions & 2 deletions core/src/filed/dir_cmd.cc
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,6 @@ static alist<pthread_t*>* client_initiated_connection_threads = nullptr;
extern bool AccurateCmd(JobControlRecord* jcr);
extern bool StatusCmd(JobControlRecord* jcr);
extern bool QstatusCmd(JobControlRecord* jcr);
extern "C" std::optional<std::string> job_code_callback_filed(JobControlRecord* jcr,
const char* param);

/* Forward referenced functions */
static bool BackupCmd(JobControlRecord* jcr);
Expand Down
2 changes: 1 addition & 1 deletion core/src/filed/fileset.cc
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ namespace filedaemon {
* %D = Director
* %m = Modification time (for incremental and differential)
*/
extern "C" std::optional<std::string> job_code_callback_filed(JobControlRecord* jcr,
std::optional<std::string> job_code_callback_filed(JobControlRecord* jcr,
const char* param)
{
switch (param[0]) {
Expand Down
2 changes: 2 additions & 0 deletions core/src/filed/fileset.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ int AddWildToFileset(JobControlRecord* jcr, const char* item, int type);
int AddOptionsFlagsToFileset(JobControlRecord* jcr, const char* item);
void AddFileset(JobControlRecord* jcr, const char* item);
bool TermFileset(JobControlRecord* jcr);
std::optional<std::string> job_code_callback_filed(JobControlRecord* jcr,
const char*);

} /* namespace filedaemon */

Expand Down
2 changes: 0 additions & 2 deletions core/src/lib/message.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,7 @@

class JobControlRecord;

extern "C" {
typedef std::optional<std::string> (*job_code_callback_t)(JobControlRecord*, const char*);
}

void Jmsg(JobControlRecord* jcr, int type, utime_t mtime, const char* fmt, ...);
void Qmsg(JobControlRecord* jcr, int type, utime_t mtime, const char* fmt, ...);
Expand Down

0 comments on commit 5ec88ca

Please sign in to comment.