Lines Matching refs:lc

151 login_close(login_cap_t * lc)
153 if (lc) {
154 free(lc->lc_style);
155 free(lc->lc_class);
156 free(lc->lc_cap);
157 free(lc);
186 login_cap_t *lc;
188 if ((lc = malloc(sizeof(login_cap_t))) != NULL) {
223 memset(lc, 0, sizeof(login_cap_t));
224 lc->lc_cap = lc->lc_class = lc->lc_style = NULL;
229 switch (cgetent(&lc->lc_cap, login_dbarray, name)) {
247 if (cgetent(&lc->lc_cap, login_dbarray, name) != 0 && r >= 0)
251 if ((lc->lc_class = strdup(name)) != NULL) {
257 return lc;
280 free(lc);
349 login_getcapstr(login_cap_t *lc, const char *cap, const char *def, const char *error)
354 if (lc == NULL || cap == NULL || lc->lc_cap == NULL || *cap == '\0')
357 if ((ret = cgetstr(lc->lc_cap, cap, &res)) == -1)
371 login_getcaplist(login_cap_t *lc, const char *cap, const char *chars)
377 if ((lstring = login_getcapstr(lc, cap, NULL, NULL)) != NULL)
385 * From the login_cap_t <lc>, get the capability <cap> which is
392 login_getpath(login_cap_t *lc, const char *cap, const char *error)
398 str = login_getcapstr(lc, cap, NULL, NULL);
517 * From the login_cap_t <lc>, get the capability <cap>, which is
519 * present in <lc>, return <def>; if there is an error of some kind,
524 login_getcaptime(login_cap_t *lc, const char *cap, rlim_t def, rlim_t error)
531 if (lc == NULL || lc->lc_cap == NULL)
540 if ((r = cgetstr(lc->lc_cap, cap, &res)) == -1)
566 lc->lc_class, cap, oval);
607 * From the login_cap_t <lc>, extract the numerical value <cap>.
615 login_getcapnum(login_cap_t *lc, const char *cap, rlim_t def, rlim_t error)
621 if (lc == NULL || lc->lc_cap == NULL)
627 if ((r = cgetstr(lc->lc_cap, cap, &res)) == -1) {
630 if ((r = cgetnum(lc->lc_cap, cap, &lval)) == -1)
648 lc->lc_class, cap, res);
660 * From the login_cap_t <lc>, extract the capability <cap>, which is
667 login_getcapsize(login_cap_t *lc, const char *cap, rlim_t def, rlim_t error)
673 if (lc == NULL || lc->lc_cap == NULL)
676 if ((r = cgetstr(lc->lc_cap, cap, &res)) == -1)
696 lc->lc_class, cap, oval);
734 * From the login_cap_t <lc>, check for the existance of the capability
735 * of <cap>. Return <def> if <lc>->lc_cap is NULL, otherwise return
740 login_getcapbool(login_cap_t *lc, const char *cap, int def)
742 if (lc == NULL || lc->lc_cap == NULL)
744 return (cgetcap(lc->lc_cap, cap, ':') != NULL);
750 * Given a login_cap entry <lc>, and optionally a type of auth <auth>,
763 * login_getstyle(lc, NULL, "ftp");
764 * login_getstyle(lc, "login", NULL);
765 * login_getstyle(lc, "skey", "network");
769 login_getstyle(login_cap_t *lc, const char *style, const char *auth)
780 authtypes = login_getcaplist(lc, realauth, NULL);
784 authtypes = login_getcaplist(lc, "auth", NULL);
800 lc->lc_style = NULL;
802 lc->lc_style = auths;
804 if (lc->lc_style != NULL)
805 lc->lc_style = strdup(lc->lc_style);
807 return lc->lc_style;