]> git.ozlabs.org Git - ccan/blobdiff - ccan/graphql/_info
tal: add tal_dup_or_null and tal_dup_talarr helpers.
[ccan] / ccan / graphql / _info
index efdb6a1395d78d7500c4bfaf52b82b000ee47520..29202414ecac45a05e13b2ff653d18d7c30a2833 100644 (file)
  *    <https://github.com/rl-d/ccan>
  * 
  * Example:
- *     #include <stdio.h>
- *     #include "ccan/graphql/graphql.h"
  *     
- *     int main(int argc, char *argv[])
+ *     int main(int argc, char *argv[]) {
  *     
  *             const char *input_string = "{ fieldName }";
  *             struct list_head *output_tokens;
  *             struct graphql_executable_document *output_document;
  *     
  *             const char *errmsg = graphql_lexparse(
- *                     input_string,
  *                     NULL, // tal context
+ *                     input_string,
  *                     &output_tokens, // variable to receive tokens
  *                     &output_document); // variable to receive AST
  *     
  *             if (errmsg) {
  *                     struct graphql_token *last_token;
- *                     last_token = list_tail(output_tokens, struct graphql_token, list);
+ *                     last_token = list_tail(output_tokens, struct graphql_token, node);
  *                     printf("Line %d, col %d: %s",
  *                             last_token->source_line,
  *                             last_token->source_column + last_token->source_len,
@@ -56,7 +54,7 @@ int main(int argc, char *argv[])
 
        if (strcmp(argv[1], "depends") == 0) {
                printf("ccan/list\n");
-               printf("ccan/take\n");
+               printf("ccan/str\n");
                printf("ccan/tal\n");
                printf("ccan/tal/str\n");
                printf("ccan/utf8\n");