fname.c

来自「CC386 is a general-purpose 32-bit C comp」· C语言 代码 · 共 37 行

C
37
字号
#include "afx.h"


static char full[ _MAX_PATH ];
static char drive[ _MAX_DRIVE ];
static char dir[ _MAX_DIR ];
static char name[ _MAX_FNAME ];
static char ext[ _MAX_EXT ];


void fn_split( char *fname ) {
	assert( fname != NULL );
	strcpy( full, fname);
    _splitpath( full, drive, dir, name, ext );
}

char *fn_drive(void) { return drive; }
char *fn_dir(void)	 { return dir; }
char *fn_name(void)  { return name; }
char *fn_ext(void)   { return ext; }

char *fn_path(void) {
	_makepath( full, drive, dir, NULL, NULL );
	return full;
}

char *fn_make(char *fext) {
	_makepath( full, drive, dir, name, fext == NULL ? ext : fext );	
	return full;
}

char *fn_temp(char *fext) {
	assert( fext != NULL );
	_makepath( full, NULL, NULL, name, fext );	
	return full;
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?