forked from open-education-hub/operating-systems
-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
infra/linters: Replace spellcheck with typos
Use typos to find misspelled words since it does not require extensive wordlists and it is easier to configurate. The trade-off is that it will not complain about uncommon typos since it will assume they are technical terms. Overall it should be a lot easier to maintain than spellcheck. Signed-off-by: Alex Apostolescu <[email protected]>
- Loading branch information
1 parent
85302e1
commit ad663e0
Showing
33 changed files
with
1,665 additions
and
1,629 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Ignore directories containing third-party files | ||
chapters/compute/synchronization/drills/tasks/threadsafe-data-struct/support | ||
content/assignments/async-web-server/src/http-parser |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
[default] | ||
# ```(console)?[\\s\\S]+?``` -> Ignore fenced sequences | ||
# -\\w+|--\\w+ -> Ignore command flags | ||
extend-ignore-re = ["```(console)?[\\s\\S]+?```", "-\\w+|--\\w+"] | ||
[files] | ||
extend-exclude = [ | ||
"*.svg", | ||
"*.drawio", | ||
"ssh_key", | ||
"ssh_key.pub", | ||
"content/assignments/async-web-server/src/http-parser/samples/Makefile", # Windows compile flags | ||
# Third-party files | ||
"chapters/compute/processes-threads-apache2/guides/apache2/support/httpd.conf", | ||
"chapters/compute/processes-threads-apache2/drills/tasks/apache2/support/httpd.conf" | ||
] | ||
[default.extend-words] | ||
# word1 = "word2" to correct word1 to word2 | ||
# word3 = "word3" to consider word3 a valid word | ||
VAS = "VAS" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"editor.formatOnSave": false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
220 changes: 110 additions & 110 deletions
220
chapters/compute/synchronization/drills/tasks/threadsafe-data-struct/support/clist.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,110 +1,110 @@ | ||
/******************************************/ | ||
/* */ | ||
/* Alexander Agdgomlishvili */ | ||
/* */ | ||
/* [email protected] */ | ||
/* */ | ||
/******************************************/ | ||
|
||
|
||
/** | ||
* BSD 2-Clause License | ||
* | ||
* Copyright (c) 2020, Alexander Agdgomlishvili | ||
* [email protected] | ||
* | ||
* All rights reserved. | ||
* | ||
* Redistribution and use in source and binary forms, with or without | ||
* modification, are permitted provided that the following conditions are met: | ||
* | ||
* 1. Redistributions of source code must retain the above copyright notice, this | ||
* list of conditions and the following disclaimer. | ||
* 2. Redistributions in binary form must reproduce the above copyright notice, | ||
* this list of conditions and the following disclaimer in the documentation | ||
* and/or other materials provided with the distribution. | ||
* | ||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE | ||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | ||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | ||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | ||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
*/ | ||
|
||
/* Github link: https://github.com/AlexanderAgd/CLIST */ | ||
|
||
#ifndef CLIST_H | ||
#define CLIST_H | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
typedef struct CList | ||
{ | ||
void * (* add) (struct CList *l, void *o); /* Add object to the end of a list */ | ||
void * (* insert) (struct CList *l, void *o, int n); /* Insert object at position 'n' */ | ||
void * (* replace) (struct CList *l, void *o, int n); /* Replace object at position 'n' */ | ||
void (* remove) (struct CList *l, int n); /* Remove object at position 'n' */ | ||
void * (* at) (struct CList *l, int n); /* Get object at position 'n' */ | ||
int (* realloc) (struct CList *l, int n); /* Reallocate list to 'size' items */ | ||
int (* count) (struct CList *l); /* Get list size in items */ | ||
void * (* firstMatch) (struct CList *l, const void *o, size_t shift, size_t size, int string); | ||
/* Returns object with first match of string or byte compare */ | ||
void * (* lastMatch) (struct CList *l, const void *o, size_t shift, size_t size, int string); | ||
/* Returns object with last match of string or byte compare */ | ||
int (* index) (struct CList *l); /* Get index of previos search match */ | ||
int (* swap) (struct CList *l, int a, int b); /* Swap, replace two items with index a b */ | ||
int (* allocSize) (struct CList *l); /* Get allocated size in items */ | ||
size_t (* itemSize) (struct CList *l); /* Get item size in bytes */ | ||
void (* print) (struct CList *l, size_t shift, int n, const char *type); /* Print list data */ | ||
void (* clear) (struct CList *l); /* Clear list */ | ||
void (* free) (struct CList *l); /* Destroy struct CList and all data */ | ||
void *priv; /* NOT FOR USE, private data */ | ||
} CList; | ||
|
||
CList *CList_init(size_t objSize); /* Set list object size in bytes */ | ||
|
||
/* void *add(struct CList *l, void *o); | ||
Returns pointer to added object; Returns NULL if failed. | ||
void *insert(struct CList *l, void *o, int n); | ||
Returns pointer to inserted object; Returns NULL if failed. | ||
void *replace(struct CList *l, void *o, int n); | ||
Returns pointer to replaced object; Returns NULL if failed. | ||
void *at(struct CList *l, int n); | ||
Returns pointer to object at index n; | ||
int realloc(struct CList *l, int n); | ||
Return 1 when success. Returns 0 if failed. | ||
void *firstMatch(struct CList *l, const void *o, size_t shift, size_t size, int string); | ||
Returns pointer to list item when first match found. Straight scanning, from 0 to list end. | ||
Returns NULL if search failed. | ||
void *lastMatch(struct CList *l, const void *o, size_t shift, size_t size, int string); | ||
Returns pointer to list item when first match found. Reverse scanning, from list end to 0. | ||
Returns NULL if search failed. | ||
int index(struct CList *l); | ||
Returns index of last search firstMatch or lastMatch. Returns -1 if search failed. | ||
void print(struct CList *l, size_t shift, int n, const char *type); | ||
Prints data of "int n" list items with offset "size_t shift" and type "const char *type". | ||
Supported types: char, short, int, long, uintptr_t, size_t, double, string. | ||
If type is NULL just pointers data will be printed. | ||
*/ | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif /* CLIST_H */ | ||
/******************************************/ | ||
/* */ | ||
/* Alexander Agdgomlishvili */ | ||
/* */ | ||
/* [email protected] */ | ||
/* */ | ||
/******************************************/ | ||
|
||
|
||
/** | ||
* BSD 2-Clause License | ||
* | ||
* Copyright (c) 2020, Alexander Agdgomlishvili | ||
* [email protected] | ||
* | ||
* All rights reserved. | ||
* | ||
* Redistribution and use in source and binary forms, with or without | ||
* modification, are permitted provided that the following conditions are met: | ||
* | ||
* 1. Redistributions of source code must retain the above copyright notice, this | ||
* list of conditions and the following disclaimer. | ||
* 2. Redistributions in binary form must reproduce the above copyright notice, | ||
* this list of conditions and the following disclaimer in the documentation | ||
* and/or other materials provided with the distribution. | ||
* | ||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE | ||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | ||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | ||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | ||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
*/ | ||
|
||
/* Github link: https://github.com/AlexanderAgd/CLIST */ | ||
|
||
#ifndef CLIST_H | ||
#define CLIST_H | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
typedef struct CList | ||
{ | ||
void * (* add) (struct CList *l, void *o); /* Add object to the end of a list */ | ||
void * (* insert) (struct CList *l, void *o, int n); /* Insert object at position 'n' */ | ||
void * (* replace) (struct CList *l, void *o, int n); /* Replace object at position 'n' */ | ||
void (* remove) (struct CList *l, int n); /* Remove object at position 'n' */ | ||
void * (* at) (struct CList *l, int n); /* Get object at position 'n' */ | ||
int (* realloc) (struct CList *l, int n); /* Reallocate list to 'size' items */ | ||
int (* count) (struct CList *l); /* Get list size in items */ | ||
void * (* firstMatch) (struct CList *l, const void *o, size_t shift, size_t size, int string); | ||
/* Returns object with first match of string or byte compare */ | ||
void * (* lastMatch) (struct CList *l, const void *o, size_t shift, size_t size, int string); | ||
/* Returns object with last match of string or byte compare */ | ||
int (* index) (struct CList *l); /* Get index of previous search match */ | ||
int (* swap) (struct CList *l, int a, int b); /* Swap, replace two items with index a b */ | ||
int (* allocSize) (struct CList *l); /* Get allocated size in items */ | ||
size_t (* itemSize) (struct CList *l); /* Get item size in bytes */ | ||
void (* print) (struct CList *l, size_t shift, int n, const char *type); /* Print list data */ | ||
void (* clear) (struct CList *l); /* Clear list */ | ||
void (* free) (struct CList *l); /* Destroy struct CList and all data */ | ||
void *priv; /* NOT FOR USE, private data */ | ||
} CList; | ||
|
||
CList *CList_init(size_t objSize); /* Set list object size in bytes */ | ||
|
||
/* void *add(struct CList *l, void *o); | ||
Returns pointer to added object; Returns NULL if failed. | ||
void *insert(struct CList *l, void *o, int n); | ||
Returns pointer to inserted object; Returns NULL if failed. | ||
void *replace(struct CList *l, void *o, int n); | ||
Returns pointer to replaced object; Returns NULL if failed. | ||
void *at(struct CList *l, int n); | ||
Returns pointer to object at index n; | ||
int realloc(struct CList *l, int n); | ||
Return 1 when success. Returns 0 if failed. | ||
void *firstMatch(struct CList *l, const void *o, size_t shift, size_t size, int string); | ||
Returns pointer to list item when first match found. Straight scanning, from 0 to list end. | ||
Returns NULL if search failed. | ||
void *lastMatch(struct CList *l, const void *o, size_t shift, size_t size, int string); | ||
Returns pointer to list item when first match found. Reverse scanning, from list end to 0. | ||
Returns NULL if search failed. | ||
int index(struct CList *l); | ||
Returns index of last search firstMatch or lastMatch. Returns -1 if search failed. | ||
void print(struct CList *l, size_t shift, int n, const char *type); | ||
Prints data of "int n" list items with offset "size_t shift" and type "const char *type". | ||
Supported types: char, short, int, long, uintptr_t, size_t, double, string. | ||
If type is NULL just pointers data will be printed. | ||
*/ | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif /* CLIST_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.