add pos and unset_signals funcs
This commit is contained in:
parent
c3ff1bcebb
commit
b51098f521
@ -673,6 +673,20 @@ g_atoi(char* str)
|
|||||||
return atoi(str);
|
return atoi(str);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
int
|
||||||
|
g_pos(char* str, char* to_find)
|
||||||
|
{
|
||||||
|
char* pp;
|
||||||
|
|
||||||
|
pp = strstr(str, to_find);
|
||||||
|
if (pp == 0)
|
||||||
|
{
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
return (pp - str);
|
||||||
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
long
|
long
|
||||||
g_load_library(char* in)
|
g_load_library(char* in)
|
||||||
@ -779,6 +793,16 @@ g_signal_child_stop(void (*func)(int))
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
void
|
||||||
|
g_unset_signals(void)
|
||||||
|
{
|
||||||
|
sigset_t mask;
|
||||||
|
|
||||||
|
sigemptyset(&mask);
|
||||||
|
sigprocmask(SIG_SETMASK, &mask, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
int
|
int
|
||||||
g_fork(void)
|
g_fork(void)
|
||||||
|
@ -117,6 +117,8 @@ int
|
|||||||
g_strncmp(char* c1, char* c2, int len);
|
g_strncmp(char* c1, char* c2, int len);
|
||||||
int
|
int
|
||||||
g_atoi(char* str);
|
g_atoi(char* str);
|
||||||
|
int
|
||||||
|
g_pos(char* str, char* to_find);
|
||||||
long
|
long
|
||||||
g_load_library(char* in);
|
g_load_library(char* in);
|
||||||
int
|
int
|
||||||
@ -136,6 +138,8 @@ void
|
|||||||
g_signal(int sig_num, void (*func)(int));
|
g_signal(int sig_num, void (*func)(int));
|
||||||
void
|
void
|
||||||
g_signal_child_stop(void (*func)(int));
|
g_signal_child_stop(void (*func)(int));
|
||||||
|
void
|
||||||
|
g_unset_signals(void);
|
||||||
int
|
int
|
||||||
g_fork(void);
|
g_fork(void);
|
||||||
int
|
int
|
||||||
|
Loading…
Reference in New Issue
Block a user