Skip to content

Commit

Permalink
misc: unify terminology
Browse files Browse the repository at this point in the history
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
  • Loading branch information
ovari committed Sep 17, 2024
1 parent 18515ae commit a15c688
Show file tree
Hide file tree
Showing 23 changed files with 120 additions and 120 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,11 @@ DHTNet depends on the following libraries:

## Packaging and release

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.
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.

**Usage:**
```bash
extras/packaging/build_packages.sh -a # -a or --all will build all plateform which are known to be supported
extras/packaging/build_packages.sh -a # -a or --all will build all platform which are known to be supported
extras/packaging/build_packages.sh -u # -u or --ubuntu will build for all supported versions of Ubuntu
extras/packaging/build_packages.sh -u22 -d11 # -u22 will build for ubuntu 22.04 and -d11 will build for Debian 11
```
Expand Down
54 changes: 27 additions & 27 deletions include/compat/msvc/windirent.h
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@
#define S_IXOTH 0
#endif

/* Maximum length of file name */
/* Maximum length of filename */
#if !defined(PATH_MAX)
#define PATH_MAX MAX_PATH
#endif
Expand All @@ -171,7 +171,7 @@
#define DTTOIF(type) (type)

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

/* File name */
/* Filename */
wchar_t d_name[PATH_MAX];
};
typedef struct _wdirent _wdirent;
Expand Down Expand Up @@ -275,7 +275,7 @@ struct dirent
/* File type */
int d_type;

/* File name */
/* Filename */
char d_name[PATH_MAX];
};
typedef struct dirent dirent;
Expand Down Expand Up @@ -385,24 +385,24 @@ _wopendir(const wchar_t* dirname)
/* Directory stream opened successfully */
error = 0;
} else {
/* Cannot retrieve first entry */
/* Unable to retrieve first entry */
error = 1;
dirent_set_errno(ENOENT);
}

} else {
/* Cannot retrieve full path name */
/* Unable to retrieve full path name */
dirent_set_errno(ENOENT);
error = 1;
}

} else {
/* Cannot allocate memory for search pattern */
/* Unable to allocate memory for search pattern */
error = 1;
}

} else {
/* Cannot allocate _WDIR structure */
/* Unable to allocate _WDIR structure */
error = 1;
}

Expand Down Expand Up @@ -437,8 +437,8 @@ _wreaddir(_WDIR* dirp)
entp = &dirp->ent;

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

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

/* File type */
Expand Down Expand Up @@ -509,7 +509,7 @@ _wclosedir(_WDIR* dirp)

/*
* Rewind directory stream such that _wreaddir() returns the very first
* file name again.
* filename again.
*/
static void
_wrewinddir(_WDIR* dirp)
Expand Down Expand Up @@ -619,7 +619,7 @@ opendir(const char* dirname)

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

} else {
/* Cannot allocate DIR structure */
/* Unable to allocate DIR structure */
error = 1;
}

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

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

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

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

/* File attributes */
Expand All @@ -712,9 +712,9 @@ readdir(DIR* dirp)

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

} else {
/* Could not convert string */
/* Unable to convert string */
error = 1;
}

Expand Down Expand Up @@ -853,7 +853,7 @@ dirent_wcstombs_s(size_t* pReturnValue,
error = 0;

} else {
/* Cannot convert string */
/* Unable to convert string */
error = 1;
}

Expand Down
2 changes: 1 addition & 1 deletion include/connectionmanager.h
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ class ConnectionManager
std::size_t activeSockets() const;

/**
* Log informations for all sockets
* Log information for all sockets
*/
void monitor() const;

Expand Down
2 changes: 1 addition & 1 deletion include/ice_transport.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ class IceTransport
* to find the right candidate pair.
* This function doesn't block, the callback on_negodone_cb will be called
* with the negotiation result when operation is really done.
* Return false if negotiation cannot be started else true.
* Return false if negotiation is unable to be started else true.
*/
bool startIce(const Attribute& rem_attrs, std::vector<IceCandidate>&& rem_candidates);
bool startIce(const SDP& sdp);
Expand Down
2 changes: 1 addition & 1 deletion include/multiplexed_socket.h
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ class MultiplexedSocket : public std::enable_shared_from_this<MultiplexedSocket>
void onShutdown(OnShutdownCb&& cb);

