clean:
rm -f *.o *.d
rm -f $(TESTS)
+ rm -f $(PROG_TARGETS)
rm -rf autom4te.cache/
rm -f config.status
rm -f config.log
rm -f libldns.a
+ rm -f tags
testclean:
rm -f $(TESTS)
uint8_t ldns_rdf2native_int8(ldns_rdf *);
uint16_t ldns_rdf2native_int16(ldns_rdf *);
uint32_t ldns_rdf2native_int32(ldns_rdf *);
-ldns_rdf * ldns_native2rdf_int8(ldns_rdf_type type, uint8_t value);
-ldns_rdf * ldns_native2rdf_int16(ldns_rdf_type type, uint16_t value);
-ldns_rdf * ldns_native2rdf_int32(ldns_rdf_type type, uint32_t value);
-ldns_rdf * ldns_native2rdf_int16_data(uint16_t size, uint8_t *data);
+ldns_rdf *ldns_native2rdf_int8(ldns_rdf_type type, uint8_t value);
+ldns_rdf *ldns_native2rdf_int16(ldns_rdf_type type, uint16_t value);
+ldns_rdf *ldns_native2rdf_int32(ldns_rdf_type type, uint32_t value);
+ldns_rdf *ldns_native2rdf_int16_data(uint16_t size, uint8_t *data);
uint32_t ldns_str2period(const char *, const char **);
ldns_rdf *ldns_rdf_address_reverse(ldns_rdf *);
+ldns_rdf *ldns_rdf_new_frm_fp(ldns_rdf_type type, FILE *fp);
+
#endif /* !_LDNS_RDATA_H */
void ldns_rr_list2canonical(ldns_rr_list *);
void ldns_rr2canonical(ldns_rr *);
+ldns_rr * ldns_rr_new_frm_fp(FILE *fp);
+
+
#endif /* _LDNS_RR_H */
}
}
+/**
+ * Create a new rdf from a file containing a string
+ * \param[in] fp the file pointer to use
+ * \param[in] t type to use
+ * \return ldns_rdf*
+ */
+ldns_rdf *
+ldns_rdf_new_frm_fp(ldns_rdf_type type, FILE *fp)
+{
+ char *line;
+
+ line = XMALLOC(char, MAXLINE_LEN + 1);
+ if (!line) {
+ return NULL;
+ }
+
+ /* read an entire line in from the file */
+ if (readword(line, fp, "\n", MAXLINE_LEN) == -1) {
+ return NULL;
+ }
+ return ldns_rdf_new_frm_str(type, (const char*) line);
+}
+
/**
* reverse an rdf, only actually usefull for AAAA and A records
* the returned rdf has the type LDNS_RDF_TYPE_DNAME!
}
+/**
+ * Create a new rr from a file containing a string
+ * \param[in] fp the file pointer to use
+ * \param[in] t type to use
+ * \return ldns_rr*
+ */
+ldns_rr *
+ldns_rr_new_frm_fp(FILE *fp)
+{
+ char *line;
+
+ line = XMALLOC(char, MAXLINE_LEN + 1);
+ if (!line) {
+ return NULL;
+ }
+
+ /* read an entire line in from the file */
+ if (readword(line, fp, "\n", MAXLINE_LEN) == -1) {
+ return NULL;
+ }
+ return ldns_rr_new_frm_str((const char*) line);
+}
/**
* \brief set the owner in the rr structure