///
/// @file log_api.c
/// @authors k. Headley
/// @date 05 dec 2019

/// Structure independent log navigation API
/// used by log utils, uses log_impl API(s)

/// @sa doxygen-examples.c for more examples of Doxygen markup


/////////////////////////
// Terms of use
/////////////////////////
/*
 Copyright Information
 
 Copyright 2002-2019 MBARI
 Monterey Bay Aquarium Research Institute, all rights reserved.
 
 Terms of Use
 
 This program is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 the Free Software Foundation; either version 3 of the License, or
 (at your option) any later version. You can access the GPLv3 license at
 http://www.gnu.org/licenses/gpl-3.0.html
 
 This program is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details
 (http://www.gnu.org/licenses/gpl-3.0.html)
 
 MBARI provides the documentation and software code "as is", with no warranty,
 express or implied, as to the software, title, non-infringement of third party
 rights, merchantability, or fitness for any particular purpose, the accuracy of
 the code, or the performance or results which you may obtain from its use. You
 assume the entire risk associated with use of the code, and you agree to be
 responsible for the entire cost of repair or servicing of the program with
 which you are using the code.
 
 In no event shall MBARI be liable for any damages, whether general, special,
 incidental or consequential damages, arising out of your use of the software,
 including, but not limited to, the loss or corruption of your data or damages
 of any kind resulting from use of the software, any prohibited use, or your
 inability to use the software. You agree to defend, indemnify and hold harmless
 MBARI and its officers, directors, and employees against any claim, loss,
 liability or expense, including attorneys' fees, resulting from loss of or
 damage to property or the injury to or death of any person arising out of the
 use of the software.
 
 The MBARI software is provided without obligation on the part of the
 Monterey Bay Aquarium Research Institute to assist in its use, correction,
 modification, or enhancement.
 
 MBARI assumes no responsibility or liability for any third party and/or
 commercial software required for the database or applications. Licensee agrees
 to obtain and maintain valid licenses for any additional third party software
 required.
 */

/////////////////////////
// Headers 
/////////////////////////
#include <string.h>
#include "cwg-shared.h"
#include "log_api.h"

#if defined(__PIC24FJ256GA106__) || defined(__PIC24FJ256GA606__) || defined(__PIC24FJ1024GA606__)
#include "ioserial.h"
#endif


/////////////////////////
// Macros
/////////////////////////

// These macros should only be defined for 
// application main files rather than general C files
/*
/// @def PRODUCT
/// @brief header software product name
#define PRODUCT "carbonwg"

/// @def COPYRIGHT
/// @brief header software copyright info
#define COPYRIGHT "Copyright 2002-2019 MBARI Monterey Bay Aquarium Research Institute, all rights reserved."
/// @def NOWARRANTY
/// @brief header software terms of use
#define NOWARRANTY  \
"This program is distributed in the hope that it will be useful,\n"\
"but WITHOUT ANY WARRANTY; without even the implied warranty of\n"\
"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n"\
"GNU General Public License for more details (http://www.gnu.org/licenses/gpl-3.0.html)\n"
*/

/////////////////////////
// Declarations 
/////////////////////////

/////////////////////////
// Imports
/////////////////////////

/////////////////////////
// Module Global Variables
/////////////////////////

/////////////////////////
// Function Definitions
/////////////////////////

//int lctx_init(log_ctx_t *self, char *fpath, log_impl_t *impl, lutil_type_id type)
//{
//    int retval=-1;
//    if(NULL!=self){
//
//        memset(self,0,sizeof(log_ctx_t));
//        limpl_init(impl, fpath, type);
//        // self->length
//        // self->cur
//        // self->flags
//        self->impl = impl;
//        self->show_fmt=NULL;
//        self->search_def=NULL;
//        retval=0;
//    }
//    return retval;
//}

//int lctx_seek(log_ctx_t *self, log_dir_t dir, uint32_t start, uint32_t count)
//{
//    int retval=-1;
//    if(NULL!=self && NULL!=self->impl && NULL!=self->impl->seek){
//        uint32_t r_ofs=0;
//        if(self->impl->seek(self->impl, dir, start, count, &r_ofs, NULL)==0){
//            retval = 0;
//        }else{TRACE();}
//    }
//    return retval;
//
//}
//
//int lctx_show(log_ctx_t *self, int indent, char **opts)
//{
//    int retval=-1;
//    if(NULL!=self && NULL!=self->impl && NULL!=self->impl->show){
//       retval = self->impl->show(self->impl, indent, opts);
//    }
//    return retval;
//
//}
//
//int lctx_show_info(log_ctx_t *self, int indent, char **opts)
//{
//    int retval=-1;
//    if(NULL!=self && NULL!=self->impl && NULL!=self->impl->show_info){
//        retval = self->impl->show_info(self->impl, 5, opts);
//    }
//    return retval;
//}
