Skip to content

Commit a15c688

Browse files
committed
misc: unify terminology
8+3 filename → 8.3 filename be ware → beware {cannot, can not, can't, could not, couldn't} → unable to familly → family file name → filename informations → information plateform → platform trial → attempt trying to → attempting to {web-server, webserver} → Web server Change-Id: I33b1a0091b5af4f0f055bd4c21b2a05a39adbc50 GitLab: https://git.jami.net/savoirfairelinux/jami-client-qt/issues/1730
1 parent 18515ae commit a15c688

23 files changed

+120
-120
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -99,11 +99,11 @@ DHTNet depends on the following libraries:
9999

100100
## Packaging and release
101101

102-
In `extras/packaging`, you will find a `build_packages.sh` script which will build packages for supported plateform. You must provide as argument the OS for which you want to build. You can't specify the plateform (arm64, x86, ...) as you can compile only for the same plateform as the one you are running on.
102+
In `extras/packaging`, you will find a `build_packages.sh` script which will build packages for supported platform. You must provide as argument the OS for which you want to build. You are unable to specify the platform (arm64, x86, ...) as you can compile only for the same platform as the one you are running on.
103103

104104
**Usage:**
105105
```bash
106-
extras/packaging/build_packages.sh -a # -a or --all will build all plateform which are known to be supported
106+
extras/packaging/build_packages.sh -a # -a or --all will build all platform which are known to be supported
107107
extras/packaging/build_packages.sh -u # -u or --ubuntu will build for all supported versions of Ubuntu
108108
extras/packaging/build_packages.sh -u22 -d11 # -u22 will build for ubuntu 22.04 and -d11 will build for Debian 11
109109
```

include/compat/msvc/windirent.h

+27-27
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@
145145
#define S_IXOTH 0
146146
#endif
147147

148-
/* Maximum length of file name */
148+
/* Maximum length of filename */
149149
#if !defined(PATH_MAX)
150150
#define PATH_MAX MAX_PATH
151151
#endif
@@ -171,7 +171,7 @@
171171
#define DTTOIF(type) (type)
172172

173173
/*
174-
* File type macros. Note that block devices, sockets and links cannot be
174+
* File type macros. Note that block devices, sockets and links are unable to be
175175
* distinguished on Windows and the macros S_ISBLK, S_ISSOCK and S_ISLNK are
176176
* only defined for compatibility. These macros should always return false
177177
* on Windows.
@@ -223,7 +223,7 @@ struct _wdirent
223223
/* File type */
224224
int d_type;
225225

226-
/* File name */
226+
/* Filename */
227227
wchar_t d_name[PATH_MAX];
228228
};
229229
typedef struct _wdirent _wdirent;
@@ -275,7 +275,7 @@ struct dirent
275275
/* File type */
276276
int d_type;
277277

278-
/* File name */
278+
/* Filename */
279279
char d_name[PATH_MAX];
280280
};
281281
typedef struct dirent dirent;
@@ -385,24 +385,24 @@ _wopendir(const wchar_t* dirname)
385385
/* Directory stream opened successfully */
386386
error = 0;
387387
} else {
388-
/* Cannot retrieve first entry */
388+
/* Unable to retrieve first entry */
389389
error = 1;
390390
dirent_set_errno(ENOENT);
391391
}
392392

393393
} else {
394-
/* Cannot retrieve full path name */
394+
/* Unable to retrieve full path name */
395395
dirent_set_errno(ENOENT);
396396
error = 1;
397397
}
398398

399399
} else {
400-
/* Cannot allocate memory for search pattern */
400+
/* Unable to allocate memory for search pattern */
401401
error = 1;
402402
}
403403

404404
} else {
405-
/* Cannot allocate _WDIR structure */
405+
/* Unable to allocate _WDIR structure */
406406
error = 1;
407407
}
408408

@@ -437,8 +437,8 @@ _wreaddir(_WDIR* dirp)
437437
entp = &dirp->ent;
438438

439439
/*
440-
* Copy file name as wide-character string. If the file name is too
441-
* long to fit in to the destination buffer, then truncate file name
440+
* Copy filename as wide-character string. If the filename is too
441+
* long to fit in to the destination buffer, then truncate filename
442442
* to PATH_MAX characters and zero-terminate the buffer.
443443
*/
444444
n = 0;
@@ -448,7 +448,7 @@ _wreaddir(_WDIR* dirp)
448448
}
449449
dirp->ent.d_name[n] = 0;
450450

451-
/* Length of file name excluding zero terminator */
451+
/* Length of filename excluding zero terminator */
452452
entp->d_namlen = n;
453453

454454
/* File type */
@@ -509,7 +509,7 @@ _wclosedir(_WDIR* dirp)
509509

