Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
mdmngr
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
IOPSYS
mdmngr
Commits
5548f666
Commit
5548f666
authored
7 years ago
by
Jakob Olsson
Browse files
Options
Downloads
Patches
Plain Diff
common: move remove_newline to common.c, add some documentation, minor change to isdigits
parent
56b52ce9
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
common.c
+14
-3
14 additions, 3 deletions
common.c
common.h
+27
-1
27 additions, 1 deletion
common.h
with
41 additions
and
4 deletions
common.c
+
14
−
3
View file @
5548f666
...
...
@@ -127,10 +127,10 @@ fail_doc_ptr:
}
int
isdigits
(
const
char
*
pin
)
int
isdigits
(
const
char
*
str
)
{
while
(
*
pin
)
{
if
(
isdigit
(
*
pin
++
)
==
0
)
while
(
*
str
)
{
if
(
isdigit
(
*
str
++
)
==
0
)
return
false
;
}
...
...
@@ -220,3 +220,14 @@ int check_response(struct json_object *response)
fail:
return
-
1
;
}
void
remove_newline
(
char
*
input
)
{
char
*
pos
;
pos
=
strchr
(
input
,
'\n'
);
if
(
!
pos
)
return
;
*
pos
=
'\0'
;
}
This diff is collapsed.
Click to expand it.
common.h
+
27
−
1
View file @
5548f666
...
...
@@ -75,8 +75,34 @@ void json_to_blob(struct json_object *response, struct blob_buf *bb);
char
*
xml_parser
(
struct
write_result
*
result
,
char
*
tag
);
struct
json_object
*
xml_to_json_converter
(
struct
write_result
*
result
);
int
isdigits
(
const
char
*
pin
);
/**
* Function: isdigits
*
* Checks if a string is made up entirely out of digits.
*
* Parameters:
* str - the string to check for digits.
*
* Returns:
* true if the string is made up entirely out of digits.
* false if the string contains any non-digit character.
*/
int
isdigits
(
const
char
*
str
);
int
validate_puk_format
(
char
*
puk
);
/**
* Function: validate_pin_format
*
* Checks whether a given PIN code is of valid format or not.
*
* Parameters:
* pin - the string to check for structure validity
*
* Returns:
* 0 if the string is of valid format.
* -1 on invalid format.
*/
int
validate_pin_format
(
char
*
pin
);
int
pin_status
(
struct
blob_buf
*
bb
,
struct
device
*
dev
);
int
check_response
(
struct
json_object
*
response
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment