diff --git a/Makefile b/Makefile
index bf4ea2365..4a83e26f8 100644
--- a/Makefile
+++ b/Makefile
@@ -1,3 +1,22 @@
+# meli - Makefile
+#
+# Copyright 2017-2020 Manos Pitsidianakis
+#
+# This file is part of meli.
+#
+# meli is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# meli is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with meli. If not, see .
+
# Options
PREFIX ?= /usr/local
BINDIR ?= ${PREFIX}/bin
diff --git a/melib/build.rs b/melib/build.rs
index 95a56c58f..2efeb64e2 100644
--- a/melib/build.rs
+++ b/melib/build.rs
@@ -1,3 +1,24 @@
+/*
+ * meli - melib crate.
+ *
+ * Copyright 2017-2020 Manos Pitsidianakis
+ *
+ * This file is part of meli.
+ *
+ * meli is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * meli is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with meli. If not, see .
+ */
+
fn main() {
#[cfg(feature = "notmuch_backend")]
{
diff --git a/melib/src/backends/imap/protocol_parser.rs b/melib/src/backends/imap/protocol_parser.rs
index 62dc0b397..ac6c40576 100644
--- a/melib/src/backends/imap/protocol_parser.rs
+++ b/melib/src/backends/imap/protocol_parser.rs
@@ -1,3 +1,24 @@
+/*
+ * meli - melib crate.
+ *
+ * Copyright 2017-2020 Manos Pitsidianakis
+ *
+ * This file is part of meli.
+ *
+ * meli is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * meli is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with meli. If not, see .
+ */
+
use super::*;
use crate::email::parser::BytesExt;
use nom::{digit, is_digit, rest, IResult};
diff --git a/melib/src/backends/imap/tokens.rs b/melib/src/backends/imap/tokens.rs
deleted file mode 100644
index 86ba8ae57..000000000
--- a/melib/src/backends/imap/tokens.rs
+++ /dev/null
@@ -1,571 +0,0 @@
-use std::fmt;
-use std::num::NonZeroUsize;
-
-trait Join {
- fn join(&self, sep: char) -> String;
-}
-
-impl Join for [T]
-where
- T: fmt::Display,
-{
- fn join(&self, sep: char) -> String {
- if self.is_empty() {
- String::from("")
- } else if self.len() == 1 {
- format!("{}", self[0])
- } else {
- format!("{}{}{}", self[0], sep, self[1..].join(sep))
- }
- }
-}
-
-struct Search {
- charset: Option,
- search_keys: Vec,
-}
-
-impl fmt::Display for Search {
- fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
- write!(
- f,
- "SEARCH{} {}",
- if let Some(ch) = self.charset.as_ref() {
- format!(" CHARSET {}", ch)
- } else {
- format!("")
- },
- self.search_keys.join(' ')
- )
- }
-}
-
-enum SearchKey {
- All,
- Answered,
- Bcc(String),
- Before(String),
- Body(String),
- Cc(String),
- Deleted,
- Flagged,
- From(String),
- Keyword(FlagKeyword),
- New,
- Old,
- On(String),
- Recent,
- Seen,
- Since(String),
- Subject(String),
- Text(String),
- To(String),
- Unanswered,
- Undeleted,
- Unflagged,
- Unkeyword(FlagKeyword),
- Unseen,
- Draft,
- Header(String, String), //HeaderFldName
- Larger(u64),
- Not(Box),
- Or(Box, Box),
- SentBefore(String), //Date
- SentOn(String), //Date
- SentSince(String), //Date
- Smaller(u64),
- Uid(SequenceSet),
- Undraft,
- SequenceSet(SequenceSet),
- And(Vec),
-}
-impl fmt::Display for SearchKey {
- fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
- write!(
- f,
- "{}",
- match self {
- SearchKey::All => format!("ALL"),
- SearchKey::Answered => format!("ANSWERED"),
- SearchKey::Bcc(ref s) => format!("BCC {}", s),
- SearchKey::Before(ref s) => format!("BEFORE {}", s),
- SearchKey::Body(ref s) => format!("BODY {}", s),
- SearchKey::Cc(ref s) => format!("CC {}", s),
- SearchKey::Deleted => format!("DELETED"),
- SearchKey::Flagged => format!("FLAGGED"),
- SearchKey::From(ref s) => format!("FROM {}", s),
- SearchKey::Keyword(ref s) => format!("KEYWORD {}", s),
- SearchKey::New => format!("NEW"),
- SearchKey::Old => format!("OLD"),
- SearchKey::On(ref s) => format!("ON {}", s),
- SearchKey::Recent => format!("RECENT"),
- SearchKey::Seen => format!("SEEN"),
- SearchKey::Since(ref s) => format!("SINCE {}", s),
- SearchKey::Subject(ref s) => format!("SUBJECT {}", s),
- SearchKey::Text(ref s) => format!("TEXT {}", s),
- SearchKey::To(ref s) => format!("TO {}", s),
- SearchKey::Unanswered => format!("UNANSWERED"),
- SearchKey::Undeleted => format!("UNDELETED"),
- SearchKey::Unflagged => format!("UNFLAGGED"),
- SearchKey::Unkeyword(ref s) => format!("UNKEYWORD {}", s),
- SearchKey::Unseen => format!("UNSEEN"),
- SearchKey::Draft => format!("DRAFT"),
- SearchKey::Header(ref name, ref value) => format!("HEADER {} {}", name, value),
- SearchKey::Larger(ref s) => format!("LARGER {}", s),
- SearchKey::Not(ref s) => format!("NOT {}", s),
- SearchKey::Or(ref a, ref b) => format!("OR {} {}", a, b),
- SearchKey::SentBefore(ref s) => format!("SENTBEFORE {}", s),
- SearchKey::SentOn(ref s) => format!("SENTON {}", s),
- SearchKey::SentSince(ref s) => format!("SENTSINCE {}", s),
- SearchKey::Smaller(ref s) => format!("SMALLER {}", s),
- SearchKey::Uid(ref s) => format!("UID {}", s),
- SearchKey::Undraft => format!("UNDRAFT"),
- SearchKey::SequenceSet(ref s) => format!("SEQUENCESET {}", s),
- SearchKey::And(ref s) => format!("({})", s.join(' ')),
- }
- )
- }
-}
-
-struct Delete {
- mailbox: Mailbox,
-}
-
-impl fmt::Display for Delete {
- fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
- write!(f, "DELETE {}", self.mailbox)
- }
-}
-
-struct Examine {
- mailbox: Mailbox,
-}
-
-impl fmt::Display for Examine {
- fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
- write!(f, "EXAMINE {}", self.mailbox)
- }
-}
-
-struct Select {
- mailbox: Mailbox,
-}
-
-impl fmt::Display for Select {
- fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
- write!(f, "SELECT {}", self.mailbox)
- }
-}
-
-struct List {
- mailbox: Mailbox,
- list: String,
-}
-
-impl fmt::Display for List {
- fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
- write!(
- f,
- "LIST {} \"{}\"",
- if self.mailbox.is_empty() {
- format!("\"\"")
- } else {
- format!("{}", self.mailbox)
- },
- self.list.as_str()
- )
- }
-}
-
-struct Lsub {
- mailbox: Mailbox,
- list: String,
-}
-
-impl fmt::Display for Lsub {
- fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
- write!(f, "LSUB {} \"{}\"", self.mailbox, self.list)
- }
-}
-
-enum StatusAttribute {
- Messages,
- Recent,
- UidNext,
- UidValidity,
- Unseen,
-}
-
-impl fmt::Display for StatusAttribute {
- fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
- write!(
- f,
- "{}",
- match self {
- StatusAttribute::Messages => "MESSAGES",
- StatusAttribute::Recent => "RECENT",
- StatusAttribute::UidNext => "UIDNEXT",
- StatusAttribute::UidValidity => "UIDVALIDITY",
- StatusAttribute::Unseen => "UNSEEN",
- }
- )
- }
-}
-
-struct Status {
- mailbox: Mailbox,
- status_attributes: Vec,
-}
-
-impl fmt::Display for Status {
- fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
- write!(
- f,
- "STATUS {} ({})",
- self.mailbox,
- self.status_attributes.join(' ')
- )
- }
-}
-
-struct Store {
- sequence_set: SequenceSet,
- //store_att_flags:
-}
-
-impl fmt::Display for Store {
- fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
- unimplemented!()
- //write!(f, "STORE {}", self.sequence_set)
- }
-}
-
-struct Unsubscribe {
- mailbox: Mailbox,
-}
-
-impl fmt::Display for Unsubscribe {
- fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
- write!(f, "UNSUBSCRIBE {}", self.mailbox)
- }
-}
-
-struct Subscribe {
- mailbox: Mailbox,
-}
-
-impl fmt::Display for Subscribe {
- fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
- write!(f, "SUBSCRIBE {}", self.mailbox)
- }
-}
-
-struct Copy {
- sequence_set: SequenceSet,
- mailbox: Mailbox,
-}
-
-impl fmt::Display for Copy {
- fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
- write!(f, "COPY {} {}", self.sequence_set, self.mailbox)
- }
-}
-
-struct Create {
- mailbox: Mailbox,
-}
-
-impl fmt::Display for Create {
- fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
- write!(f, "CREATE {}", self.mailbox)
- }
-}
-
-struct Rename {
- from: Mailbox,
- to: Mailbox,
-}
-
-impl fmt::Display for Rename {
- fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
- write!(f, "RENAME {} {}", self.from, self.to)
- }
-}
-
-struct Append {
- mailbox: Mailbox,
- flag_list: Vec,
- date_time: Option,
- literal: String,
-}
-
-impl fmt::Display for Append {
- fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
- write!(
- f,
- "APPEND {}{}{} {}",
- self.mailbox,
- if self.flag_list.is_empty() {
- String::from("")
- } else {
- format!(" {}", self.flag_list.join(' '))
- },
- if let Some(date_time) = self.date_time.as_ref() {
- format!(" {}", date_time)
- } else {
- String::from("")
- },
- self.literal.as_str()
- )
- }
-}
-
-struct Fetch {
- sequence_set: SequenceSet,
-}
-
-impl fmt::Display for Fetch {
- fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
- write!(f, "FETCH {}", self.sequence_set)
- }
-}
-
-enum Flag {
- Answered,
- Flagged,
- Deleted,
- Seen,
- Draft,
- /*atom */
- X(String),
-}
-
-impl fmt::Display for Flag {
- fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
- write!(
- f,
- "\\{}",
- match self {
- Flag::Answered => "Answered",
- Flag::Flagged => "Flagged",
- Flag::Deleted => "Deleted",
- Flag::Seen => "Seen",
- Flag::Draft => "Draft",
- Flag::X(ref c) => c.as_str(),
- }
- )
- }
-}
-
-enum Uid {
- Copy(Copy),
- Fetch(Fetch),
- Search(Search),
- Store(Store),
-}
-
-impl fmt::Display for Uid {
- fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
- write!(
- f,
- "UID {}",
- match self {
- Uid::Copy(ref c) => format!("{}", c),
- Uid::Fetch(ref c) => format!("{}", c),
- Uid::Search(ref c) => format!("{}", c),
- Uid::Store(ref c) => format!("{}", c),
- }
- )
- }
-}
-
-enum CommandSelect {
- Check,
- Close,
- Expunge,
- Copy(Copy),
- Fetch(Fetch),
- Store(Store),
- Uid(Uid),
- Search(Search),
-}
-
-impl fmt::Display for CommandSelect {
- fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
- write!(
- f,
- "{}",
- match self {
- CommandSelect::Check => format!("CHECK"),
- CommandSelect::Close => format!("CLOSE"),
- CommandSelect::Expunge => format!("EXPUNGE"),
- CommandSelect::Copy(ref c) => format!("{}", c),
- CommandSelect::Fetch(ref c) => format!("{}", c),
- CommandSelect::Store(ref c) => format!("{}", c),
- CommandSelect::Uid(ref c) => format!("{}", c),
- CommandSelect::Search(ref c) => format!("{}", c),
- }
- )
- }
-}
-
-/// Valid in all states
-enum CommandAny {
- Capability,
- Logout,
- Noop,
- XCommand(String),
-}
-
-impl fmt::Display for CommandAny {
- fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
- write!(
- f,
- "{}",
- match self {
- CommandAny::Capability => format!("CAPABILITY"),
- CommandAny::Logout => format!("LOGOUT"),
- CommandAny::Noop => format!("NOOP"),
- CommandAny::XCommand(ref x) => format!("{}", x),
- }
- )
- }
-}
-
-enum CommandAuth {
- Append(Append),
- Create(Create),
- Delete(Delete),
- Examine(Examine),
- List(List),
- Lsub(Lsub),
- Rename(Rename),
- Select(Select),
- Status(Status),
- Subscribe(Subscribe),
- Unsubscribe(Unsubscribe),
-}
-
-impl fmt::Display for CommandAuth {
- fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
- write!(
- f,
- "{}",
- match self {
- CommandAuth::Append(ref c) => c.to_string(),
- CommandAuth::Create(ref c) => c.to_string(),
- CommandAuth::Delete(ref c) => c.to_string(),
- CommandAuth::Examine(ref c) => c.to_string(),
- CommandAuth::List(ref c) => c.to_string(),
- CommandAuth::Lsub(ref c) => c.to_string(),
- CommandAuth::Rename(ref c) => c.to_string(),
- CommandAuth::Select(ref c) => c.to_string(),
- CommandAuth::Status(ref c) => c.to_string(),
- CommandAuth::Subscribe(ref c) => c.to_string(),
- CommandAuth::Unsubscribe(ref c) => c.to_string(),
- }
- )
- }
-}
-
-enum CommandNonAuth {
- Login(String, String),
- Authenticate(String, String),
- StartTls,
-}
-
-impl fmt::Display for CommandNonAuth {
- fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
- match self {
- CommandNonAuth::Login(ref userid, ref password) => {
- write!(f, "LOGIN \"{}\" \"{}\"", userid, password)
- }
- CommandNonAuth::Authenticate(ref auth_type, ref base64) => {
- write!(f, "AUTHENTICATE \"{}\" \"{}\"", auth_type, base64)
- }
- CommandNonAuth::StartTls => write!(f, "STARTTLS"),
- }
- }
-}
-
-enum Command {
- Any(CommandAny),
- Auth(CommandAuth),
- NonAuth(CommandNonAuth),
- Select(CommandSelect),
-}
-impl fmt::Display for Command {
- fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
- match self {
- Command::Any(c) => write!(f, "{}", c),
- Command::Auth(c) => write!(f, "{}", c),
- Command::NonAuth(c) => write!(f, "{}", c),
- Command::Select(c) => write!(f, "{}", c),
- }
- }
-}
-
-pub(super) struct ImapCommand {
- tag: usize,
- command: Command,
-}
-
-impl fmt::Display for ImapCommand {
- fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
- write!(f, "{} {}\r\n", self.tag, self.command)
- }
-}
-
-enum SeqNumber {
- MsgNumber(NonZeroUsize),
- UID(NonZeroUsize),
- /** "*" represents the largest number in use. In
- the case of message sequence numbers, it is the number of messages in a
- non-empty mailbox. In the case of unique identifiers, it is the unique
- identifier of the last message in the mailbox or, if the mailbox is empty, the
- mailbox's current UIDNEXT value **/
- Largest,
-}
-
-impl fmt::Display for SeqNumber {
- fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
- match self {
- SeqNumber::MsgNumber(n) => write!(f, "{}", n),
- SeqNumber::UID(u) => write!(f, "{}", u),
- SeqNumber::Largest => write!(f, "*"),
- }
- }
-}
-
-struct SeqRange(SeqNumber, SeqNumber);
-impl fmt::Display for SeqRange {
- fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
- write!(f, "{}:{}", self.0, self.1)
- }
-}
-
-struct SequenceSet {
- numbers: Vec,
- ranges: Vec,
-}
-impl fmt::Display for SequenceSet {
- fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
- write!(
- f,
- "{}{}",
- if self.numbers.is_empty() {
- String::from("")
- } else {
- self.numbers.join(',')
- },
- if self.ranges.is_empty() {
- String::from("")
- } else {
- self.ranges.join(',')
- }
- )
- }
-}
-
-type Mailbox = String;
-type FlagKeyword = String;
diff --git a/melib/src/collection.rs b/melib/src/collection.rs
index a5fc00951..95ee89db2 100644
--- a/melib/src/collection.rs
+++ b/melib/src/collection.rs
@@ -1,3 +1,24 @@
+/*
+ * meli - melib crate.
+ *
+ * Copyright 2017-2020 Manos Pitsidianakis
+ *
+ * This file is part of meli.
+ *
+ * meli is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * meli is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with meli. If not, see .
+ */
+
use super::*;
use crate::backends::FolderHash;
use smallvec::SmallVec;
diff --git a/melib/src/email/compose.rs b/melib/src/email/compose.rs
index 47b24f861..e8f734147 100644
--- a/melib/src/email/compose.rs
+++ b/melib/src/email/compose.rs
@@ -1,3 +1,24 @@
+/*
+ * meli - melib crate.
+ *
+ * Copyright 2017-2020 Manos Pitsidianakis
+ *
+ * This file is part of meli.
+ *
+ * meli is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * meli is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with meli. If not, see .
+ */
+
use super::*;
use crate::backends::BackendOp;
use crate::email::attachments::AttachmentBuilder;
diff --git a/melib/src/email/compose/mime.rs b/melib/src/email/compose/mime.rs
index 3fb731ad7..4a15049cc 100644
--- a/melib/src/email/compose/mime.rs
+++ b/melib/src/email/compose/mime.rs
@@ -1,3 +1,24 @@
+/*
+ * meli - melib crate.
+ *
+ * Copyright 2017-2020 Manos Pitsidianakis
+ *
+ * This file is part of meli.
+ *
+ * meli is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * meli is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with meli. If not, see .
+ */
+
use super::*;
#[cfg(feature = "unicode_algorithms")]
diff --git a/melib/src/email/compose/random.rs b/melib/src/email/compose/random.rs
index f0af4a68b..6e5cbe356 100644
--- a/melib/src/email/compose/random.rs
+++ b/melib/src/email/compose/random.rs
@@ -1,3 +1,24 @@
+/*
+ * meli - melib crate.
+ *
+ * Copyright 2017-2020 Manos Pitsidianakis
+ *
+ * This file is part of meli.
+ *
+ * meli is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * meli is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with meli. If not, see .
+ */
+
use std::char;
use std::fs::File;
use std::io::prelude::*;
diff --git a/text_processing/build.rs b/text_processing/build.rs
index 70edcd700..952ff0a6c 100644
--- a/text_processing/build.rs
+++ b/text_processing/build.rs
@@ -1,3 +1,24 @@
+/*
+ * meli - text_processing crate.
+ *
+ * Copyright 2017-2020 Manos Pitsidianakis
+ *
+ * This file is part of meli.
+ *
+ * meli is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * meli is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with meli. If not, see .
+ */
+
const LINE_BREAK_TABLE_URL: &str = "http://www.unicode.org/Public/UCD/latest/ucd/LineBreak.txt";
use std::fs::File;
use std::io::prelude::*;
diff --git a/text_processing/src/grapheme_clusters.rs b/text_processing/src/grapheme_clusters.rs
index 580b5e090..3e54304b1 100644
--- a/text_processing/src/grapheme_clusters.rs
+++ b/text_processing/src/grapheme_clusters.rs
@@ -1,3 +1,24 @@
+/*
+ * meli - text_processing crate.
+ *
+ * Copyright 2017-2020 Manos Pitsidianakis
+ *
+ * This file is part of meli.
+ *
+ * meli is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * meli is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with meli. If not, see .
+ */
+
/*
Breaks a string into individual user-perceived "characters"
Unicode UAX-29 standard, version 10.0.0
diff --git a/text_processing/src/lib.rs b/text_processing/src/lib.rs
index 4c7d488c6..6b9494190 100644
--- a/text_processing/src/lib.rs
+++ b/text_processing/src/lib.rs
@@ -1,3 +1,24 @@
+/*
+ * meli - text_processing crate.
+ *
+ * Copyright 2017-2020 Manos Pitsidianakis
+ *
+ * This file is part of meli.
+ *
+ * meli is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * meli is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with meli. If not, see .
+ */
+
pub mod grapheme_clusters;
pub mod line_break;
mod tables;
diff --git a/text_processing/src/line_break.rs b/text_processing/src/line_break.rs
index 505cd4f54..ddc7d4f9c 100644
--- a/text_processing/src/line_break.rs
+++ b/text_processing/src/line_break.rs
@@ -1,3 +1,24 @@
+/*
+ * meli - text_processing crate.
+ *
+ * Copyright 2017-2020 Manos Pitsidianakis
+ *
+ * This file is part of meli.
+ *
+ * meli is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * meli is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with meli. If not, see .
+ */
+
extern crate unicode_segmentation;
use self::unicode_segmentation::UnicodeSegmentation;
use crate::grapheme_clusters::TextProcessing;
diff --git a/text_processing/src/tables.rs b/text_processing/src/tables.rs
index 4a6f885f9..2ce6cfb4d 100644
--- a/text_processing/src/tables.rs
+++ b/text_processing/src/tables.rs
@@ -1,3 +1,24 @@
+/*
+ * meli - text_processing crate.
+ *
+ * Copyright 2017-2020 Manos Pitsidianakis
+ *
+ * This file is part of meli.
+ *
+ * meli is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * meli is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with meli. If not, see .
+ */
+
use crate::types::LineBreakClass;
use crate::types::LineBreakClass::*;
diff --git a/text_processing/src/types.rs b/text_processing/src/types.rs
index dc31952e1..3a8462fa9 100644
--- a/text_processing/src/types.rs
+++ b/text_processing/src/types.rs
@@ -1,3 +1,24 @@
+/*
+ * meli - text_processing crate.
+ *
+ * Copyright 2017-2020 Manos Pitsidianakis
+ *
+ * This file is part of meli.
+ *
+ * meli is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * meli is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with meli. If not, see .
+ */
+
#[derive(Debug, Copy, Clone, PartialEq)]
pub enum LineBreakClass {
BK,
diff --git a/text_processing/src/wcwidth.rs b/text_processing/src/wcwidth.rs
index 73841e360..b7c123c53 100644
--- a/text_processing/src/wcwidth.rs
+++ b/text_processing/src/wcwidth.rs
@@ -1,3 +1,24 @@
+/*
+ * meli - text_processing crate.
+ *
+ * Copyright 2017-2020 Manos Pitsidianakis
+ *
+ * This file is part of meli.
+ *
+ * meli is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * meli is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with meli. If not, see .
+ */
+
/*
* This is an implementation of wcwidth() and wcswidth() as defined in
* "The Single UNIX Specification, Version 2, The Open Group, 1997"
diff --git a/ui/src/components/utilities/widgets.rs b/ui/src/components/utilities/widgets.rs
index 9b6355c9c..d05eaa98e 100644
--- a/ui/src/components/utilities/widgets.rs
+++ b/ui/src/components/utilities/widgets.rs
@@ -1,3 +1,24 @@
+/*
+ * meli - ui crate.
+ *
+ * Copyright 2017-2020 Manos Pitsidianakis
+ *
+ * This file is part of meli.
+ *
+ * meli is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * meli is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with meli. If not, see .
+ */
+
use super::*;
use fnv::FnvHashMap;
diff --git a/ui/src/terminal/embed.rs b/ui/src/terminal/embed.rs
index c1092ce62..d0251093c 100644
--- a/ui/src/terminal/embed.rs
+++ b/ui/src/terminal/embed.rs
@@ -1,3 +1,24 @@
+/*
+ * meli - ui crate.
+ *
+ * Copyright 2017-2020 Manos Pitsidianakis
+ *
+ * This file is part of meli.
+ *
+ * meli is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * meli is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with meli. If not, see .
+ */
+
use crate::split_command;
use crate::terminal::position::*;
use melib::log;
diff --git a/ui/src/terminal/embed/grid.rs b/ui/src/terminal/embed/grid.rs
index aa3d57e09..70c4c9b7a 100644
--- a/ui/src/terminal/embed/grid.rs
+++ b/ui/src/terminal/embed/grid.rs
@@ -1,3 +1,24 @@
+/*
+ * meli - ui crate.
+ *
+ * Copyright 2017-2020 Manos Pitsidianakis
+ *
+ * This file is part of meli.
+ *
+ * meli is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * meli is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with meli. If not, see .
+ */
+
use super::*;
use crate::terminal::cells::*;
use melib::error::{MeliError, Result};
diff --git a/ui/src/terminal/text_editing.rs b/ui/src/terminal/text_editing.rs
index 7821928ff..a73c12f53 100644
--- a/ui/src/terminal/text_editing.rs
+++ b/ui/src/terminal/text_editing.rs
@@ -1,3 +1,24 @@
+/*
+ * meli - ui crate.
+ *
+ * Copyright 2017-2020 Manos Pitsidianakis
+ *
+ * This file is part of meli.
+ *
+ * meli is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * meli is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with meli. If not, see .
+ */
+
use text_processing::TextProcessing;
#[derive(Debug, Clone, Default, PartialEq)]
diff --git a/ui/src/workers.rs b/ui/src/workers.rs
index 8fe2d0082..03645fa73 100644
--- a/ui/src/workers.rs
+++ b/ui/src/workers.rs
@@ -1,3 +1,24 @@
+/*
+ * meli - ui crate.
+ *
+ * Copyright 2017-2020 Manos Pitsidianakis
+ *
+ * This file is part of meli.
+ *
+ * meli is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * meli is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with meli. If not, see .
+ */
+
use crate::types::ThreadEvent;
use crossbeam::{
channel::{bounded, unbounded, Sender},