Ejemplo n.º 1
0
void cgit_print_summary()
{
	html("<table summary='repository info' class='list nowrap'>");
	cgit_print_branches(ctx.cfg.summary_branches);
	html("<tr class='nohover'><td colspan='4'>&nbsp;</td></tr>");
	cgit_print_tags(ctx.cfg.summary_tags);
	if (ctx.cfg.summary_log > 0) {
		html("<tr class='nohover'><td colspan='4'>&nbsp;</td></tr>");
		cgit_print_log(ctx.qry.head, 0, ctx.cfg.summary_log, NULL,
			       NULL, NULL, 0, 0);
	}
	if (ctx.repo->clone_url) {
		char *full_clone = expand_macros(ctx.repo->clone_url);
		char *pound = full_clone;
		while (1) {
			pound = strchr(pound, '#');
			if (pound == NULL) break;
			*pound = ' ';
			pound++;
		}
		print_url(full_clone, NULL);
		/*print_urls(expand_macros(ctx.repo->clone_url), NULL);*/
	} else if (ctx.cfg.clone_prefix)
		print_urls(ctx.cfg.clone_prefix, ctx.repo->url);
	html("</table>");
}
Ejemplo n.º 2
0
static void print_urls(char *txt, char *suffix)
{
	char *h = txt, *t, c;

	while (h && *h) {
		while (h && *h == ' ')
			h++;
		t = h;
		while (t && *t && *t != ' ')
			t++;
		c = *t;
		*t = 0;
		print_url(h, suffix);
		*t = c;
		h = t;
	}
}
Ejemplo n.º 3
0
int main() {

  boost::asio::io_service io;
  print_url(
      io, "www.httpbin.org", "/",

      // The callback - which takes a reference to the coroutine variables
      // struct, an exception pointer, and op which tells us how we exited the
      // coroutine
      [&](auto &variables, std::exception_ptr e, auto op) {
        if (e) {
          std::cerr << "\nHad an exception\n";
        } else {
          std::cout << "\nFinished successfully\n";
        }
      });

  io.run();
};