⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 pj_pr_list.cpp

📁 projapi是一个关于GIS行业投影转换的程序库
💻 CPP
字号:

#include "stdafx.h"

/* print projection's list of parameters */#ifndef lintstatic const char SCCSID[]="@(#)pj_pr_list.c	4.6   94/03/19 GIE REL";#endif#include "projects.h"#include <stdio.h>#include <string.h>
#define LINE_LEN 72static int pr_list(PJ *P, int not_used) 
{	paralist *t;	int l, n = 1, flag = 0;	(void)putchar('#');	for (t = P->params; t; t = t->next)		if ((!not_used && t->used) || (not_used && !t->used)) {			l = strlen(t->param) + 1;			if (n + l > LINE_LEN) {				(void)fputs("\n#", stdout);				n = 2;			}			(void)putchar(' ');			if (*(t->param) != '+')				(void)putchar('+');			(void)fputs(t->param, stdout);			n += l;		} else			flag = 1;	if (n > 1)		(void)putchar('\n');	return flag;}	void /* print link list of projection parameters */pj_pr_list(PJ *P) {	char const *s;	(void)putchar('#');	for (s = P->descr; *s ; ++s) {		(void)putchar(*s);		if (*s == '\n')			(void)putchar('#');	}	(void)putchar('\n');	if (pr_list(P, 0)) {		(void)fputs("#--- following specified but NOT used\n", stdout);		(void)pr_list(P, 1);	}}/************************************************************************//*                             pj_get_def()                             *//*                                                                      *//*      Returns the PROJ.4 command string that would produce this       *//*      definition expanded as much as possible.  For instance,         *//*      +init= calls and +datum= defintions would be expanded.          *//************************************************************************/char *pj_get_def( PJ *P, int options ){    paralist *t;    int l;    char *definition;    int  def_max = 10;    definition = (char *) pj_malloc(def_max);    definition[0] = '\0';    for (t = P->params; t; t = t->next)    {        l = strlen(t->param) + 1;        if( strlen(definition) + l + 5 > def_max )        {            char *def2;            def_max = def_max * 2 + l + 5;            def2 = (char *) pj_malloc(def_max);            strcpy( def2, definition );            pj_dalloc( definition );            definition = def2;        }        strcat( definition, " +" );        strcat( definition, t->param );    }    return definition;}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -