This repository has been archived on 2022-02-10. You can view files and clone it, but cannot push or open issues or pull requests.
rangitaki-sync/rangitaki-sync.h

65 lines
2.2 KiB
C

/* Rangitaki Sync Library
*
* A program for downloading and uploading blog posts,
* blogs file and media files from a rangitaki blog.
*
* Proudly written in C and with use of libssh (libssh.org)
*
* Version: 0.1
*
* Authors:
*
* COPYRIGHT (c) 2015 The Rangitaki Project
* COPYRIGHT (c) 2015 Marcel Kapfer (mmk2410) <marcelmichaelkapfer@yahoo.co.nz>
*
* License: MIT License
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
*/
#ifndef _rangitakisync_h
#define _rangitakisync_h
#include <libssh/libssh.h>
typedef struct{
char *host;
char *user;
char *password;
char *remote_dir;
char *local_dir;
unsigned int port;
unsigned int verbosity;
} ssh_data;
void ssh_initialize(const char *host, const char *user, const char *password,
const char *remote_dir, const char *local_dir,
const unsigned int port, ssh_data *data);
ssh_session ssh_open(ssh_data *data);
int ssh_close(ssh_session ssh);
ssh_scp scp_open(ssh_session ssh, ssh_data *data, int mode);
int scp_close(ssh_scp scp);
int scp_download(ssh_session ssh, ssh_scp scp, ssh_data *data);
int scp_upload(ssh_session ssh, ssh_scp scp, ssh_data *data);
#endif