Change Multi*Settings() to use std::fs::path

This commit is contained in:
Azamat H. Hackimov 2024-07-16 02:33:41 +03:00
parent 7a3f46ad4c
commit b30597ae90
3 changed files with 13 additions and 7 deletions

View File

@ -67,14 +67,16 @@
* $NoKeywords: $
*/
#include <stdio.h>
#include <cstdio>
#include <filesystem>
#include "cfile.h"
#include "multi.h"
#include "objinfo.h"
#include "ship.h"
#include "multi_save_settings.h"
int MultiSaveSettings(const char *filename) {
int MultiSaveSettings(const std::filesystem::path &filename) {
CFILE *cf;
char szoutput[MAX_MPS_LINE_LEN];
int i;
@ -137,7 +139,7 @@ int MultiSaveSettings(const char *filename) {
return 1;
}
int MultiLoadSettings(const char *filename) {
int MultiLoadSettings(const std::filesystem::path &filename) {
CFILE *cf;
char szinput[MAX_MPS_LINE_LEN];
char *toklabel, *tokval;

View File

@ -43,9 +43,11 @@
#ifndef _MULTI_SAVE_SETTINGS_HEADER
#define _MULTI_SAVE_SETTINGS_HEADER
#include <filesystem>
#define MAX_MPS_LINE_LEN 200
int MultiSaveSettings(const char *filename);
int MultiLoadSettings(const char *filename);
int MultiSaveSettings(const std::filesystem::path &filename);
int MultiLoadSettings(const std::filesystem::path &filename);
#endif

View File

@ -264,11 +264,13 @@
*/
///////////////////////////////////////////////
#include <filesystem>
#include "ship.h"
#include "pstypes.h"
#if defined(POSIX)
#include <string.h>
#include <cstring>
#include "linux_fix.h"
#endif
@ -635,7 +637,7 @@ MultiDoConfigSave_fp DLLMultiDoConfigSave;
typedef void (*MultiDoConfigLoad_fp)(void);
MultiDoConfigLoad_fp DLLMultiDoConfigLoad;
typedef int (*MultiLoadSettings_fp)(const char *filename);
typedef int (*MultiLoadSettings_fp)(const std::filesystem::path &filename);
MultiLoadSettings_fp DLLMultiLoadSettings;
typedef void *(*NetworkReceiveCallback)(uint8_t *data, int len, network_address *from);