Initial commit

Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
This commit is contained in:
Robert Baldyga
2019-03-29 08:39:34 +01:00
commit 94e8ca09e0
140 changed files with 37144 additions and 0 deletions

58
casadm/table.h Normal file
View File

@@ -0,0 +1,58 @@
/*
* Copyright(c) 2012-2019 Intel Corporation
* SPDX-License-Identifier: BSD-3-Clause-Clear
*/
#ifndef __TABLE_H
#define __TABLE_H
struct table;
/**
* setup "table" structure.
*/
struct table *table_alloc();
/**
* deallocate table.
*/
void table_free(struct table *t);
/**
* max value of two integers
*/
int maxi(int x, int y);
/**
* retrieve a field of a table
*/
char *table_get(struct table *t,int y, int x);
int table_set(struct table *t, int y, int x, char *c);
/**
* reduce number of columns and rows to 0;
*/
int table_reset(struct table *t);
/**
* get last available column of table that was added via table_set
*/
int table_get_width(struct table *t);
/**
* get last available row of table that was added either via table_set or table_set_height
*/
int table_get_height(struct table *t);
/**
* set height of a table (additional rows will contain empty strings
*/
int table_set_height(struct table *t, int h);
/**
* set with of a table (additional rows will contain empty strings
*/
int table_set_width(struct table *t, int h);
#endif