00001 /*****************************************************************************\ 00002 * * 00003 * Name : short_path * 00004 * Author : Chris Koeritz * 00005 * * 00006 * Purpose: * 00007 * * 00008 * This program converts a pathname to its 8.3 name. Only for windows. * 00009 * * 00010 ******************************************************************************* 00011 * Copyright (c) 2007-$now By Author. This program is free software; you can * 00012 * redistribute it and/or modify it under the terms of the GNU General Public * 00013 * License as published by the Free Software Foundation; either version 2 of * 00014 * the License or (at your option) any later version. This is online at: * 00015 * http://www.fsf.org/copyleft/gpl.html * 00016 * Please send any updates to: fred@gruntose.com * 00017 \*****************************************************************************/ 00018 00019 #include <basis/istring.h> 00020 #include <data_struct/static_memory_gremlin.h> 00021 00022 #include <stdio.h> 00023 #include <string.h> 00024 #ifdef __WIN32__ 00025 #include <windows.h> 00026 #endif 00027 00028 HOOPLE_STARTUP_CODE; 00029 00030 int main(int argc, char *argv[]) 00031 { 00032 istring shorty('\0', 2048); 00033 if (argc < 2) { 00034 printf("This program needs a path to convert to its short form.\n"); 00035 return 23; 00036 } 00037 #ifdef __WIN32__ 00038 GetShortPathNameA(argv[1], shorty.s(), 2045); 00039 #else 00040 strcpy(shorty.s(), argv[1]); 00041 #endif 00042 shorty.replace_all('\\', '/'); 00043 printf(shorty.s()); 00044 return 0; 00045 } 00046 00047 #ifdef __BUILD_STATIC_APPLICATION__ 00048 // static dependencies found by buildor_gen_deps.sh: 00049 #include <basis/array.cpp> 00050 #include <basis/byte_array.cpp> 00051 #include <basis/callstack_tracker.cpp> 00052 #include <basis/chaos.cpp> 00053 #include <basis/convert_utf.cpp> 00054 #include <basis/definitions.cpp> 00055 #include <basis/earth_time.cpp> 00056 #include <basis/guards.cpp> 00057 #include <basis/istring.cpp> 00058 #include <basis/log_base.cpp> 00059 #include <basis/memory_checker.cpp> 00060 #include <basis/mutex.cpp> 00061 #include <basis/object_base.cpp> 00062 #include <basis/outcome.cpp> 00063 #include <basis/packable.cpp> 00064 #include <basis/portable.cpp> 00065 #include <basis/sequence.cpp> 00066 #include <basis/set.cpp> 00067 #include <basis/utility.cpp> 00068 #include <basis/version_record.cpp> 00069 #include <data_struct/amorph.cpp> 00070 #include <data_struct/bit_vector.cpp> 00071 #include <data_struct/byte_hasher.cpp> 00072 #include <data_struct/configurator.cpp> 00073 #include <data_struct/hash_table.cpp> 00074 #include <data_struct/pointer_hash.cpp> 00075 #include <data_struct/stack.cpp> 00076 #include <data_struct/static_memory_gremlin.cpp> 00077 #include <data_struct/string_hash.cpp> 00078 #include <data_struct/string_hasher.cpp> 00079 #include <data_struct/string_table.cpp> 00080 #include <data_struct/symbol_table.cpp> 00081 #include <data_struct/table_configurator.cpp> 00082 #include <loggers/console_logger.cpp> 00083 #include <loggers/file_logger.cpp> 00084 #include <loggers/locked_logger.cpp> 00085 #include <loggers/null_logger.cpp> 00086 #include <loggers/program_wide_logger.cpp> 00087 #include <opsystem/byte_filer.cpp> 00088 #include <opsystem/command_line.cpp> 00089 #include <opsystem/critical_events.cpp> 00090 #include <opsystem/directory.cpp> 00091 #include <opsystem/filename.cpp> 00092 #include <opsystem/ini_config.cpp> 00093 #include <opsystem/ini_parser.cpp> 00094 #include <opsystem/path_configuration.cpp> 00095 #include <opsystem/rendezvous.cpp> 00096 #include <textual/byte_format.cpp> 00097 #include <textual/parser_bits.cpp> 00098 #include <textual/string_manipulation.cpp> 00099 #include <textual/tokenizer.cpp> 00100 #endif // __BUILD_STATIC_APPLICATION__ 00101
1.5.1