1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

s3/lib: add get_remote_arch_from_str()

This will be used when fetching remote arch from gencache.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
Ralph Boehme 2016-04-13 17:55:11 +02:00 committed by Jeremy Allison
parent 6b5b004918
commit 44c236ac7f
2 changed files with 13 additions and 0 deletions

View File

@ -389,6 +389,7 @@ bool fcntl_getlock(int fd, off_t *poffset, off_t *pcount, int *ptype, pid_t *ppi
bool is_myname(const char *s);
void ra_lanman_string( const char *native_lanman );
const char *get_remote_arch_str(void);
enum remote_arch_types get_remote_arch_from_str(const char *remote_arch_string);
void set_remote_arch(enum remote_arch_types type);
enum remote_arch_types get_remote_arch(void);
const char *tab_depth(int level, int depth);

View File

@ -1260,6 +1260,18 @@ const char *get_remote_arch_str(void)
return remote_arch_strings[ra_type];
}
enum remote_arch_types get_remote_arch_from_str(const char *remote_arch_string)
{
int i;
for (i = 0; i < ARRAY_SIZE(remote_arch_strings); i++) {
if (strcmp(remote_arch_string, remote_arch_strings[i]) == 0) {
return i;
}
}
return RA_UNKNOWN;
}
/*******************************************************************
Set the horrid remote_arch string based on an enum.
********************************************************************/