convert.c

来自「Audacity是一款用於錄音和編輯聲音的、免費的開放源碼軟體。它可以執行於Ma」· C语言 代码 · 共 60 行

C
60
字号
/* convert.c -- convert between file name notations */#include "switches.h"#include "stdio.h"#include "string.h"#include "convert.h"char dir_separator = #ifdef MACINTOSH':';#endif#ifdef DOS'\\';#endif#ifdef UNIX'/';#endif#ifdef AMIGA'/';#endif/* Note: syntax error if not one and only one is defined (this is a feature) */int pauseflag;/* convert -- convert filename to local naming conventions *//**/void convert(char *filename){        int i;        /* first test for problem characters */        for (i = strlen(filename); i >= 0; i--) {                if (filename[i] == ':' || filename[i] == '\\') {                        fprintf(stderr, "WARNING: %s has one of \":\\\" and may not port.\n",                                                                                    filename);                        fprintf(stderr, "         '/' should be used as directory separator.\n");                        if (PAUSE) getchar();                }        }#ifdef MACINTOSH        /* prepend a ":" */        for (i = strlen(filename); i >= 0; i--) {                filename[i + 1] = filename[i];        }        filename[0] = ':';#endif#ifndef UNIX#ifndef AMIGA    /* replace '/' with local separator */    for (i = strlen(filename); i >= 0; i--) {            if (filename[i] == '/') filename[i] = dir_separator;    }#endif#endif}

⌨️ 快捷键说明

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