Tried new things in headers.
This commit is contained in:
parent
81c4f88502
commit
7c40bd72af
|
@ -53,7 +53,6 @@
|
|||
|
||||
# Web directory - where the HTML files will be put.
|
||||
HTMLDIR := ./html
|
||||
|
||||
#******************************************************************************#
|
||||
# Object names, libs #
|
||||
#******************************************************************************#
|
||||
|
@ -64,7 +63,6 @@
|
|||
# Static library name
|
||||
ANAME := $(if $(FOR_WINDOWS),lib$(NAME).lib,lib$(NAME).a)
|
||||
ANAMES := lib$(NAME).lib lib$(NAME).a lib$(NAME).dll.a
|
||||
|
||||
#******************************************************************************#
|
||||
# Binary utilities #
|
||||
#******************************************************************************#
|
||||
|
@ -78,7 +76,7 @@
|
|||
# - More flags (for profiling, ...)
|
||||
#CMOREFLAGS :=
|
||||
# - Check flags (for warnings)
|
||||
CWERROR := all extra no-unused-macros no-vla
|
||||
CWERROR := all extra no-unused-macros no-vla no-nonnull-compare
|
||||
ifdef MORE_WARNINGS
|
||||
CWERROR += shadow write-strings redundant-decls format format-nonliteral \
|
||||
format-security implicit-function-declaration \
|
||||
|
|
228
include/libp7.h
228
include/libp7.h
|
@ -83,12 +83,16 @@ extern const char *p7_error_strings[];
|
|||
/* Random stuff */
|
||||
/* ************************************************************************** */
|
||||
/* Filename and dirname */
|
||||
extern int p7_validate_filename(const char *p7_arg_filename);
|
||||
extern int p7_validate_dirname(const char *p7_arg_dirname);
|
||||
extern int p7_validate_filename(const char *p7_arg_filename)
|
||||
p7_attribute_THROW p7_attribute_wur p7_attribute_nonnull(1);
|
||||
extern int p7_validate_dirname(const char *p7_arg_dirname)
|
||||
p7_attribute_THROW p7_attribute_wur p7_attribute_nonnull(1);
|
||||
|
||||
/* Make settings out of a string */
|
||||
extern int p7_makesettings(p7_streamsettings_t *p7_arg_settings,
|
||||
const char *p7_arg_s);
|
||||
# define p7_attrs_makesettings \
|
||||
p7_attribute_THROW p7_attribute_nonnull(1) p7_attribute_nonnull(2)
|
||||
p7_declare_ufunc(p7_makesettings, p7_attrs_makesettings,
|
||||
p7_streamsettings_t *p7_arg_settings, const char *p7_arg_string)
|
||||
/* ************************************************************************** */
|
||||
/* Core functions */
|
||||
/* ************************************************************************** */
|
||||
|
@ -109,137 +113,217 @@ extern int p7_makesettings(p7_streamsettings_t *p7_arg_settings,
|
|||
# define P7_TERM p7_flag_term
|
||||
|
||||
/* "Normal" initialization */
|
||||
extern int p7_init(p7_handle_t **p7_arg_handle, unsigned int p7_arg_flags);
|
||||
extern int p7_cominit(p7_handle_t **p7_arg_handle, unsigned int p7_arg_flags,
|
||||
const char *p7_arg_path, const p7_streamsettings_t *p7_arg_settings);
|
||||
extern int p7_comlist(p7_list_device_t *p7_arg_callback, void *p7_arg_cookie);
|
||||
# define p7_attrs_init p7_attribute_THROW
|
||||
p7_declare_func(p7_init, int, p7_attrs_init,
|
||||
p7_handle_t **p7_arg_handle, unsigned int p7_arg_flags)
|
||||
# define p7_attrs_cominit p7_attribute_THROW p7_attribute_nonnull(3)
|
||||
p7_declare_func(p7_cominit, int, p7_attrs_cominit,
|
||||
p7_handle_t **p7_arg_handle, unsigned int p7_arg_flags,
|
||||
const char *p7_arg_path, const p7_streamsettings_t *p7_arg_settings)
|
||||
|
||||
/* De-initialization */
|
||||
extern void p7_exit(p7_handle_t *p7_arg_handle);
|
||||
/* Deinitialization */
|
||||
# define p7_attrs_exit p7_attribute_nonnull(1)
|
||||
p7_declare_func(p7_exit, void, p7_attrs_exit,
|
||||
p7_handle_t *p7_arg_handle)
|
||||
|
||||
/* List serial devices */
|
||||
# define p7_attrs_comlist p7_attribute_nonnull(1)
|
||||
p7_declare_func(p7_comlist, int, p7_attrs_comlist,
|
||||
p7_list_device_t *p7_arg_callback, void *p7_arg_cookie)
|
||||
/* ************************************************************************** */
|
||||
/* MCS interaction */
|
||||
/* ************************************************************************** */
|
||||
/* List files */
|
||||
extern int p7_mcs_list(p7_handle_t *p7_arg_handle,
|
||||
p7_mcslist_t *p7_arg_callback, void *p7_arg_cookie);
|
||||
# define p7_attrs_mcs_list p7_attribute_nonnull(1)
|
||||
p7_declare_ufunc(p7_mcs_list, p7_attrs_mcs_list,
|
||||
p7_handle_t *p7_arg_handle,
|
||||
p7_mcslist_t *p7_arg_callback, void *p7_arg_cookie)
|
||||
|
||||
/* Send a file */
|
||||
extern int p7_mcs_send(p7_handle_t *p7_arg_handle, g1m_mcsfile_t *p7_arg_file,
|
||||
int p7_arg_overwrite, p7_confirm_t *p7_arg_confirm, p7_disp_t *p7_arg_disp);
|
||||
# define p7_attrs_mcs_send p7_attribute_nonnull(1) p7_attribute_nonnull(2)
|
||||
p7_declare_ufunc(p7_mcs_send, p7_attrs_mcs_send,
|
||||
p7_handle_t *p7_arg_handle, g1m_mcsfile_t *p7_arg_file,
|
||||
int p7_arg_overwrite, p7_confirm_t *p7_arg_confirm,
|
||||
p7_disp_t *p7_arg_disp)
|
||||
|
||||
/* Request a file */
|
||||
extern int p7_mcs_request(p7_handle_t *p7_arg_handle,
|
||||
g1m_mcsfile_t **p7_arg_file, g1m_mcshead_t *p7_arg_head,
|
||||
p7_disp_t *p7_arg_disp);
|
||||
# define p7_attrs_mcs_request \
|
||||
p7_attribute_nonnull(1) p7_attribute_nonnull(2) p7_attribute_nonnull(3)
|
||||
p7_declare_ufunc(p7_mcs_request, p7_attrs_mcs_request,
|
||||
p7_handle_t *p7_arg_handle, g1m_mcsfile_t **p7_arg_file,
|
||||
g1m_mcshead_t *p7_arg_head, p7_disp_t *p7_arg_disp)
|
||||
/* ************************************************************************** */
|
||||
/* Storage memory interaction */
|
||||
/* ************************************************************************** */
|
||||
/* Send a file using buffer */
|
||||
extern int p7_send(p7_handle_t *p7_arg_handle,
|
||||
const p7_buffer_t *p7_arg_buffer,
|
||||
# define p7_attrs_send \
|
||||
p7_attribute_nonnull(1) p7_attribute_nonnull(2) \
|
||||
p7_attribute_nonnull(4) p7_attribute_nonnull(5)
|
||||
p7_declare_ufunc(p7_send, p7_attrs_send,
|
||||
p7_handle_t *p7_arg_handle, const p7_buffer_t *p7_arg_buffer,
|
||||
const char *p7_arg_dirname, const char *p7_arg_filename,
|
||||
const char *p7_arg_devname, int p7_arg_overwrite,
|
||||
p7_confirm_t *p7_arg_confirm, p7_disp_t *p7_arg_disp);
|
||||
p7_confirm_t *p7_arg_confirm, p7_disp_t *p7_arg_disp)
|
||||
|
||||
/* Receive a file using buffer */
|
||||
extern int p7_request(p7_handle_t *p7_arg_handle,
|
||||
const p7_buffer_t *p7_arg_buffer,
|
||||
# define p7_attrs_request \
|
||||
p7_attribute_nonnull(1) p7_attribute_nonnull(2) \
|
||||
p7_attribute_nonnull(4) p7_attribute_nonnull(5)
|
||||
p7_declare_ufunc(p7_request, p7_attrs_request,
|
||||
p7_handle_t *p7_arg_handle, const p7_buffer_t *p7_arg_buffer,
|
||||
const char *p7_arg_dirname, const char *p7_arg_filename,
|
||||
const char *p7_arg_devname, p7_disp_t *p7_arg_disp);
|
||||
const char *p7_arg_devname, p7_disp_t *p7_arg_disp)
|
||||
|
||||
/* FILE version of the two previous functions */
|
||||
# ifndef P7_DISABLED_FILE
|
||||
extern int p7_sendfile(p7_handle_t *p7_arg_handle, FILE *p7_arg_file,
|
||||
# define p7_attrs_sendfile \
|
||||
p7_attribute_nonnull(1) p7_attribute_nonnull(2) \
|
||||
p7_attribute_nonnull(4) p7_attribute_nonnull(5)
|
||||
p7_declare_ufunc(p7_sendfile, p7_attrs_sendfile,
|
||||
p7_handle_t *p7_arg_handle, FILE *p7_arg_file,
|
||||
const char *p7_arg_dirname, const char *p7_arg_filename,
|
||||
const char *p7_arg_devname, int p7_arg_overwrite,
|
||||
p7_confirm_t *p7_arg_confirm, p7_disp_t *p7_arg_disp);
|
||||
extern int p7_reqfile(p7_handle_t *p7_arg_handle, FILE *p7_arg_file,
|
||||
p7_confirm_t *p7_arg_confirm, p7_disp_t *p7_arg_disp)
|
||||
|
||||
# define p7_attrs_reqfile \
|
||||
p7_attribute_nonnull(1) p7_attribute_nonnull(2) \
|
||||
p7_attribute_nonnull(4) p7_attribute_nonnull(5)
|
||||
p7_declare_ufunc(p7_reqfile, p7_attrs_reqfile,
|
||||
p7_handle_t *p7_arg_handle, FILE *p7_arg_file,
|
||||
const char *p7_arg_dirname, const char *p7_arg_filename,
|
||||
const char *p7_arg_devname, p7_disp_t *p7_arg_disp);
|
||||
const char *p7_arg_devname, p7_disp_t *p7_arg_disp)
|
||||
# endif
|
||||
|
||||
/* Memory version of the send function */
|
||||
extern int p7_sendmem(p7_handle_t *p7_arg_handle,
|
||||
const void *p7_arg_mem, size_t p7_arg_size,
|
||||
# define p7_attrs_sendmem \
|
||||
p7_attribute_nonnull(1) p7_attribute_nonnull(2) \
|
||||
p7_attribute_nonnull(5) p7_attribute_nonnull(6)
|
||||
p7_declare_ufunc(p7_sendmem, p7_attrs_sendmem,
|
||||
p7_handle_t *p7_arg_handle, const void *p7_arg_mem, size_t p7_arg_size,
|
||||
const char *p7_arg_dirname, const char *p7_arg_filename,
|
||||
const char *p7_arg_devname, int p7_arg_overwrite,
|
||||
p7_confirm_t *p7_arg_confirm, p7_disp_t *p7_arg_disp);
|
||||
const char *p7_arg_devname,
|
||||
int p7_arg_overwrite, p7_confirm_t *p7_arg_confirm,
|
||||
p7_disp_t *p7_arg_disp)
|
||||
|
||||
/* Create a directory */
|
||||
extern int p7_createdir(p7_handle_t *p7_arg_handle,
|
||||
const char *p7_arg_dirname, const char *p7_arg_devname);
|
||||
# define p7_attrs_createdir p7_attribute_nonnull(1) p7_attribute_nonnull(3)
|
||||
p7_declare_ufunc(p7_createdir, p7_attrs_createdir,
|
||||
p7_handle_t *p7_arg_handle,
|
||||
const char *p7_arg_dirname, const char *p7_arg_devname)
|
||||
|
||||
/* Delete distant file */
|
||||
extern int p7_delete(p7_handle_t *p7_arg_handle,
|
||||
const char *p7_arg_dirname, const char *p7_arg_filename,
|
||||
const char *p7_arg_devname);
|
||||
# define p7_attrs_delete \
|
||||
p7_attribute_nonnull(1) p7_attribute_nonnull(3) p7_attribute_nonnull(4)
|
||||
p7_declare_ufunc(p7_delete, p7_attrs_delete,
|
||||
p7_handle_t *p7_arg_handle, const char *p7_arg_dirname,
|
||||
const char *p7_arg_filename, const char *p7_arg_devname)
|
||||
|
||||
/* Copy file on distant device */
|
||||
extern int p7_copy(p7_handle_t *p7_arg_handle,
|
||||
# define p7_attrs_copy \
|
||||
p7_attribute_nonnull(1) p7_attribute_nonnull(3) \
|
||||
p7_attribute_nonnull(5) p7_attribute_nonnull(6)
|
||||
p7_declare_ufunc(p7_copy, p7_attrs_copy,
|
||||
p7_handle_t *p7_arg_handle,
|
||||
const char *p7_arg_dirname, const char *p7_arg_filename,
|
||||
const char *p7_arg_newdir, const char *p7_arg_newname,
|
||||
const char *p7_arg_devname);
|
||||
const char *p7_arg_devname)
|
||||
|
||||
/* List files */
|
||||
extern int p7_list(p7_handle_t *p7_arg_handle, const char *p7_arg_devname,
|
||||
p7_list_t *p7_arg_callback, void *p7_arg_cookie);
|
||||
# define p7_attrs_list p7_attribute_nonnull(1) p7_attribute_nonnull(2)
|
||||
p7_declare_ufunc(p7_list, p7_attrs_list,
|
||||
p7_handle_t *p7_arg_handle, const char *p7_arg_devname,
|
||||
p7_list_t *p7_arg_callback, void *p7_arg_cookie)
|
||||
|
||||
/* Get the free memory amount */
|
||||
extern int p7_getfreemem(p7_handle_t *p7_arg_handle, const char *p7_arg_devname,
|
||||
p7uint_t *p7_arg_capacity);
|
||||
# define p7_attrs_getfreemem p7_attribute_nonnull(1) p7_attribute_nonnull(2)
|
||||
p7_declare_ufunc(p7_getfreemem, p7_attrs_getfreemem,
|
||||
p7_handle_t *p7_arg_handle, const char *p7_arg_devname,
|
||||
p7uint_t *p7_arg_capacity)
|
||||
|
||||
/* Reset filesystem on a distant device */
|
||||
extern int p7_reset(p7_handle_t *p7_arg_handle, const char *p7_arg_devname);
|
||||
# define p7_attrs_reset p7_attribute_nonnull(1) p7_attribute_nonnull(2)
|
||||
p7_declare_ufunc(p7_reset, p7_attrs_reset,
|
||||
p7_handle_t *p7_arg_handle, const char *p7_arg_devname)
|
||||
|
||||
/* Optimize distant device */
|
||||
extern int p7_optimize(p7_handle_t *p7_arg_handle, const char *p7_arg_devname);
|
||||
# define p7_attrs_optimize p7_attribute_nonnull(1) p7_attribute_nonnull(2)
|
||||
p7_declare_ufunc(p7_optimize, p7_attrs_optimize,
|
||||
p7_handle_t *p7_arg_handle, const char *p7_arg_devname)
|
||||
/* ************************************************************************** */
|
||||
/* Miscallenous interactions */
|
||||
/* ************************************************************************** */
|
||||
/* Poke the calculator in order to keep it happy */
|
||||
extern int p7_poke(p7_handle_t *p7_arg_handle);
|
||||
# define p7_attrs_poke p7_attribute_nonnull(1)
|
||||
p7_declare_ufunc(p7_poke, p7_attrs_poke,
|
||||
p7_handle_t *p7_arg_handle)
|
||||
|
||||
/* Send an update.exe */
|
||||
extern int p7_sendexe(p7_handle_t *p7_arg_handle,
|
||||
const p7_buffer_t *p7_arg_buffer,
|
||||
p7uint_t p7_arg_loadaddr, p7uint_t p7_arg_straddr, p7_disp_t *p7_arg_disp);
|
||||
# define p7_attrs_sendexe p7_attribute_nonnull(1) p7_attribute_nonnull(2)
|
||||
p7_declare_ufunc(p7_sendexe, p7_attrs_sendexe,
|
||||
p7_handle_t *p7_arg_handle, const p7_buffer_t *p7_arg_buffer,
|
||||
p7uint_t p7_arg_loadaddr, p7uint_t p7_arg_straddr, p7_disp_t *p7_arg_disp)
|
||||
|
||||
/* Backup the flash ROM, bootcode and CASIOWIN entry */
|
||||
extern int p7_backup_rom(p7_handle_t *p7_arg_handle,
|
||||
const p7_buffer_t *p7_arg_buffer, p7_disp_t *p7_arg_disp);
|
||||
extern int p7_backup_ram(p7_handle_t *p7_arg_handle,
|
||||
const p7_buffer_t *p7_arg_buffer, p7_disp_t *p7_arg_disp);
|
||||
extern int p7_backup_boot(p7_handle_t *p7_arg_handle,
|
||||
const p7_buffer_t *p7_arg_buffer, p7_disp_t *p7_arg_disp);
|
||||
extern int p7_backup_casiowin_entry(p7_handle_t *p7_arg_handle,
|
||||
p7_casiowin_entry_t *p7_arg_entry);
|
||||
# define p7_attrs_backup_rom p7_attribute_nonnull(1) p7_attribute_nonnull(2)
|
||||
p7_declare_ufunc(p7_backup_rom, p7_attrs_backup_rom,
|
||||
p7_handle_t *p7_arg_handle, const p7_buffer_t *p7_arg_buffer,
|
||||
p7_disp_t *p7_arg_disp)
|
||||
# define p7_attrs_backup_ram p7_attribute_nonnull(1) p7_attribute_nonnull(2)
|
||||
p7_declare_ufunc(p7_backup_ram, p7_attrs_backup_ram,
|
||||
p7_handle_t *p7_arg_handle, const p7_buffer_t *p7_arg_buffer,
|
||||
p7_disp_t *p7_arg_disp)
|
||||
# define p7_attrs_backup_boot p7_attribute_nonnull(1) p7_attribute_nonnull(2)
|
||||
p7_declare_ufunc(p7_backup_boot, p7_attrs_backup_boot,
|
||||
p7_handle_t *p7_arg_handle, const p7_buffer_t *p7_arg_buffer,
|
||||
p7_disp_t *p7_arg_disp)
|
||||
# define p7_attrs_backup_casiowin_entry \
|
||||
p7_attribute_nonnull(1) p7_attribute_nonnull(2)
|
||||
p7_declare_ufunc(p7_backup_casiowin_entry, p7_attrs_backup_casiowin_entry,
|
||||
p7_handle_t *p7_arg_handle, p7_casiowin_entry_t *p7_arg_entry)
|
||||
|
||||
/* set link settings */
|
||||
extern int p7_setlink(p7_handle_t *p7_arg_handle,
|
||||
const p7_streamsettings_t *p7_arg_settings);
|
||||
# define p7_attrs_setlink p7_attribute_nonnull(1)
|
||||
p7_declare_ufunc(p7_setlink, p7_attrs_setlink,
|
||||
p7_handle_t *p7_arg_handle, const p7_streamsettings_t *p7_arg_settings)
|
||||
|
||||
/* FILE version of the previous functions */
|
||||
# ifndef P7_DISABLED_FILE
|
||||
/* Send an update.exe */
|
||||
extern int p7_sendexe_file(p7_handle_t *p7_arg_handle,
|
||||
FILE *p7_arg_exe, p7uint_t p7_arg_loadaddr, p7uint_t p7_arg_straddr,
|
||||
p7_disp_t *p7_arg_disp);
|
||||
extern int p7_backup_romfile(p7_handle_t *p7_arg_handle, FILE *p7_arg_file,
|
||||
p7_disp_t *p7_arg_disp);
|
||||
extern int p7_backup_ramfile(p7_handle_t *p7_arg_handle, FILE *p7_arg_file,
|
||||
p7_disp_t *p7_arg_disp);
|
||||
extern int p7_backup_bootfile(p7_handle_t *p7_arg_handle, FILE *p7_arg_file,
|
||||
p7_disp_t *p7_arg_disp);
|
||||
# define p7_attrs_sendexe_file p7_attribute_nonnull(1) p7_attribute_nonnull(2)
|
||||
p7_declare_ufunc(p7_sendexe_file, p7_attrs_sendexe_file,
|
||||
p7_handle_t *p7_arg_handle, FILE *p7_arg_exe,
|
||||
p7uint_t p7_arg_loadaddr, p7uint_t p7_arg_straddr,
|
||||
p7_disp_t *p7_arg_disp)
|
||||
|
||||
/* Backup things */
|
||||
# define p7_attrs_backup_romfile \
|
||||
p7_attribute_nonnull(1) p7_attribute_nonnull(2)
|
||||
p7_declare_ufunc(p7_backup_romfile, p7_attrs_backup_romfile,
|
||||
p7_handle_t *p7_arg_handle, FILE *p7_arg_file,
|
||||
p7_disp_t *p7_arg_disp)
|
||||
# define p7_attrs_backup_ramfile \
|
||||
p7_attribute_nonnull(1) p7_attribute_nonnull(2)
|
||||
p7_declare_ufunc(p7_backup_ramfile, p7_attrs_backup_ramfile,
|
||||
p7_handle_t *p7_arg_handle, FILE *p7_arg_file,
|
||||
p7_disp_t *p7_arg_disp)
|
||||
# define p7_attrs_backup_bootfile \
|
||||
p7_attribute_nonnull(1) p7_attribute_nonnull(2)
|
||||
p7_declare_ufunc(p7_backup_bootfile, p7_attrs_backup_bootfile,
|
||||
p7_handle_t *p7_arg_handle, FILE *p7_arg_file,
|
||||
p7_disp_t *p7_arg_disp)
|
||||
# endif
|
||||
|
||||
/* Memory version of the previous functions */
|
||||
extern int p7_sendexe_mem(p7_handle_t *p7_arg_handle,
|
||||
const void *p7_arg_mem, size_t p7_arg_size, p7uint_t p7_arg_loadaddr,
|
||||
p7uint_t p7_arg_straddr, p7_disp_t *p7_arg_disp);
|
||||
# define p7_attrs_sendexe_mem p7_attribute_nonnull(1) p7_attribute_nonnull(2)
|
||||
p7_declare_ufunc(p7_sendexe_mem, p7_attrs_sendexe_mem,
|
||||
p7_handle_t *p7_arg_handle, const void *p7_arg_mem, size_t p7_arg_size,
|
||||
p7uint_t p7_arg_loadaddr, p7uint_t p7_arg_straddr,
|
||||
p7_disp_t *p7_arg_disp)
|
||||
|
||||
/* Display streamed screen */
|
||||
extern int p7_getscreen(p7_handle_t *p7_arg_handle,
|
||||
p7_screenfunc_t *p7_arg_callback);
|
||||
# define p7_attrs_getscreen p7_attribute_nonnull(1)
|
||||
p7_declare_ufunc(p7_getscreen, p7_attrs_getscreen,
|
||||
p7_handle_t *p7_arg_handle, p7_screenfunc_t *p7_arg_callback)
|
||||
|
||||
# ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -0,0 +1,120 @@
|
|||
/* *****************************************************************************
|
||||
* libp7/cdefs.h -- libp7 C definitions.
|
||||
* Copyright (C) 2016-2017 Thomas "Cakeisalie5" Touhey <thomas@touhey.fr>
|
||||
*
|
||||
* This file is part of libp7.
|
||||
* libp7 is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation; either version 3.0 of the License,
|
||||
* or (at your option) any later version.
|
||||
*
|
||||
* libp7 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 Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with libp7; if not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* The libp7 buffer interface is an abstraction layer between libp7 and files
|
||||
* or data on disk in general.
|
||||
* ************************************************************************** */
|
||||
#ifndef LIBP7_CDEFS_H
|
||||
# define LIBP7_CDEFS_H
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* Important things */
|
||||
/* ************************************************************************** */
|
||||
/* Declare any function. */
|
||||
# ifdef p7_declare_func
|
||||
# undef p7_declare_func
|
||||
# endif
|
||||
# ifdef __STDC_VERSION__
|
||||
# define p7_declare_func(P7_ARG_NAME, P7_ARG_RET, P7_ARG_ATTRS, ...) \
|
||||
extern P7_ARG_RET P7_ARG_NAME (__VA_ARGS__) P7_ARG_ATTRS;
|
||||
# else
|
||||
# define p7_declare_func(P7_ARG_NAME, P7_ARG_RET, P7_ARG_ATTRS, ...) \
|
||||
extern P7_ARG_RET P7_ARG_NAME () P7_ARG_ATTRS;
|
||||
# endif
|
||||
|
||||
/* Define any function (head). */
|
||||
# ifdef p7_define_func
|
||||
# undef p7_define_func
|
||||
# endif
|
||||
# if defined(_MSC_VER)
|
||||
# define p7_define_func(P7_ARG_NAME, P7_ARG_RET, P7_ARG_ATTRS, ...) \
|
||||
P7_ARG_ATTRS P7_ARG_RET P7_ARG_NAME (__VA_ARGS__)
|
||||
# else
|
||||
# define p7_define_func(P7_ARG_NAME, P7_ARG_RET, P7_ARG_ATTRS, ...) \
|
||||
P7_ARG_RET P7_ARG_NAME (__VA_ARGS__)
|
||||
# endif
|
||||
|
||||
/* Declare an usage function.
|
||||
* TODO: add the handle here? */
|
||||
# ifdef p7_declare_ufunc
|
||||
# undef p7_declare_ufunc
|
||||
# endif
|
||||
# define p7_declare_ufunc(P7_ARG_NAME, P7_ARG_ATTRS, ...) \
|
||||
p7_declare_func(P7_ARG_NAME, int, P7_ARG_ATTRS p7_attribute_err, \
|
||||
__VA_ARGS__)
|
||||
# define p7_define_ufunc(P7_ARG_NAME, P7_ARG_ATTRS, ...) \
|
||||
p7_define_func(P7_ARG_NAME, int, P7_ARG_ATTRS p7_attribute_err, \
|
||||
__VA_ARGS__)
|
||||
/* ************************************************************************** */
|
||||
/* Attributes */
|
||||
/* ************************************************************************** */
|
||||
/* p7_attribute_THROW: optimize function calls for C++
|
||||
* TODO: explain more */
|
||||
|
||||
# ifdef p7_attribute_THROW
|
||||
# undef p7_attribute_THROW
|
||||
# endif
|
||||
# if defined(__cplusplus)
|
||||
# define p7_attribute_THROW throw()
|
||||
# elif defined(__GNUC__)
|
||||
# define p7_attribute_THROW __attribute__((nothrow))
|
||||
# elif defined(_MSC_VER)
|
||||
# define p7_attribute_THROW __declspec(nothrow)
|
||||
# else
|
||||
# define p7_attribute_THROW
|
||||
# endif
|
||||
|
||||
/* p7_attribute_nonnull: require a pointer argument not to be NULL
|
||||
* A warning shall be issued when a NULL value is passed as an argument that
|
||||
* shouldn't be. The macro argument is the argument index, starting from 1. */
|
||||
|
||||
# ifdef p7_attribute_nonnull
|
||||
# undef p7_attribute_nonnull
|
||||
# endif
|
||||
# if defined(__GNUC__)
|
||||
# define p7_attribute_nonnull(P7_ARG_N) __attribute__((nonnull(P7_ARG_N)))
|
||||
# else
|
||||
# define p7_attribute_nonnull(P7_ARG_N)
|
||||
# endif
|
||||
|
||||
/* p7_attribute_wur: warn unused result
|
||||
* A warning shall be issued if the result of the function isn't used.
|
||||
* Note that __pure implies __wur, you don't need to put the two. */
|
||||
|
||||
# ifdef p7_attribute_wur
|
||||
# undef p7_attribute_wur
|
||||
# endif
|
||||
# if defined(__GNUC__) && (__GNUC__ >= 4)
|
||||
# define p7_attribute_wur __attribute__((warn_unused_result))
|
||||
# elif defined(_MSC_VER) && (_MSC_VER >= 1700)
|
||||
# include <sal.h>
|
||||
# define p7_attribute_wur _Check_return_
|
||||
# else
|
||||
# define p7_attribute_wur
|
||||
# endif
|
||||
|
||||
/* p7_attribute_err: return a libp7 error
|
||||
* This is so the `wur` on functions returning an error is more easily
|
||||
* tweakable. */
|
||||
|
||||
# ifdef p7_attribute_err
|
||||
# undef p7_attribute_err
|
||||
# endif
|
||||
# define p7_attribute_err /* p7_attribute_wur */
|
||||
|
||||
#endif /* LIBP7_CDEFS_H */
|
|
@ -31,13 +31,18 @@ extern "C" {
|
|||
*
|
||||
* Here is the function for serving directly: */
|
||||
|
||||
extern int p7_serve_directly(p7_handle_t *p7_arg_handle,
|
||||
p7_server_callback_t **p7_arg_callbacks, void *p7_arg_cookie);
|
||||
# define p7_attrs_serve_directly p7_attribute_nonnull(1) p7_attribute_nonnull(2)
|
||||
p7_declare_ufunc(p7_serve_directly, p7_attrs_serve_directly,
|
||||
p7_handle_t *p7_arg_handle,
|
||||
p7_server_callback_t **p7_arg_callbacks, void *p7_arg_cookie)
|
||||
|
||||
/* And here is the function for serving a 'classical' server: */
|
||||
|
||||
extern int p7_serve(p7_handle_t *p7_arg_handle, p7_server_t *p7_arg_info,
|
||||
p7_filesystem_t *p7_arg_filesystems);
|
||||
# define p7_attrs_serve \
|
||||
p7_attribute_nonnull(1) p7_attribute_nonnull(2) p7_attribute_nonnull(3)
|
||||
p7_declare_ufunc(p7_serve, p7_attrs_serve,
|
||||
p7_handle_t *p7_arg_handle, p7_server_t *p7_arg_info,
|
||||
p7_filesystem_t *p7_arg_filesystems)
|
||||
|
||||
# ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -34,6 +34,7 @@
|
|||
# include <alloca.h>
|
||||
# endif
|
||||
# include <libg1m.h>
|
||||
# include <libp7/cdefs.h>
|
||||
# ifdef __cplusplus
|
||||
extern "C" {
|
||||
# endif
|
||||
|
|
|
@ -88,7 +88,6 @@ static int decode_entry(p7_handle_t *handle, p7_casiowin_entry_t *entry,
|
|||
/* no error */
|
||||
return (0);
|
||||
}
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* Get a CASIOWIN entry */
|
||||
/* ************************************************************************** */
|
||||
|
@ -101,7 +100,8 @@ static int decode_entry(p7_handle_t *handle, p7_casiowin_entry_t *entry,
|
|||
* @return the error code (0 if ok)
|
||||
*/
|
||||
|
||||
int p7_backup_casiowin_entry(p7_handle_t *handle, p7_casiowin_entry_t *entry)
|
||||
p7_define_ufunc(p7_backup_casiowin_entry, p7_attrs_backup_casiowin_entry,
|
||||
p7_handle_t *handle, p7_casiowin_entry_t *entry)
|
||||
{
|
||||
int err;
|
||||
|
||||
|
@ -144,7 +144,6 @@ int p7_backup_casiowin_entry(p7_handle_t *handle, p7_casiowin_entry_t *entry)
|
|||
/* decode and return */
|
||||
return (decode_entry(handle, entry, &raw));
|
||||
}
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* Backup the bootcode */
|
||||
/* ************************************************************************** */
|
||||
|
@ -165,8 +164,8 @@ int p7_backup_casiowin_entry(p7_handle_t *handle, p7_casiowin_entry_t *entry)
|
|||
*/
|
||||
|
||||
#define bootcode_size (0x10000)
|
||||
int p7_backup_boot(p7_handle_t *handle, const p7_buffer_t *buffer,
|
||||
p7_disp_t disp)
|
||||
p7_define_ufunc(p7_backup_boot, p7_attrs_backup_boot,
|
||||
p7_handle_t *handle, const p7_buffer_t *buffer, p7_disp_t *disp)
|
||||
{
|
||||
int err;
|
||||
|
||||
|
@ -219,7 +218,8 @@ int p7_backup_boot(p7_handle_t *handle, const p7_buffer_t *buffer,
|
|||
* @return the error code (0 if ok).
|
||||
*/
|
||||
|
||||
int p7_backup_bootfile(p7_handle_t *handle, FILE *file, p7_disp_t disp)
|
||||
p7_define_ufunc(p7_backup_bootfile, p7_attrs_backup_bootfile,
|
||||
p7_handle_t *handle, FILE *file, p7_disp_t *disp)
|
||||
{
|
||||
chk_iswrite(file);
|
||||
p7_buffer_t buffer = {
|
||||
|
@ -244,8 +244,8 @@ int p7_backup_bootfile(p7_handle_t *handle, FILE *file, p7_disp_t disp)
|
|||
*/
|
||||
|
||||
#define rom_size (handle->_server.p7_server_flash_rom_capacity)
|
||||
int p7_backup_rom(p7_handle_t *handle, const p7_buffer_t *buffer,
|
||||
p7_disp_t disp)
|
||||
p7_define_ufunc(p7_backup_rom, p7_attrs_backup_rom,
|
||||
p7_handle_t *handle, const p7_buffer_t *buffer, p7_disp_t *disp)
|
||||
{
|
||||
int err;
|
||||
|
||||
|
@ -298,7 +298,8 @@ int p7_backup_rom(p7_handle_t *handle, const p7_buffer_t *buffer,
|
|||
* @return the error code (0 if ok).
|
||||
*/
|
||||
|
||||
int p7_backup_romfile(p7_handle_t *handle, FILE *file, p7_disp_t disp)
|
||||
p7_define_ufunc(p7_backup_romfile, p7_attrs_backup_romfile,
|
||||
p7_handle_t *handle, FILE *file, p7_disp_t *disp)
|
||||
{
|
||||
chk_iswrite(file);
|
||||
p7_buffer_t buffer = {
|
||||
|
@ -323,8 +324,8 @@ int p7_backup_romfile(p7_handle_t *handle, FILE *file, p7_disp_t disp)
|
|||
*/
|
||||
|
||||
#define ram_size (0x10000)
|
||||
int p7_backup_ram(p7_handle_t *handle, const p7_buffer_t *buffer,
|
||||
p7_disp_t disp)
|
||||
p7_define_ufunc(p7_backup_ram, p7_attrs_backup_ram,
|
||||
p7_handle_t *handle, const p7_buffer_t *buffer, p7_disp_t *disp)
|
||||
{
|
||||
int err;
|
||||
|
||||
|
@ -377,7 +378,8 @@ int p7_backup_ram(p7_handle_t *handle, const p7_buffer_t *buffer,
|
|||
* @return the error code (0 if ok).
|
||||
*/
|
||||
|
||||
int p7_backup_ramfile(p7_handle_t *handle, FILE *file, p7_disp_t disp)
|
||||
p7_define_ufunc(p7_backup_ramfile, p7_attrs_backup_ramfile,
|
||||
p7_handle_t *handle, FILE *file, p7_disp_t *disp)
|
||||
{
|
||||
chk_iswrite(file);
|
||||
p7_buffer_t buffer = {
|
||||
|
|
|
@ -117,7 +117,8 @@ static void p7_getscreen_adapt(uint32_t **pixels, p7_packet_t *resp)
|
|||
* @return if it worked
|
||||
*/
|
||||
|
||||
int p7_getscreen(p7_handle_t *handle, int (*callback)(int, int, uint32_t**))
|
||||
p7_define_ufunc(p7_getscreen, p7_attrs_getscreen,
|
||||
p7_handle_t *handle, p7_screenfunc_t *callback)
|
||||
{
|
||||
int err;
|
||||
/* make checks */
|
||||
|
|
|
@ -28,7 +28,8 @@
|
|||
* @return if it worked.
|
||||
*/
|
||||
|
||||
int p7_mcs_list(p7_handle_t *handle, p7_mcslist_t callback, void *cookie)
|
||||
p7_define_ufunc(p7_mcs_list, p7_attrs_mcs_list,
|
||||
p7_handle_t *handle, p7_mcslist_t *callback, void *cookie)
|
||||
{
|
||||
int err;
|
||||
|
||||
|
|
|
@ -29,11 +29,11 @@
|
|||
* @return the libp7 error (0 if ok)
|
||||
*/
|
||||
|
||||
int p7_mcs_request(p7_handle_t *handle, g1m_mcsfile_t **file,
|
||||
g1m_mcshead_t *reqhead, p7_disp_t disp)
|
||||
p7_define_ufunc(p7_mcs_request, p7_attrs_mcs_request,
|
||||
p7_handle_t *handle, g1m_mcsfile_t **file,
|
||||
g1m_mcshead_t *head, p7_disp_t *disp)
|
||||
{
|
||||
int err;
|
||||
|
||||
/* make checks */
|
||||
chk_handle(handle);
|
||||
chk_seven(handle);
|
||||
|
|
|
@ -31,8 +31,9 @@
|
|||
* @return the libp7 error (0 if ok).
|
||||
*/
|
||||
|
||||
int p7_mcs_send(p7_handle_t *handle, g1m_mcsfile_t *file,
|
||||
int overwrite, p7_confirm_t confirm, p7_disp_t disp)
|
||||
p7_define_ufunc(p7_mcs_send, p7_attrs_mcs_send,
|
||||
p7_handle_t *handle, g1m_mcsfile_t *file,
|
||||
int overwrite, p7_confirm_t *confirm, p7_disp_t *disp)
|
||||
{
|
||||
int err;
|
||||
|
||||
|
|
|
@ -26,7 +26,8 @@
|
|||
* @return if it worked.
|
||||
*/
|
||||
|
||||
int p7_poke(p7_handle_t *handle)
|
||||
p7_define_ufunc(p7_poke, p7_attrs_poke,
|
||||
p7_handle_t *handle)
|
||||
{
|
||||
int err;
|
||||
/* make checks */
|
||||
|
|
|
@ -30,8 +30,9 @@
|
|||
* @return 0 if it worked, error code otherwise
|
||||
*/
|
||||
|
||||
int p7_sendexe(p7_handle_t *handle, const p7_buffer_t *buffer,
|
||||
p7uint_t loadaddr, p7uint_t straddr, p7_disp_t disp)
|
||||
p7_define_ufunc(p7_sendexe, p7_attrs_sendexe,
|
||||
p7_handle_t *handle, const p7_buffer_t *buffer,
|
||||
p7uint_t loadaddr, p7uint_t straddr, p7_disp_t *disp)
|
||||
{
|
||||
int err;
|
||||
|
||||
|
@ -77,8 +78,9 @@ int p7_sendexe(p7_handle_t *handle, const p7_buffer_t *buffer,
|
|||
* @return the error code
|
||||
*/
|
||||
|
||||
int p7_sendexe_file(p7_handle_t *handle,
|
||||
FILE *exe, p7uint_t loadaddr, p7uint_t straddr, p7_disp_t disp)
|
||||
p7_define_ufunc(p7_sendexe_file, p7_attrs_sendexe_file,
|
||||
p7_handle_t *handle, FILE *exe,
|
||||
p7uint_t loadaddr, p7uint_t straddr, p7_disp_t *disp)
|
||||
{
|
||||
/* make checks */
|
||||
chk_isread(exe);
|
||||
|
@ -117,9 +119,9 @@ int p7_sendexe_file(p7_handle_t *handle,
|
|||
* @return the error code.
|
||||
*/
|
||||
|
||||
int p7_sendexe_mem(p7_handle_t *handle,
|
||||
const void *mem, size_t size, p7uint_t loadaddr, p7uint_t straddr,
|
||||
p7_disp_t disp)
|
||||
p7_define_ufunc(p7_sendexe_mem, p7_attrs_sendexe_mem,
|
||||
p7_handle_t *handle, const void *mem, size_t size,
|
||||
p7uint_t loadaddr, p7uint_t straddr, p7_disp_t *disp)
|
||||
{
|
||||
chk_mem(mem);
|
||||
chk_filesize(size);
|
||||
|
|
|
@ -306,8 +306,8 @@ static int change_working_directory(p7_server_cookie_t *cookie,
|
|||
* @return the error code.
|
||||
*/
|
||||
|
||||
int p7_serve(p7_handle_t *handle, p7_server_t *info,
|
||||
p7_filesystem_t *filesystems)
|
||||
p7_define_ufunc(p7_serve, p7_attrs_serve,
|
||||
p7_handle_t *handle, p7_server_t *info, p7_filesystem_t *filesystems)
|
||||
{
|
||||
/* make cookie and commands */
|
||||
p7_server_cookie_t cookie = {
|
||||
|
|
|
@ -28,8 +28,8 @@
|
|||
* @return the error.
|
||||
*/
|
||||
|
||||
int p7_serve_directly(p7_handle_t *handle, p7_server_callback_t **callbacks,
|
||||
void *cookie)
|
||||
p7_define_ufunc(p7_serve_directly, p7_attrs_serve_directly,
|
||||
p7_handle_t *handle, p7_server_callback_t **callbacks, void *cookie)
|
||||
{
|
||||
int err;
|
||||
/* make checks */
|
||||
|
|
|
@ -28,7 +28,8 @@
|
|||
* @return the error code.
|
||||
*/
|
||||
|
||||
int p7_setlink(p7_handle_t *handle, const p7_streamsettings_t *settings)
|
||||
p7_define_ufunc(p7_setlink, p7_attrs_setlink,
|
||||
p7_handle_t *handle, const p7_streamsettings_t *settings)
|
||||
{
|
||||
int err;
|
||||
|
||||
|
|
|
@ -31,7 +31,8 @@
|
|||
* @return if it worked
|
||||
*/
|
||||
|
||||
int p7_copy(p7_handle_t *handle,
|
||||
p7_define_ufunc(p7_copy, p7_attrs_copy,
|
||||
p7_handle_t *handle,
|
||||
const char *dirname, const char *filename,
|
||||
const char *newdir, const char *newname, const char *devname)
|
||||
{
|
||||
|
|
|
@ -28,7 +28,8 @@
|
|||
* @return the error code (0 if ok)
|
||||
*/
|
||||
|
||||
int p7_createdir(p7_handle_t *handle, const char *dirname, const char *devname)
|
||||
p7_define_ufunc(p7_createdir, p7_attrs_createdir,
|
||||
p7_handle_t *handle, const char *dirname, const char *devname)
|
||||
{
|
||||
int err;
|
||||
|
||||
|
|
|
@ -29,8 +29,9 @@
|
|||
* @return if it worked
|
||||
*/
|
||||
|
||||
int p7_delete(p7_handle_t *handle,
|
||||
const char *dirname, const char *filename, const char *devname)
|
||||
p7_define_ufunc(p7_delete, p7_attrs_delete,
|
||||
p7_handle_t *handle, const char *dirname,
|
||||
const char *filename, const char *devname)
|
||||
{
|
||||
int err;
|
||||
|
||||
|
|
|
@ -28,8 +28,8 @@
|
|||
* @return if there was an error.
|
||||
*/
|
||||
|
||||
int p7_getfreemem(p7_handle_t *handle, const char *devname,
|
||||
p7uint_t *capacity)
|
||||
p7_define_ufunc(p7_getfreemem, p7_attrs_getfreemem,
|
||||
p7_handle_t *handle, const char *devname, p7uint_t *capacity)
|
||||
{
|
||||
int err;
|
||||
/* make checks */
|
||||
|
|
|
@ -29,9 +29,9 @@
|
|||
* @return if it worked
|
||||
*/
|
||||
|
||||
int p7_list(p7_handle_t *handle, const char *devname,
|
||||
void (*callback)(void*, const char*, const char*, p7uint_t),
|
||||
void *cookie)
|
||||
p7_define_ufunc(p7_list, p7_attrs_list,
|
||||
p7_handle_t *handle, const char *devname,
|
||||
p7_list_t *callback, void *cookie)
|
||||
{
|
||||
int err;
|
||||
|
||||
|
@ -79,7 +79,8 @@ int p7_list(p7_handle_t *handle, const char *devname,
|
|||
/* device root should not be sent */
|
||||
if (!dir && !filename) continue;
|
||||
/* call callback */
|
||||
(*callback)(cookie, dir, filename, fs);
|
||||
if (callback)
|
||||
(*callback)(cookie, dir, filename, fs);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
|
|
@ -27,7 +27,8 @@
|
|||
* @return if it worked
|
||||
*/
|
||||
|
||||
int p7_optimize(p7_handle_t *handle, const char *devname)
|
||||
p7_define_ufunc(p7_optimize, p7_attrs_optimize,
|
||||
p7_handle_t *handle, const char *devname)
|
||||
{
|
||||
int err;
|
||||
|
||||
|
|
|
@ -31,9 +31,10 @@
|
|||
* @return if it worked
|
||||
*/
|
||||
|
||||
int p7_request(p7_handle_t *handle, const p7_buffer_t *buffer,
|
||||
const char *dirname, const char *filename, const char *devname,
|
||||
p7_disp_t disp)
|
||||
p7_define_ufunc(p7_request, p7_attrs_request,
|
||||
p7_handle_t *handle, const p7_buffer_t *buffer,
|
||||
const char *dirname, const char *filename,
|
||||
const char *devname, p7_disp_t *disp)
|
||||
{
|
||||
int err;
|
||||
|
||||
|
@ -101,9 +102,10 @@ int p7_request(p7_handle_t *handle, const p7_buffer_t *buffer,
|
|||
* @return the error code (0 if ok).
|
||||
*/
|
||||
|
||||
int p7_reqfile(p7_handle_t *handle, FILE *file,
|
||||
const char *dirname, const char *filename, const char *devname,
|
||||
p7_disp_t disp)
|
||||
p7_define_ufunc(p7_reqfile, p7_attrs_reqfile,
|
||||
p7_handle_t *handle, FILE *file,
|
||||
const char *dirname, const char *filename,
|
||||
const char *devname, p7_disp_t *disp)
|
||||
{
|
||||
chk_iswrite(file);
|
||||
p7_buffer_t buffer = {
|
||||
|
@ -113,5 +115,4 @@ int p7_reqfile(p7_handle_t *handle, FILE *file,
|
|||
|
||||
return (p7_request(handle, &buffer, dirname, filename, devname, disp));
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -27,7 +27,8 @@
|
|||
* @return if it worked
|
||||
*/
|
||||
|
||||
int p7_reset(p7_handle_t *handle, const char *devname)
|
||||
p7_define_ufunc(p7_reset, p7_attrs_reset,
|
||||
p7_handle_t *handle, const char *devname)
|
||||
{
|
||||
int err;
|
||||
|
||||
|
|
|
@ -34,9 +34,11 @@
|
|||
* @return if it worked
|
||||
*/
|
||||
|
||||
int p7_send(p7_handle_t *handle, const p7_buffer_t *buffer,
|
||||
const char *dirname, const char *filename, const char *devname,
|
||||
int overwrite, p7_confirm_t confirm, p7_disp_t disp)
|
||||
p7_define_ufunc(p7_send, p7_attrs_send,
|
||||
p7_handle_t *handle, const p7_buffer_t *buffer,
|
||||
const char *dirname, const char *filename,
|
||||
const char *devname, int overwrite,
|
||||
p7_confirm_t *confirm, p7_disp_t *disp)
|
||||
{
|
||||
int err;
|
||||
|
||||
|
@ -139,9 +141,11 @@ int p7_send(p7_handle_t *handle, const p7_buffer_t *buffer,
|
|||
* @return if it worked
|
||||
*/
|
||||
|
||||
int p7_sendfile(p7_handle_t *handle,
|
||||
FILE *file, const char *dirname, const char *filename,
|
||||
const char *devname, int overwrite, p7_confirm_t confirm, p7_disp_t disp)
|
||||
p7_define_ufunc(p7_sendfile, p7_attrs_sendfile,
|
||||
p7_handle_t *handle, FILE *file,
|
||||
const char *dirname, const char *filename,
|
||||
const char *devname, int overwrite,
|
||||
p7_confirm_t *confirm, p7_disp_t *disp)
|
||||
{
|
||||
chk_isread(file);
|
||||
|
||||
|
@ -187,9 +191,11 @@ int p7_sendfile(p7_handle_t *handle,
|
|||
* @return if it worked
|
||||
*/
|
||||
|
||||
int p7_sendmem(p7_handle_t *handle, const void *mem, size_t size,
|
||||
const char *dirname, const char *filename, const char *devname,
|
||||
int overwrite, p7_confirm_t confirm, p7_disp_t disp)
|
||||
p7_define_ufunc(p7_sendmem, p7_attrs_sendmem,
|
||||
p7_handle_t *handle, const void *mem, size_t size,
|
||||
const char *dirname, const char *filename,
|
||||
const char *devname, int overwrite, p7_confirm_t *confirm,
|
||||
p7_disp_t *disp)
|
||||
{
|
||||
chk_mem(mem);
|
||||
chk_filesize(size);
|
||||
|
|
Reference in New Issue