Add GPL-2-or-later license headers to the DOS utility source files and document the purpose and local dependencies of each C, header and assembler file. Preserve the original Martin Stover copyright attribution for the historic MARS-NWE utility sources, including files that did not previously carry an explicit header but are part of the original tool set. Add Mario Fetka as the 2026 copyright holder for the current maintenance work, and use Mario-only headers for files without original Martin Stover ownership. Also add a root-level COPYING file containing the GPL-2 license text.
195 lines
6.9 KiB
C
195 lines
6.9 KiB
C
/*
|
|
* mars-nwe-dosutils - NetWare/DOS utility tools.
|
|
*
|
|
* Copyright (C) 2026 Mario Fetka
|
|
*
|
|
* 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 2
|
|
* of the License, or (at your option) any later version.
|
|
*
|
|
* 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.
|
|
*
|
|
* You should have received a copy of the GNU General Public License
|
|
* along with this program; if not, see <http://www.gnu.org/licenses/>.
|
|
*/
|
|
|
|
/*
|
|
* Purpose: Public declarations for Client32 and raw NCP helper routines.
|
|
* Depends on: net.h data types and c32ncp.c implementation.
|
|
*/
|
|
|
|
|
|
/* c32ncp.h - minimal Client32 NCP helpers for mars-dosutils */
|
|
|
|
#ifndef C32NCP_H
|
|
#define C32NCP_H
|
|
int c32_get_ncp_handle(uint16 *handle_lo, uint16 *handle_hi);
|
|
|
|
|
|
typedef struct c32_nwfile_handle6 {
|
|
uint8 h[6];
|
|
} C32_NWFILE_HANDLE6;
|
|
|
|
#define C32_OC_MODE_OPEN 0x01
|
|
#define C32_OC_MODE_TRUNCATE 0x02
|
|
#define C32_OC_MODE_CREATE 0x08
|
|
|
|
#define C32_DAR_READ 0x0001
|
|
#define C32_DAR_WRITE 0x0002
|
|
#define C32_DAR_DENY_READ 0x0004
|
|
#define C32_DAR_DENY_WRITE 0x0008
|
|
#define C32_DAR_COMPAT 0x0010
|
|
|
|
int c32_ncp87_open_create_file(const char *path_name,
|
|
uint16 dir_handle,
|
|
uint8 open_create_mode,
|
|
uint32 create_attrs,
|
|
uint16 desired_access,
|
|
uint16 search_attrs,
|
|
C32_NWFILE_HANDLE6 *handle_out,
|
|
uint32 *file_size_out,
|
|
uint8 *open_create_action_out,
|
|
uint16 *actual_out,
|
|
uint16 *handle_lo_out,
|
|
uint16 *handle_hi_out);
|
|
|
|
int c32_ncp74_file_server_copy(const C32_NWFILE_HANDLE6 *src,
|
|
const C32_NWFILE_HANDLE6 *dst,
|
|
uint32 src_offset,
|
|
uint32 dst_offset,
|
|
uint32 count,
|
|
uint32 *copied_out);
|
|
|
|
int c32_ncp66_close_file(const C32_NWFILE_HANDLE6 *handle);
|
|
|
|
|
|
int c32_ncp87_obtain_rim_attributes(const char *name,
|
|
uint16 dir_handle,
|
|
uint32 *attr_out,
|
|
uint16 *actual_out,
|
|
uint16 *handle_lo_out,
|
|
uint16 *handle_hi_out);
|
|
|
|
|
|
typedef struct c32_dos_modify_info {
|
|
uint32 attributes;
|
|
uint16 creation_time;
|
|
uint16 creation_date;
|
|
uint32 creator_id;
|
|
uint16 modify_time;
|
|
uint16 modify_date;
|
|
uint32 modifier_id;
|
|
uint16 last_access_date;
|
|
uint16 archive_time;
|
|
uint16 archive_date;
|
|
uint32 archiver_id;
|
|
uint16 inherited_rights;
|
|
uint32 maximum_space;
|
|
} C32_DOS_MODIFY_INFO;
|
|
|
|
typedef struct c32_ndir_info {
|
|
uint32 space_allocated;
|
|
uint32 attributes;
|
|
uint16 flags;
|
|
uint32 data_size;
|
|
uint32 total_size;
|
|
uint16 number_of_streams;
|
|
uint16 creation_time;
|
|
uint16 creation_date;
|
|
uint32 creator_id;
|
|
uint16 modify_time;
|
|
uint16 modify_date;
|
|
uint32 modifier_id;
|
|
uint16 last_access_date;
|
|
uint16 archive_time;
|
|
uint16 archive_date;
|
|
uint32 archiver_id;
|
|
uint16 inherited_rights;
|
|
uint32 dir_ent_num;
|
|
uint32 dos_dir_num;
|
|
uint32 vol_number;
|
|
uint32 ea_data_size;
|
|
uint32 ea_key_count;
|
|
uint32 ea_key_size;
|
|
uint32 ns_creator;
|
|
uint8 name_len;
|
|
char name[256];
|
|
} C32_NDIR_INFO;
|
|
|
|
int c32_ncp87_obtain_ndir_info(const char *path_name,
|
|
uint16 dir_handle,
|
|
C32_NDIR_INFO *info_out,
|
|
uint16 *actual_out,
|
|
uint16 *handle_lo_out,
|
|
uint16 *handle_hi_out);
|
|
|
|
|
|
int c32_ncp87_modify_dos_attributes(char *name,
|
|
uint16 dir_handle,
|
|
uint32 attrs,
|
|
uint16 *actual_out,
|
|
uint16 *handle_lo_out,
|
|
uint16 *handle_hi_out);
|
|
|
|
int c32_ncp87_modify_dos_info(const char *name,
|
|
uint16 dir_handle,
|
|
uint32 change_mask,
|
|
C32_DOS_MODIFY_INFO *info,
|
|
uint16 *actual_out,
|
|
uint16 *handle_lo_out,
|
|
uint16 *handle_hi_out);
|
|
|
|
int c32_ncp87_get_effective_rights(const char *path,
|
|
uint16 dir_handle,
|
|
uint16 *rights_out,
|
|
uint16 *actual_out,
|
|
uint16 *handle_lo_out,
|
|
uint16 *handle_hi_out);
|
|
|
|
|
|
int c32_ncp87_get_effective_rights_by_dirent(uint8 vol_number,
|
|
uint32 dos_dir_number,
|
|
uint16 *rights_out,
|
|
uint16 *actual_out,
|
|
uint16 *handle_lo_out,
|
|
uint16 *handle_hi_out);
|
|
|
|
int c32_ncp87_add_trustee_rights(const char *path_name,
|
|
uint16 dir_handle,
|
|
uint32 object_id,
|
|
uint16 rights,
|
|
uint16 rights_mask,
|
|
uint16 *actual_out,
|
|
uint16 *handle_lo_out,
|
|
uint16 *handle_hi_out);
|
|
|
|
int c32_ncp22_set_trustee_rights(const char *path_name,
|
|
uint16 dir_handle,
|
|
uint32 object_id,
|
|
uint16 rights);
|
|
|
|
int c32_ncp22_delete_trustee_rights(const char *path_name,
|
|
uint16 dir_handle,
|
|
uint32 object_id);
|
|
|
|
int c32_ncp87_find_trustee_rights(const char *path_name,
|
|
uint16 dir_handle,
|
|
uint32 object_id,
|
|
uint16 *rights_out,
|
|
uint16 *actual_out,
|
|
uint16 *handle_lo_out,
|
|
uint16 *handle_hi_out);
|
|
|
|
int c32_ncp87_delete_trustee_rights(const char *path_name,
|
|
uint16 dir_handle,
|
|
uint32 object_id,
|
|
uint16 *actual_out,
|
|
uint16 *handle_lo_out,
|
|
uint16 *handle_hi_out);
|
|
|
|
#endif
|