HGGitLab
Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
app
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
CI / CD Analytics
Repository Analytics
Value Stream Analytics
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
luoliangyi
app
Commits
9c6b18de
Commit
9c6b18de
authored
May 03, 2022
by
luoliangyi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加mips64obj文件转换工程
parent
1d9940a1
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
135 additions
and
0 deletions
+135
-0
third_party/mupdf/uos/mips64/32objto64obj/32objto64obj.cbp
third_party/mupdf/uos/mips64/32objto64obj/32objto64obj.cbp
+41
-0
third_party/mupdf/uos/mips64/32objto64obj/main.cpp
third_party/mupdf/uos/mips64/32objto64obj/main.cpp
+94
-0
No files found.
third_party/mupdf/uos/mips64/32objto64obj/32objto64obj.cbp
0 → 100644
View file @
9c6b18de
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<CodeBlocks_project_file>
<FileVersion
major=
"1"
minor=
"6"
/>
<Project>
<Option
title=
"32objto64obj"
/>
<Option
pch_mode=
"2"
/>
<Option
compiler=
"gcc"
/>
<Build>
<Target
title=
"Debug"
>
<Option
output=
"bin/Debug/32objto64obj"
prefix_auto=
"1"
extension_auto=
"1"
/>
<Option
object_output=
"obj/Debug/"
/>
<Option
type=
"1"
/>
<Option
compiler=
"gcc"
/>
<Compiler>
<Add
option=
"-g"
/>
</Compiler>
</Target>
<Target
title=
"Release"
>
<Option
output=
"bin/Release/32objto64obj"
prefix_auto=
"1"
extension_auto=
"1"
/>
<Option
object_output=
"obj/Release/"
/>
<Option
type=
"1"
/>
<Option
compiler=
"gcc"
/>
<Compiler>
<Add
option=
"-O2"
/>
</Compiler>
<Linker>
<Add
option=
"-s"
/>
</Linker>
</Target>
</Build>
<Compiler>
<Add
option=
"-Wall"
/>
<Add
option=
"-fexceptions"
/>
</Compiler>
<Unit
filename=
"main.cpp"
/>
<Extensions>
<code_completion
/>
<debugger
/>
</Extensions>
</Project>
</CodeBlocks_project_file>
third_party/mupdf/uos/mips64/32objto64obj/main.cpp
0 → 100644
View file @
9c6b18de
#include <stdio.h>
#include <vector>
#include <dirent.h>
#include <errno.h>
#include <string.h>
#include <elf.h>
static
void
list_files
(
const
char
*
dir_path
)
{
DIR
*
ptr_dir
=
NULL
;
struct
dirent
*
ptr_dirent
=
NULL
;
ptr_dir
=
opendir
(
dir_path
);
if
(
NULL
==
dir_path
)
{
printf
(
"opendir %s failed.
\n
"
,
dir_path
);
return
;
}
while
(
1
)
{
errno
=
0
;
ptr_dirent
=
readdir
(
ptr_dir
);
if
(
NULL
==
ptr_dirent
)
{
break
;
}
if
(
ptr_dirent
->
d_type
&
DT_DIR
)
{
/* 跳过"."和".."目录 */
if
(
strcmp
(
ptr_dirent
->
d_name
,
"."
)
==
0
||
strcmp
(
ptr_dirent
->
d_name
,
".."
)
==
0
)
{
continue
;
}
char
newPath
[
512
];
sprintf
(
newPath
,
"%s/%s"
,
dir_path
,
ptr_dirent
->
d_name
);
list_files
(
newPath
);
}
else
{
char
newPath
[
512
];
sprintf
(
newPath
,
"%s/%s"
,
dir_path
,
ptr_dirent
->
d_name
);
printf
(
"%s
\n
"
,
newPath
);
if
(
NULL
!=
strstr
(
newPath
,
".cff.o"
))
{
printf
(
"handle %s
\n
"
,
newPath
);
FILE
*
file
=
fopen
(
newPath
,
"rb"
);
if
(
NULL
!=
file
)
{
fseek
(
file
,
48
,
SEEK_SET
);
unsigned
char
data
[
4
]
=
{
0x07
,
0x00
,
0x00
,
0x80
};
fwrite
(
data
,
1
,
4
,
file
);
fclose
(
file
);
}
}
}
}
if
(
errno
!=
0
)
{
printf
(
"readdir error, errno=%d.
\n
"
,
errno
);
}
closedir
(
ptr_dir
);
}
int
main
(
int
argc
,
char
*
argv
[])
{
if
((
argc
>
1
)
&&
(
0
==
strcmp
(
argv
[
1
],
"--help"
)))
{
printf
(
"%s [dir...]
\n
"
,
argv
[
0
]);
return
-
1
;
}
if
(
argc
==
1
)
{
list_files
(
"."
);
}
else
{
for
(
argv
++
;
*
argv
!=
NULL
;
argv
++
)
{
list_files
(
*
argv
);
}
}
return
0
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment