diff options
author | Mauro Sardara <msardara@cisco.com> | 2019-01-24 17:52:53 +0100 |
---|---|---|
committer | Mauro Sardara <msardara@cisco.com> | 2019-01-24 17:52:53 +0100 |
commit | c07ad72f016930e2aba6471d0e2e9625b935bf9a (patch) | |
tree | 03aa7b7c737a7a70321ef25d67c2fbd892cd76db /libparc/parc/algol/parc_Execution.c | |
parent | 9fc2b9ec49c54ec2d5f0164bbedc1c78732c464c (diff) |
Remove cframework files from master
Change-Id: I02f17ede1cf97986a8b8852ed6d6a28fc016f590
Signed-off-by: Mauro Sardara <msardara@cisco.com>
Diffstat (limited to 'libparc/parc/algol/parc_Execution.c')
-rw-r--r-- | libparc/parc/algol/parc_Execution.c | 97 |
1 files changed, 0 insertions, 97 deletions
diff --git a/libparc/parc/algol/parc_Execution.c b/libparc/parc/algol/parc_Execution.c deleted file mode 100644 index 8b31dcdb..00000000 --- a/libparc/parc/algol/parc_Execution.c +++ /dev/null @@ -1,97 +0,0 @@ -// -// parc_Status.c -// Libparc -// -// -// -#include <config.h> -#include <stdio.h> - -#include "parc_Execution.h" - -/* - * A PARCExecution value is a unique thing which can have a string assigned to it. - * - * I want the function to be: - * - * A thing that returns an Execution - * - * Execution function() { } - * - * A thing that an Execution value can be - * - * Execution value = function; - */ - -struct PARCExecution { - struct PARCExecution (*type)(char *format, ...); - char *message; -}; - -PARCExecution *PARCExecution_OK = &(PARCExecution) { - .message = "OK" -}; - -PARCExecution *PARCExecution_Timeout = &(PARCExecution) { - .message = "Timeout" -}; - -PARCExecution *PARCExecution_Interrupted = &(PARCExecution) { - .message = "Interrupted" -}; - -PARCExecution *PARCExecution_IOError = &(PARCExecution) { - .message = "I/O Error" -}; - -PARCExecution * -parcExecution_OK(const char *format, ...) -{ - return PARCExecution_OK; -} - -PARCExecution * -parcExecution_Interrupted(const char *format, ...) -{ - return PARCExecution_Interrupted; -} - -PARCExecution * -parcExecution_IOError(const char *format, ...) -{ - return PARCExecution_IOError; -} - -bool -parcExecution_Is(const PARCExecution *exec, const PARCExecution *other) -{ - return (exec == other); -} - -char * -parcExecution_GetMessage(const PARCExecution *exec) -{ - return exec->message; -} - -PARCExecution * -bar() -{ - return PARCExecution_OK; -} - -PARCExecution * -baz() -{ - return parcExecution_OK("Nothing to say"); -} - -void -foo() -{ - PARCExecution *x = bar(); - PARCExecution *y = baz(); - - printf("%s\n", parcExecution_GetMessage(x)); - printf("%s\n", parcExecution_GetMessage(y)); -} |