510510
/*
511511
* Rewind directory stream such that _wreaddir() returns the very first
512-
* file name again.
512+
* filename again.
513513
*/
514514
static void
515515
_wrewinddir(_WDIR* dirp)
@@ -619,7 +619,7 @@ opendir(const char* dirname)
619619

620620
} else {
621621
/*
622-
* Cannot convert file name to wide-character string. This
622+
* Unable to convert filename to wide-character string. This
623623
* occurs if the string contains invalid multi-byte sequences or
624624
* the output buffer is too small to contain the resulting
625625
* string.
@@ -628,7 +628,7 @@ opendir(const char* dirname)
628628
}
629629

630630
} else {
631-
/* Cannot allocate DIR structure */
631+
/* Unable to allocate DIR structure */
632632
error = 1;
633633
}
634634

@@ -644,10 +644,10 @@ opendir(const char* dirname)
644644
/*
645645
* Read next directory entry.
646646
*
647-
* When working with text consoles, please note that file names returned by
647+
* When working with text consoles, please note that filenames returned by
648648
* readdir() are represented in the default ANSI code page while any output to
649649
* console is typically formatted on another code page. Thus, non-ASCII
650-
* characters in file names will not usually display correctly on console. The
650+
* characters in filenames will not usually display correctly on console. The
651651
* problem can be fixed in two ways: (1) change the character set of console
652652
* to 1252 using chcp utility and use Lucida Console font, or (2) use
653653
* _cprintf function when writing to console. The _cprinf() will re-encode
@@ -666,16 +666,16 @@ readdir(DIR* dirp)
666666
size_t n;
667667
int error;
668668

669-
/* Attempt to convert file name to multi-byte string */
669+
/* Attempt to convert filename to multi-byte string */
670670
error = dirent_wcstombs_s(&n, dirp->ent.d_name, PATH_MAX, datap->cFileName, PATH_MAX);
671671

672672
/*
673-
* If the file name cannot be represented by a multi-byte string,
674-
* then attempt to use old 8+3 file name. This allows traditional
675-
* Unix-code to access some file names despite of unicode
676-
* characters, although file names may seem unfamiliar to the user.
673+
* If the filename is unable to be represented by a multi-byte string,
674+
* then attempt to use old 8.3 filename. This allows traditional
675+
* Unix-code to access some filenames despite of unicode
676+
* characters, although filenames may seem unfamiliar to the user.
677677
*
678-
* Be ware that the code below cannot come up with a short file
678+
* Beware that the code below is unable to come up with a short file
679679
* name unless the file system provides one. At least
680680
* VirtualBox shared folders fail to do this.
681681
*/
@@ -693,7 +693,7 @@ readdir(DIR* dirp)
693693
/* Initialize directory entry for return */
694694
entp = &dirp->ent;
695695

696-
/* Length of file name excluding zero terminator */
696+
/* Length of filename excluding zero terminator */
697697
entp->d_namlen = n - 1;
698698

699699
/* File attributes */
@@ -712,9 +712,9 @@ readdir(DIR* dirp)
712712

