return g_strndup(rsc_type, strnlen(rsc_type, MAX_LENGTH_OF_RSCNAME));
char ra_pathname[RA_MAX_NAME_LENGTH]; FILE * fp; gboolean next_continue; GString * meta_data; const int BUFLEN = 132; char buffer[BUFLEN]; char * provides  = NULL, * req_start = NULL, * req_stop  = NULL, * shld_start = NULL, * shld_stop  = NULL, * dflt_start = NULL, * dflt_stop  = NULL, * s_dscrpt  = NULL; GString * l_dscrpt = NULL;   get_ra_pathname(RA_PATH, rsc_type, NULL, ra_pathname); if ( (fp = fopen(ra_pathname, "r")) == NULL ) { cl_log(LOG_ERR, "Failed to open lsb RA %s. No meta-data gotten." , rsc_type); return NULL; } meta_data = g_string_new("");  next_continue = FALSE; while (NULL != fgets(buffer, BUFLEN, fp)) {  if ( next_continue == TRUE ) { continue; } if (strlen(buffer) == BUFLEN ) { next_continue = TRUE; } else { next_continue = FALSE; }  if ( 0 == strncmp(buffer , LSB_INITSCRIPT_BEGIN_TAG , strlen(LSB_INITSCRIPT_BEGIN_TAG)) ) { break; } }   while ( NULL != fgets(buffer, BUFLEN, fp) ) {  RALSB_GET_VALUE(provides,   PROVIDES) RALSB_GET_VALUE(req_start,  REQ_START) RALSB_GET_VALUE(req_stop,   REQ_STOP) RALSB_GET_VALUE(shld_start, SHLD_START) RALSB_GET_VALUE(shld_stop,  SHLD_STOP) RALSB_GET_VALUE(dflt_start, DFLT_START) RALSB_GET_VALUE(dflt_stop,  DFLT_STOP) RALSB_GET_VALUE(s_dscrpt,  SHORT_DSCR)   if ( (l_dscrpt == NULL) & (0 == strncmp(buffer, DESCRIPTION , strlen(DESCRIPTION))) ) { l_dscrpt = g_string_new(buffer+strlen(DESCRIPTION));  while ( NULL != fgets(buffer, BUFLEN, fp) ) { if ( (0 == strncmp(buffer, "#  ", 3)) || (0 == strncmp(buffer, "#\t", 2)) ) { buffer[0] = ' '; l_dscrpt = g_string_append(l_dscrpt , buffer); } else { fputs(buffer, fp); break;  } } continue; }  if ( 0 == strncmp(buffer, LSB_INITSCRIPT_END_TAG , strlen(LSB_INITSCRIPT_END_TAG)) ) {  break; } } fclose(fp);  g_string_sprintf( meta_data, meta_data_template, rsc_type , (l_dscrpt==NULL)? rsc_type : l_dscrpt->str , (s_dscrpt==NULL)? rsc_type : s_dscrpt , (provides==NULL)? "" : provides , (req_start==NULL)? "" : req_start , (req_stop==NULL)? "" : req_stop , (shld_start==NULL)? "" : shld_start , (shld_stop==NULL)? "" : shld_stop , (dflt_start==NULL)? "" : dflt_start , (dflt_stop==NULL)? "" : dflt_stop );  if ( l_dscrpt != NULL) { g_string_free(l_dscrpt, TRUE); l_dscrpt = NULL; } ZAPGDOBJ(s_dscrpt); ZAPGDOBJ(provides); ZAPGDOBJ(req_start); ZAPGDOBJ(req_stop); ZAPGDOBJ(shld_start); ZAPGDOBJ(shld_stop); ZAPGDOBJ(dflt_start); ZAPGDOBJ(dflt_stop);  return meta_data->str;
get_resource_meta(const char* rsc_type,  const char* provider){	return g_strndup(rsc_type, strnlen(rsc_type, MAX_LENGTH_OF_RSCNAME));}