/**
* Get informations from socket (channels opened)
* Get information from socket (channels opened)
*/
void monitor() const;

Expand Down
2 changes: 1 addition & 1 deletion include/pj_init_lock.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ namespace dhtnet {
// - The first call to pj_init actually initializes the library; subsequent calls do nothing.
// - All calls to pj_shutdown do nothing, except the last one which actually performs the shutdown.
// Unfortunately, the way this logic is implemented in PJSIP is not thread-safe, so we're
// responsible for making sure that these functions can't be called by two threads at the same time.
// responsible for making sure that these functions are unable to be called by two threads at the same time.
class PjInitLock
{
private:
Expand Down
4 changes: 2 additions & 2 deletions include/string_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ to_int(std::string_view str)
if (ec == std::errc())
return result;
if (ec == std::errc::invalid_argument)
throw std::invalid_argument("Can't parse integer: invalid_argument");
throw std::invalid_argument("Unable to parse integer: invalid_argument");
else if (ec == std::errc::result_out_of_range)
throw std::out_of_range("Can't parse integer: out of range");
throw std::out_of_range("Unable to parse integer: out of range");
throw std::system_error(std::make_error_code(ec));
}

Expand Down
14 changes: 7 additions & 7 deletions src/connectionmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -949,7 +949,7 @@ ConnectionManager::Impl::connectDevice(const std::shared_ptr<dht::crypto::Certif
connType, ok] {
auto sthis = w.lock();
if (!ok && sthis && sthis->config_->logger)
sthis->config_->logger->error("[device {}] Cannot initialize ICE session.", devicePk->getLongId());
sthis->config_->logger->error("[device {}] Unable to initialize ICE session.", devicePk->getLongId());
if (!sthis || !ok) {
eraseInfo();
return;
Expand Down Expand Up @@ -997,7 +997,7 @@ ConnectionManager::Impl::connectDevice(const std::shared_ptr<dht::crypto::Certif
info->ice_ = sthis->config_->factory->createUTransport("");
if (!info->ice_) {
if (sthis->config_->logger)
sthis->config_->logger->error("[device {}] Cannot initialize ICE session.", deviceId);
sthis->config_->logger->error("[device {}] Unable to initialize ICE session.", deviceId);
eraseInfo();
return;
}
Expand Down Expand Up @@ -1027,7 +1027,7 @@ ConnectionManager::Impl::sendChannelRequest(const std::weak_ptr<DeviceInfo>& din
auto channelSock = sock->addChannel(name);
if (!channelSock) {
if (config_->logger)
config_->logger->error("sendChannelRequest failed - cannot create channel");
config_->logger->error("sendChannelRequest failed - unable to create channel");
if (auto info = dinfow.lock())
info->executePendingOperations(vid, nullptr);
return;
Expand Down Expand Up @@ -1088,7 +1088,7 @@ ConnectionManager::Impl::onPeerResponse(PeerConnectionRequest&& req)
req.id));
} else {
if (config_->logger)
config_->logger->warn("[device {}] Respond received, but cannot find request", device);
config_->logger->warn("[device {}] Response received, but unable to find request", device);
}
}

Expand Down Expand Up @@ -1397,7 +1397,7 @@ ConnectionManager::Impl::onDhtPeerRequest(const PeerConnectionRequest& req,
return;
if (!ok) {
if (shared->config_->logger)
shared->config_->logger->error("[device {}] Cannot initialize ICE session.", req.owner->getLongId());
shared->config_->logger->error("[device {}] Unable to initialize ICE session.", req.owner->getLongId());
dht::ThreadPool::io().run([eraseInfo = std::move(eraseInfo)] { eraseInfo(); });
return;
}
Expand Down Expand Up @@ -1442,7 +1442,7 @@ ConnectionManager::Impl::onDhtPeerRequest(const PeerConnectionRequest& req,
info->ice_ = shared->config_->factory->createUTransport("");
if (not info->ice_) {
if (shared->config_->logger)
shared->config_->logger->error("[device {}] Cannot initialize ICE session", deviceId);
shared->config_->logger->error("[device {}] Unable to initialize ICE session", deviceId);
eraseInfo();
return;
}
Expand Down Expand Up @@ -1663,7 +1663,7 @@ ConnectionManager::Impl::foundPeerDevice(const std::shared_ptr<dht::crypto::Cert
while (top_issuer->issuer)
top_issuer = top_issuer->issuer;

// Device certificate can't be self-signed
// Unable to self-signed device certificate
if (top_issuer == crt) {
if (logger)
logger->warn("Found invalid (self-signed) peer device: {}", crt->getLongId());
Expand Down
20 changes: 10 additions & 10 deletions src/fileutils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ createSymlink(const std::string& linkFile, const std::string& target)
try {
std::filesystem::create_symlink(target, linkFile);
} catch (const std::exception& e) {
//JAMI_ERR("Couldn't create soft link: %s", e.what());
//JAMI_ERR("Unable to create soft link: %s", e.what());
return false;
}
return true;
Expand All @@ -136,7 +136,7 @@ createHardlink(const std::string& linkFile, const std::string& target)
try {
std::filesystem::create_hard_link(target, linkFile);
} catch (const std::exception& e) {
//JAMI_ERR("Couldn't create hard link: %s", e.what());
//JAMI_ERR("Unable to create hard link: %s", e.what());
return false;
}
return true;
Expand All @@ -155,15 +155,15 @@ loadFile(const std::filesystem::path& path)
std::vector<uint8_t> buffer;
std::ifstream file(path, std::ios::binary);
if (!file)
throw std::runtime_error("Can't read file: " + path.string());
throw std::runtime_error("Unable to read file: " + path.string());
file.seekg(0, std::ios::end);
auto size = file.tellg();
if (size > std::numeric_limits<unsigned>::max())
throw std::runtime_error("File is too big: " + path.string());
buffer.resize(size);
file.seekg(0, std::ios::beg);
if (!file.read((char*) buffer.data(), size))
throw std::runtime_error("Can't load file: " + path.string());
throw std::runtime_error("Unable to load file: " + path.string());
return buffer;
}

Expand All @@ -172,7 +172,7 @@ saveFile(const std::filesystem::path& path, const uint8_t* data, size_t data_siz
{
std::ofstream file(path, std::ios::trunc | std::ios::binary);
if (!file.is_open()) {
//JAMI_ERR("Could not write data to %s", path.c_str());
//JAMI_ERR("Unable to write data to %s", path.c_str());
return;
}
file.write((char*) data, data_size);
Expand Down Expand Up @@ -208,13 +208,13 @@ eraseFile_win32(const std::string& path, bool dosync)
HANDLE h
= CreateFileA(path.c_str(), GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);
if (h == INVALID_HANDLE_VALUE) {
// JAMI_WARN("Can not open file %s for erasing.", path.c_str());
// JAMI_WARN("Unable to open file %s for erasing.", path.c_str());
return false;
}

LARGE_INTEGER size;
if (!GetFileSizeEx(h, &size)) {
// JAMI_WARN("Can not erase file %s: GetFileSizeEx() failed.", path.c_str());
// JAMI_WARN("Unable to erase file %s: GetFileSizeEx() failed.", path.c_str());
CloseHandle(h);
return false;
}
Expand All @@ -231,7 +231,7 @@ eraseFile_win32(const std::string& path, bool dosync)
try {
buffer = new char[ERASE_BLOCK];
} catch (std::bad_alloc& ba) {
// JAMI_WARN("Can not allocate buffer for erasing %s.", path.c_str());
// JAMI_WARN("Unable to allocate buffer for erasing %s.", path.c_str());
CloseHandle(h);
return false;
}
Expand Down Expand Up @@ -267,15 +267,15 @@ eraseFile_posix(const std::string& path, bool dosync)
{
struct stat st;
if (stat(path.c_str(), &st) == -1) {
//JAMI_WARN("Can not erase file %s: fstat() failed.", path.c_str());
//JAMI_WARN("Unable to erase file %s: fstat() failed.", path.c_str());
return false;
}
// Remove read-only flag if possible
chmod(path.c_str(), st.st_mode | (S_IWGRP+S_IWUSR) );

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

Expand Down
Loading

0 comments on commit a15c688

Please sign in to comment.