-
Notifications
You must be signed in to change notification settings - Fork 319
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add function to initialize locale directory localedir #796
Closed
Closed
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
e6747c4
Add function to initialise locale directory
jim-easterbrook 78964fb
Change function name to gp_init_localedir
jim-easterbrook acbfb48
Check bindtextdomain return value
jim-easterbrook 3359692
Only set success flag in the success case
ndim 71d99e9
doc gp_init_localedir(): Use AE spelling for initialize
ndim fb33f1f
doc: elaborate on gp_init_localedir()
ndim e6c2753
doc: Call it localedir everywhere to make greps easier
ndim fa1e055
update libgphoto2 libtool library version, preserving soname
ndim c6ae59f
symver file comment inconsistency fixes
ndim 5b0f589
fix the symver file comment inconsistency fixes
ndim 4093c19
Add gp_port_init_localedir() analog to gp_init_localedir()
ndim a37539f
update libgphoto2_port libtool library version, preserving soname
ndim 861ea56
spelling fix for locale_initialized static var
ndim cf1643a
Move gp_port_init_localedir symbol to LIBGPHOTO2_5_0
ndim 39af93e
doc: Document behaviour of *_init_localedir(NULL) call
ndim f7ec1f5
libgphoto2_port.ver whitespace cleanup
ndim 820e6e7
localedir value NULL means compile time default LOCALEDIR
ndim 8248a7f
add C coding style for emacs
ndim 2727639
Add test-init-localedir test program
ndim File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
/** \file tests/test-init-localedir.c | ||
* \brief Exercise the *_init_localedir() functions | ||
* | ||
* Copyright 2022 Hans Ulrich Niedermann <hun@n-dimensional.de> | ||
* | ||
* This library is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU Lesser General Public | ||
* License as published by the Free Software Foundation; either | ||
* version 2 of the License, or (at your option) any later version. | ||
* | ||
* This library is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public | ||
* License along with this library; if not, write to the | ||
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | ||
* Boston, MA 02110-1301 USA | ||
* | ||
* | ||
* Usage: | ||
* ./test-init-localedir /foo/share/locale | ||
* ./test-init-localedir /foo/share/locale NULL | ||
* ./test-init-localedir NULL /foo/share/locale /usr/share/locale | ||
* | ||
* Calls the gp_init_localedir() for each and every command line | ||
* argument in sequence. Command line arguments are interpreted as | ||
* directory paths (absolute or relative to the current working | ||
* directory), but "NULL" is interpreted as a C NULL value. | ||
*/ | ||
|
||
#include <stdio.h> | ||
#include <string.h> | ||
|
||
#include <gphoto2/gphoto2-port-log.h> | ||
#include <gphoto2/gphoto2-abilities-list.h> | ||
|
||
|
||
void log_func(GPLogLevel level, const char *domain, | ||
const char *str, void *data) | ||
{ | ||
printf("%d:%s:%s\n", level, domain, str); | ||
} | ||
|
||
|
||
int main(const int argc, const char *const argv[]) | ||
{ | ||
gp_log_add_func(GP_LOG_ALL, log_func, NULL); | ||
for (int i=1; i<argc; ++i) { | ||
const char *const arg = argv[i]; | ||
const char *const localedir = | ||
(strcmp(arg, "NULL") == 0) ? NULL : argv[1]; | ||
printf("main: calling gp_init_localedir(%s)\n", | ||
localedir?localedir:"(null)"); | ||
gp_init_localedir(localedir); | ||
} | ||
} | ||
|
||
|
||
/* | ||
* Local Variables: | ||
* c-file-style:"linux" | ||
* indent-tabs-mode:t | ||
* End: | ||
*/ |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these are weird?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah, but i see its all commented out.