diff --git a/INSTRUCTIONS.txt b/INSTRUCTIONS.txt new file mode 100644 index 0000000..c656346 --- /dev/null +++ b/INSTRUCTIONS.txt @@ -0,0 +1,12 @@ +To compile this under Linux: + +gcc -o platy_gnu buffer.c buffer.h platy_bt.c -Wall -ansi -pedantic + +To use: +./platy_gnu ass1.pls [f|a|m] + +f: fixed increment mode +a: additive increment mode +m: multiplicative mode + +NOTE: Change buffer.h to use malloc.h instead of mm_maloc.h if running on anything that isn't macOS \ No newline at end of file diff --git a/MPTFAssignment1_F16/ass1ai.out b/MPTFAssignment1_F16/ass1ai.out deleted file mode 100755 index c4c0841..0000000 --- a/MPTFAssignment1_F16/ass1ai.out +++ /dev/null @@ -1,41 +0,0 @@ -Reading file ass1.pls ....Please wait - -Printing buffer parameters: - -The capacity of the buffer is: 320 -The current size of the buffer is: 319 -The operational mode of the buffer is: 1 -The increment factor of the buffer is: 15 -The current mark of the buffer is: 319 - -Printing buffer contents: - -Compilers are fundamental to modern computing. -They act as translators, transforming human-oriented -language into computer-oriented machine-language. -A compiler allows virtually all computer users to -ignore the machine-dependent details of machine language. -Isn't that nice? =:) - -CST8152 -Autumn, 2016 - -Printing buffer parameters: - -The capacity of the buffer is: 320 -The current size of the buffer is: 320 -The operational mode of the buffer is: 1 -The increment factor of the buffer is: 15 -The current mark of the buffer is: 319 - -Printing buffer contents: - -Compilers are fundamental to modern computing. -They act as translators, transforming human-oriented -language into computer-oriented machine-language. -A compiler allows virtually all computer users to -ignore the machine-dependent details of machine language. -Isn't that nice? =:) - -CST8152 -Autumn, 2016˙ diff --git a/MPTFAssignment1_F16/ass1e.out b/MPTFAssignment1_F16/ass1e.out deleted file mode 100755 index e7b9d4e..0000000 --- a/MPTFAssignment1_F16/ass1e.out +++ /dev/null @@ -1,25 +0,0 @@ -Reading file ass1e.pls ....Please wait - -Printing buffer parameters: - -The capacity of the buffer is: 200 -The current size of the buffer is: 0 -The operational mode of the buffer is: 0 -The increment factor of the buffer is: 0 -The current mark of the buffer is: 0 - -Printing buffer contents: - -The buffer is empty. - -Printing buffer parameters: - -The capacity of the buffer is: 1 -The current size of the buffer is: 1 -The operational mode of the buffer is: 0 -The increment factor of the buffer is: 0 -The current mark of the buffer is: 0 - -Printing buffer contents: - -˙ diff --git a/MPTFAssignment1_F16/ass1fi.out b/MPTFAssignment1_F16/ass1fi.out deleted file mode 100755 index 7d97ee4..0000000 --- a/MPTFAssignment1_F16/ass1fi.out +++ /dev/null @@ -1,33 +0,0 @@ -Reading file ass1.pls ....Please wait -The input file ass1.pls is not completely loaded. -Input file size: 327 - -Printing buffer parameters: - -The capacity of the buffer is: 200 -The current size of the buffer is: 200 -The operational mode of the buffer is: 0 -The increment factor of the buffer is: 0 -The current mark of the buffer is: 200 - -Printing buffer contents: - -Compilers are fundamental to modern computing. -They act as translators, transforming human-oriented -language into computer-oriented machine-language. -A compiler allows virtually all compu - -Printing buffer parameters: - -The capacity of the buffer is: 201 -The current size of the buffer is: 201 -The operational mode of the buffer is: 0 -The increment factor of the buffer is: 0 -The current mark of the buffer is: 200 - -Printing buffer contents: - -Compilers are fundamental to modern computing. -They act as translators, transforming human-oriented -language into computer-oriented machine-language. -A compiler allows virtually all compu˙ diff --git a/MPTFAssignment1_F16/ass1mi.out b/MPTFAssignment1_F16/ass1mi.out deleted file mode 100755 index 9c4ae3b..0000000 --- a/MPTFAssignment1_F16/ass1mi.out +++ /dev/null @@ -1,41 +0,0 @@ -Reading file ass1.pls ....Please wait - -Printing buffer parameters: - -The capacity of the buffer is: 5085 -The current size of the buffer is: 319 -The operational mode of the buffer is: -1 -The increment factor of the buffer is: 15 -The current mark of the buffer is: 319 - -Printing buffer contents: - -Compilers are fundamental to modern computing. -They act as translators, transforming human-oriented -language into computer-oriented machine-language. -A compiler allows virtually all computer users to -ignore the machine-dependent details of machine language. -Isn't that nice? =:) - -CST8152 -Autumn, 2016 - -Printing buffer parameters: - -The capacity of the buffer is: 320 -The current size of the buffer is: 320 -The operational mode of the buffer is: -1 -The increment factor of the buffer is: 15 -The current mark of the buffer is: 319 - -Printing buffer contents: - -Compilers are fundamental to modern computing. -They act as translators, transforming human-oriented -language into computer-oriented machine-language. -A compiler allows virtually all computer users to -ignore the machine-dependent details of machine language. -Isn't that nice? =:) - -CST8152 -Autumn, 2016˙ diff --git a/buffer.c b/buffer.c index 17b95ef..66cf657 100644 --- a/buffer.c +++ b/buffer.c @@ -239,7 +239,7 @@ short b_setmark(Buffer* const pBD, short mark) { - pBuffer const pBD * Return value: 1, 0 */ - int b_eob(Buffer* const pBD) { +int b_eob(Buffer* const pBD) { if (!pBD) { return R_FAIL1; } return pBD->eob; } @@ -379,7 +379,7 @@ int b_print(Buffer* const pBD) { /* Loads symbols from a file to the buffer * Author: Victor Fernandes, 040772243 * Version: 0.0.1 - * Called functions: N/A + * Called functions: fgetc, feof, b_addc * Parameters: - FILE* const fi - pBuffer const pBD diff --git a/platy_gnu b/platy_gnu index 9386402..a878227 100755 Binary files a/platy_gnu and b/platy_gnu differ diff --git a/test/ass1ai_test.out b/test/ass1ai_test.out index a3e5a23..fc1b7fa 100644 --- a/test/ass1ai_test.out +++ b/test/ass1ai_test.out @@ -19,6 +19,7 @@ Isn't that nice? =:) CST8152 Autumn, 2016˙ +6 Printing buffer parameters: @@ -39,3 +40,4 @@ Isn't that nice? =:) CST8152 Autumn, 2016˙˙ +˙