713713
} else {
714714
/*
715-
* Cannot convert file name to multi-byte string so construct
715+
* Unable to convert filename to multi-byte string so construct
716716
* an errornous directory entry and return that. Note that
717-
* we cannot return NULL as that would stop the processing
717+
* we are unable to return NULL as that would stop the processing
718718
* of directory entries completely.
719719
*/
720720
entp = &dirp->ent;
@@ -804,7 +804,7 @@ dirent_mbstowcs_s(
804804
error = 0;
805805

806806
} else {
807-
/* Could not convert string */
807+
/* Unable to convert string */
808808
error = 1;
809809
}
810810

@@ -853,7 +853,7 @@ dirent_wcstombs_s(size_t* pReturnValue,
853853
error = 0;
854854

855855
} else {
856-
/* Cannot convert string */
856+
/* Unable to convert string */
857857
error = 1;
858858
}
859859

include/connectionmanager.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ class ConnectionManager
190190
std::size_t activeSockets() const;
191191

192192
/**
193-
* Log informations for all sockets
193+
* Log information for all sockets
194194
*/
195195
void monitor() const;
196196

include/ice_transport.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ class IceTransport
101101
* to find the right candidate pair.
102102
* This function doesn't block, the callback on_negodone_cb will be called
103103
* with the negotiation result when operation is really done.
104-
* Return false if negotiation cannot be started else true.
104+
* Return false if negotiation is unable to be started else true.
105105
*/
106106
bool startIce(const Attribute& rem_attrs, std::vector<IceCandidate>&& rem_candidates);
107107
bool startIce(const SDP& sdp);

include/multiplexed_socket.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ class MultiplexedSocket : public std::enable_shared_from_this<MultiplexedSocket>
135135
void onShutdown(OnShutdownCb&& cb);
136136

137137
/**
138-
* Get informations from socket (channels opened)
138+
* Get information from socket (channels opened)
139139
*/
140140
void monitor() const;
141141

include/pj_init_lock.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ namespace dhtnet {
2929
// - The first call to pj_init actually initializes the library; subsequent calls do nothing.
3030
// - All calls to pj_shutdown do nothing, except the last one which actually performs the shutdown.
3131
// Unfortunately, the way this logic is implemented in PJSIP is not thread-safe, so we're
32-
// responsible for making sure that these functions can't be called by two threads at the same time.
32+
// responsible for making sure that these functions are unable to be called by two threads at the same time.
3333
class PjInitLock
3434
{
3535
private:

include/string_utils.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,9 @@ to_int(std::string_view str)
7171
if (ec == std::errc())
7272
return result;
7373
if (ec == std::errc::invalid_argument)
74-
throw std::invalid_argument("Can't parse integer: invalid_argument");
74+
throw std::invalid_argument("Unable to parse integer: invalid_argument");
7575
else if (ec == std::errc::result_out_of_range)
76-
throw std::out_of_range("Can't parse integer: out of range");
76+
throw std::out_of_range("Unable to parse integer: out of range");
7777
throw std::system_error(std::make_error_code(ec));
7878
}
7979

src/connectionmanager.cpp

+7-7
Original file line numberDiff line numberDiff line change
@@ -949,7 +949,7 @@ ConnectionManager::Impl::connectDevice(const std::shared_ptr<dht::crypto::Certif
949949
connType, ok] {
950950
auto sthis = w.lock();
951951
if (!ok && sthis && sthis->config_->logger)
952-
sthis->config_->logger->error("[device {}] Cannot initialize ICE session.", devicePk->getLongId());
952+
sthis->config_->logger->error("[device {}] Unable to initialize ICE session.", devicePk->getLongId());
953953
if (!sthis || !ok) {
954954
eraseInfo();
955955
return;
@@ -997,7 +997,7 @@ ConnectionManager::Impl::connectDevice(const std::shared_ptr<dht::crypto::Certif
997997
info->ice_ = sthis->config_->factory->createUTransport("");
998998
if (!info->ice_) {
999999
if (sthis->config_->logger)
1000-
sthis->config_->logger->error("[device {}] Cannot initialize ICE session.", deviceId);
1000+
sthis->config_->logger->error("[device {}] Unable to initialize ICE session.", deviceId);
10011001
eraseInfo();
10021002
return;
10031003
}
@@ -1027,7 +1027,7 @@ ConnectionManager::Impl::sendChannelRequest(const std::weak_ptr<DeviceInfo>& din
10271027
auto channelSock = sock->addChannel(name);
10281028
if (!channelSock) {
10291029
if (config_->logger)
1030-
config_->logger->error("sendChannelRequest failed - cannot create channel");
1030+
config_->logger->error("sendChannelRequest failed - unable to create channel");
10311031
if (auto info = dinfow.lock())
10321032
info->executePendingOperations(vid, nullptr);
10331033
return;
@@ -1088,7 +1088,7 @@ ConnectionManager::Impl::onPeerResponse(PeerConnectionRequest&& req)
10881088
req.id));
10891089
} else {
10901090
if (config_->logger)
1091-
config_->logger->warn("[device {}] Respond received, but cannot find request", device);
1091+
config_->logger->warn("[device {}] Response received, but unable to find request", device);
10921092
}
10931093
}
10941094

@@ -1397,7 +1397,7 @@ ConnectionManager::Impl::onDhtPeerRequest(const PeerConnectionRequest& req,
13971397
return;
13981398
if (!ok) {
13991399
if (shared->config_->logger)
1400-
shared->config_->logger->error("[device {}] Cannot initialize ICE session.", req.owner->getLongId());
1400+
shared->config_->logger->error("[device {}] Unable to initialize ICE session.", req.owner->getLongId());
14011401
dht::ThreadPool::io().run([eraseInfo = std::move(eraseInfo)] { eraseInfo(); });
14021402
return;
14031403
}
@@ -1442,7 +1442,7 @@ ConnectionManager::Impl::onDhtPeerRequest(const PeerConnectionRequest& req,
14421442
info->ice_ = shared->config_->factory->createUTransport("");
14431443
if (not info->ice_) {
14441444
if (shared->config_->logger)
1445-
shared->config_->logger->error("[device {}] Cannot initialize ICE session", deviceId);
1445+
shared->config_->logger->error("[device {}] Unable to initialize ICE session", deviceId);
14461446
eraseInfo();
14471447
return;
14481448
}
@@ -1663,7 +1663,7 @@ ConnectionManager::Impl::foundPeerDevice(const std::shared_ptr<dht::crypto::Cert
16631663
while (top_issuer->issuer)
16641664
top_issuer = top_issuer->issuer;
16651665

1666-
// Device certificate can't be self-signed
1666+
// Unable to self-signed device certificate
16671667
if (top_issuer == crt) {
16681668
if (logger)
16691669
logger->warn("Found invalid (self-signed) peer device: {}", crt->getLongId());

src/fileutils.cpp

+10-10
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ createSymlink(const std::string& linkFile, const std::string& target)
124124
try {
125125
std::filesystem::create_symlink(target, linkFile);
126126
} catch (const std::exception& e) {
127-
//JAMI_ERR("Couldn't create soft link: %s", e.what());
127+
//JAMI_ERR("Unable to create soft link: %s", e.what());
128128
return false;
129129
}
130130
return true;
@@ -136,7 +136,7 @@ createHardlink(const std::string& linkFile, const std::string& target)
136136
try {
137137
std::filesystem::create_hard_link(target, linkFile);
138138
} catch (const std::exception& e) {
139-
//JAMI_ERR("Couldn't create hard link: %s", e.what());
139+
//JAMI_ERR("Unable to create hard link: %s", e.what());
140140
return false;
141141
}
142142
return true;
@@ -155,15 +155,15 @@ loadFile(const std::filesystem::path& path)
155155
std::vector<uint8_t> buffer;
156156
std::ifstream file(path, std::ios::binary);
157157
if (!file)
158-
throw std::runtime_error("Can't read file: " + path.string());
158+
throw std::runtime_error("Unable to read file: " + path.string());
159159
file.seekg(0, std::ios::end);
160160
auto size = file.tellg();
161161
if (size > std::numeric_limits<unsigned>::max())
162162
throw std::runtime_error("File is too big: " + path.string());
163163
buffer.resize(size);
164164
file.seekg(0, std::ios::beg);
165165
if (!file.read((char*) buffer.data(), size))
166-
throw std::runtime_error("Can't load file: " + path.string());
166+
throw std::runtime_error("Unable to load file: " + path.string());
167167
return buffer;
168168
}
169169

@@ -172,7 +172,7 @@ saveFile(const std::filesystem::path& path, const uint8_t* data, size_t data_siz
172172
{
173173
std::ofstream file(path, std::ios::trunc | std::ios::binary);
174174
if (!file.is_open()) {
175-
//JAMI_ERR("Could not write data to %s", path.c_str());
175+
//JAMI_ERR("Unable to write data to %s", path.c_str());
176176
return;
177177
}
178178
file.write((char*) data, data_size);
@@ -208,13 +208,13 @@ eraseFile_win32(const std::string& path, bool dosync)
208208
HANDLE h
209209
= CreateFileA(path.c_str(), GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);
210210
if (h == INVALID_HANDLE_VALUE) {
211-
// JAMI_WARN("Can not open file %s for erasing.", path.c_str());
211+
// JAMI_WARN("Unable to open file %s for erasing.", path.c_str());
212212
return false;
213213
}
214214

215215
LARGE_INTEGER size;
216216
if (!GetFileSizeEx(h, &size)) {
217-
// JAMI_WARN("Can not erase file %s: GetFileSizeEx() failed.", path.c_str());
217+
// JAMI_WARN("Unable to erase file %s: GetFileSizeEx() failed.", path.c_str());
218218
CloseHandle(h);
219219
return false;
220220
}
@@ -231,7 +231,7 @@ eraseFile_win32(const std::string& path, bool dosync)
231231
try {
232232
buffer = new char[ERASE_BLOCK];
233233
} catch (std::bad_alloc& ba) {
234-
// JAMI_WARN("Can not allocate buffer for erasing %s.", path.c_str());
234+
// JAMI_WARN("Unable to allocate buffer for erasing %s.", path.c_str());
235235
CloseHandle(h);
236236
return false;
237237
}
@@ -267,15 +267,15 @@ eraseFile_posix(const std::string& path, bool dosync)
267267
{
268268
struct stat st;
269269
if (stat(path.c_str(), &st) == -1) {
270-
//JAMI_WARN("Can not erase file %s: fstat() failed.", path.c_str());
270+
//JAMI_WARN("Unable to erase file %s: fstat() failed.", path.c_str());
271271
return false;
272272
}
273273
// Remove read-only flag if possible
274274
chmod(path.c_str(), st.st_mode | (S_IWGRP+S_IWUSR) );
275275

276276
int fd = open(path.c_str(), O_WRONLY);
277277
if (fd == -1) {
278-
//JAMI_WARN("Can not open file %s for erasing.", path.c_str());
278+
//JAMI_WARN("Unable to open file %s for erasing.", path.c_str());
279279
return false;
280280
}
281281

0 commit comments

Comments
 (0)