OpenVPN
chef.c
Go to the documentation of this file.
1 /*
2  * Copyright 2013 (c) Andreas Schneider <asn@cynapses.org>
3  * Jakub Hrozek <jakub.hrozek@gmail.com>
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 
18 #include <stdarg.h>
19 #include <stddef.h>
20 #include <setjmp.h>
21 #include <cmocka.h>
22 #include <stdio.h>
23 #include <errno.h>
24 #include <stdbool.h>
25 #include <string.h>
26 
27 #include "chef.h"
28 
29 
30 /* This is the real chef, just not implemented yet, currently it always
31  * returns ENOSYS
32  */
33 int chef_cook(const char *order, char **dish_out)
34 {
35  if (order == NULL || dish_out == NULL) return EINVAL;
36 
37  return -ENOSYS;
38 }
39 
40 /* Print chef return codes as string */
41 const char *chef_strerror(int error)
42 {
43  switch (error) {
44  case 0:
45  return "Success";
46  case -1:
47  return "Unknown dish";
48  case -2:
49  return "Not enough ingredients for the dish";
50  }
51 
52  return "Unknown error!";
53 }
54 
int chef_cook(const char *order, char **dish_out)
Definition: chef.c:33
const char * chef_strerror(int error)
Definition: chef.c:41