2016-10-27 18:11:34 +00:00
|
|
|
//
|
|
|
|
// option.c
|
|
|
|
// c-ipfs
|
|
|
|
//
|
|
|
|
// Created by John Jones on 10/26/16.
|
|
|
|
// Copyright © 2016 JMJAtlanta. All rights reserved.
|
|
|
|
//
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
2016-10-31 16:13:42 +00:00
|
|
|
#include "ipfs/commands/command_option.h"
|
2016-10-27 18:11:34 +00:00
|
|
|
|
2016-11-10 13:28:51 +00:00
|
|
|
int commands_command_option_init(struct CommandOption* option, char* description) {
|
2016-10-27 18:11:34 +00:00
|
|
|
option->description = description;
|
|
|
|
// allocate memory for names
|
|
|
|
option->names = malloc(option->name_count * sizeof(char*));
|
|
|
|
if (option->names == NULL)
|
|
|
|
return 0;
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
2016-11-10 13:28:51 +00:00
|
|
|
int commands_command_option_free(struct CommandOption* option) {
|
2016-10-27 18:11:34 +00:00
|
|
|
free(option->names);
|
|
|
|
return 0;
|
|
|
|
}
|