Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
kicad-source-mirror
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
kicad-source-mirror
Commits
c4722e0f
Commit
c4722e0f
authored
Jan 16, 2011
by
Dick Hollenbeck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
StrPurge(), see mailing list
parent
6e119c2b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
14 deletions
+22
-14
string.cpp
common/string.cpp
+8
-9
librairi.cpp
pcbnew/librairi.cpp
+8
-4
loadcmp.cpp
pcbnew/loadcmp.cpp
+6
-1
No files found.
common/string.cpp
View file @
c4722e0f
...
@@ -42,18 +42,17 @@ int ReadDelimitedText( char* dest, char* source, int NbMaxChar )
...
@@ -42,18 +42,17 @@ int ReadDelimitedText( char* dest, char* source, int NbMaxChar )
*/
*/
char
*
StrPurge
(
char
*
text
)
char
*
StrPurge
(
char
*
text
)
{
{
c
har
*
ptspace
;
c
onst
char
whitespace
[]
=
"
\t\n\r\f\v
"
;
if
(
text
==
NULL
)
if
(
text
)
return
NULL
;
{
while
(
strchr
(
whitespace
,
*
text
)
)
++
text
;
while
(
(
*
text
<=
' '
)
&&
*
text
)
char
*
cp
=
text
+
strlen
(
text
)
-
1
;
text
++
;
ptspace
=
text
+
strlen
(
text
)
-
1
;
while
(
cp
>=
text
&&
strchr
(
whitespace
,
*
cp
)
)
while
(
(
*
ptspace
<=
' '
)
&&
*
ptspace
&&
(
ptspace
>=
text
)
)
*
cp
--
=
'\0'
;
{
*
ptspace
=
0
;
ptspace
--
;
}
}
return
text
;
return
text
;
...
...
pcbnew/librairi.cpp
View file @
c4722e0f
...
@@ -100,7 +100,6 @@ MODULE* WinEDA_ModuleEditFrame::Import_Module( )
...
@@ -100,7 +100,6 @@ MODULE* WinEDA_ModuleEditFrame::Import_Module( )
Footprint_Is_GPCB_Format
=
true
;
Footprint_Is_GPCB_Format
=
true
;
else
else
{
{
fclose
(
file
);
DisplayError
(
this
,
_
(
"Not a module file"
)
);
DisplayError
(
this
,
_
(
"Not a module file"
)
);
return
NULL
;
return
NULL
;
}
}
...
@@ -211,6 +210,7 @@ void WinEDA_ModuleEditFrame::Export_Module( MODULE* aModule, bool aCreateSysLib
...
@@ -211,6 +210,7 @@ void WinEDA_ModuleEditFrame::Export_Module( MODULE* aModule, bool aCreateSysLib
fputs
(
"$EndLIBRARY
\n
"
,
file
);
fputs
(
"$EndLIBRARY
\n
"
,
file
);
fclose
(
file
);
fclose
(
file
);
SetLocaleTo_Default
();
// revert to the current locale
SetLocaleTo_Default
();
// revert to the current locale
msg
.
Printf
(
_
(
"Module exported in file <%s>"
),
msg
.
Printf
(
_
(
"Module exported in file <%s>"
),
...
@@ -238,6 +238,7 @@ void WinEDA_ModuleEditFrame::Delete_Module_In_Library( const wxString& aLibname
...
@@ -238,6 +238,7 @@ void WinEDA_ModuleEditFrame::Delete_Module_In_Library( const wxString& aLibname
/* Confirmation */
/* Confirmation */
msg
.
Printf
(
_
(
"Ok to delete module %s in library %s"
),
msg
.
Printf
(
_
(
"Ok to delete module %s in library %s"
),
GetChars
(
CmpName
),
GetChars
(
aLibname
)
);
GetChars
(
CmpName
),
GetChars
(
aLibname
)
);
if
(
!
IsOK
(
this
,
msg
)
)
if
(
!
IsOK
(
this
,
msg
)
)
return
;
return
;
...
@@ -587,7 +588,8 @@ int WinEDA_BasePcbFrame::Save_Module_In_Library( const wxString& aLibName,
...
@@ -587,7 +588,8 @@ int WinEDA_BasePcbFrame::Save_Module_In_Library( const wxString& aLibName,
if
(
!
aOverwrite
)
/* Do not save the given footprint: an old
if
(
!
aOverwrite
)
/* Do not save the given footprint: an old
* one exists */
* one exists */
{
{
fclose
(
lib_module
);
return
1
;
fclose
(
lib_module
);
return
1
;
}
}
end
=
1
;
break
;
end
=
1
;
break
;
}
}
...
@@ -680,7 +682,8 @@ int WinEDA_BasePcbFrame::Save_Module_In_Library( const wxString& aLibName,
...
@@ -680,7 +682,8 @@ int WinEDA_BasePcbFrame::Save_Module_In_Library( const wxString& aLibName,
fprintf
(
dest
,
"$EndLIBRARY
\n
"
);
fprintf
(
dest
,
"$EndLIBRARY
\n
"
);
aModule
->
m_TimeStamp
=
tmp
;
aModule
->
m_TimeStamp
=
tmp
;
fclose
(
dest
);
fclose
(
lib_module
);
fclose
(
dest
);
fclose
(
lib_module
);
SetLocaleTo_Default
();
// revert to the current locale
SetLocaleTo_Default
();
// revert to the current locale
wxEndBusyCursor
();
wxEndBusyCursor
();
...
@@ -826,7 +829,8 @@ int WinEDA_ModuleEditFrame::Create_Librairie( const wxString& LibName )
...
@@ -826,7 +829,8 @@ int WinEDA_ModuleEditFrame::Create_Librairie( const wxString& LibName )
{
{
msg
=
_
(
"Create error "
)
+
LibName
;
msg
=
_
(
"Create error "
)
+
LibName
;
DisplayError
(
this
,
msg
);
DisplayError
(
this
,
msg
);
fclose
(
lib_module
);
return
-
1
;
fclose
(
lib_module
);
return
-
1
;
}
}
fprintf
(
lib_module
,
" %s
\n
"
,
DateAndTime
(
cbuf
)
);
fprintf
(
lib_module
,
" %s
\n
"
,
DateAndTime
(
cbuf
)
);
...
...
pcbnew/loadcmp.cpp
View file @
c4722e0f
...
@@ -309,11 +309,16 @@ MODULE* WinEDA_BasePcbFrame::Get_Librairie_Module(
...
@@ -309,11 +309,16 @@ MODULE* WinEDA_BasePcbFrame::Get_Librairie_Module(
Line
=
reader
.
Line
();
Line
=
reader
.
Line
();
if
(
Line
[
0
]
!=
'$'
)
if
(
Line
[
0
]
!=
'$'
)
continue
;
continue
;
if
(
Line
[
1
]
!=
'M'
)
if
(
Line
[
1
]
!=
'M'
)
continue
;
continue
;
if
(
strnicmp
(
Line
,
"$MODULE"
,
7
)
!=
0
)
if
(
strnicmp
(
Line
,
"$MODULE"
,
7
)
!=
0
)
continue
;
continue
;
/* Read module name. */
StrPurge
(
Line
+
8
);
// Read module name.
Name
=
CONV_FROM_UTF8
(
Line
+
8
);
Name
=
CONV_FROM_UTF8
(
Line
+
8
);
if
(
Name
.
CmpNoCase
(
aModuleName
)
==
0
)
if
(
Name
.
CmpNoCase
(
aModuleName
)
==
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